Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: output format


From   austin nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: RE: output format
Date   Wed, 3 Aug 2005 14:28:26 -0400

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: wying1@umbc.edu [mailto:wying1@umbc.edu]
Sent: Wednesday, August 03, 2005 2:08 PM
To: statalist@hsphsun2.harvard.edu
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:SJ@SOCI.AU.DK]
Sent: Wednesday, August 03, 2005 1:45 PM
To: statalist@hsphsun2.harvard.edu
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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index