Closed MarcGillaizeau closed 3 years ago
Hi Marc,
the current behavior is as intended. The purpose of nolz
is to remove the leading zero that is printed by Stata in fixed format numbers (format %#.#f
), because many journals use a style where the leading zero is omitted. By default, however, estout
uses general format, where no leading zero exists in the first place, so nolz
is irrelevant. I never had any intention to add a zero in this case.
I agree that the description of the option in the help file is not super clear. What it tries to say is that for fixed format numbers (and the "automatic" format, although this is not explicitly mentioned) the default is not to remove the leading zero. It does not try to say that the default is to add a zero.
ben
Dear Ben,
I came across a small issue regarding the formatting of numbers whose absolute value is less than 1. The
estout
help file says that the default formatting for such numbers is to show a leading zero unlessnolz
is specified. It doesn't work when number format is left unspecified, or when thegeneral
format is specified:clear
set obs 10
g var = runiform()
eststo test: estpost sum var
estout test, cells(mean)
estout test, cells(mean(fmt(g)))
estout test, cells(mean(fmt(%g)))
estout test, cells(mean(fmt(%9.0g)))
Note that it works as default for
esttab
unless the%g
format is explicitly specified. In order to fix it, in theestout
ADO file I added this bit to yourvFormat
program:I inserted these lines right before you do:
local value: list retok value
It might not be the most elegant fix, but it sorts out the issue and I think it is stable. As far as I can tell there is no need to modify the
SignificantDigits
program.Very best regards,
Marc