For whatever reason, table.ado imposes format %9.0g on the n (count)
statistic when using fweights, inside the Valid subroutine (-else
global S_1 "%9.0gc"-).
There is one easy way around this: don't use fweights (i.e. expand if
absolutely necessary) or use iweights, pweights, or aweights as
appropriate.
. sysuse auto
. gen x=1000000
. table foreign [iweight=x] , c(mean mpg n mpg) format(%17.6f)
------------------------------------------------
Car type | mean(mpg) N(mpg)
----------+-------------------------------------
Domestic | 19.826923 52000000.000000
Foreign | 24.772728 22000000.000000
------------------------------------------------
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Wednesday, August 03, 2005 2:08 PM
To: [email protected]
Subject: Re: st: output format
Thanks, Svend. The only hesistation I have is that I intend to use
pweight, but the -tabulate - command doesn't compromise with the pweight.
-----Original Message-----
From: Svend Juul [mailto:[email protected]]
Sent: Wednesday, August 03, 2005 1:45 PM
To: [email protected]
Subject: Re: st: output format
Question: How to get N(expov2) display nicely?
----------------------------------------
I couldn't make it, even with the cellwidth(12) option; formatting
seems not to affect the N() column:
. sysuse auto
. gen x=1000000
. table foreign [fweight=x] , c(mean mpg n mpg) cellwidth(12)
--------------------------------------
Car type | mean(mpg) N(mpg)
----------+---------------------------
Domestic | 19.8269 5.20e+07
Foreign | 24.7727 2.20e+07
--------------------------------------
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/