<>
You can -estpost- all these results in a quite straightforward manner, and
then -esttab- them with the matrix function of this command. For instance,
the lower panel of your table would be
***
sysuse auto, clear
estpost tab rep for, chi2
esttab ., main(b) aux(colpct) /*
*/ nostar unstack noobs nonum nonote /*
*/ sca("chi2 Chi2 Value" "p corr. p-value") /*
*/ sfmt(%4.3fc) wide compress
***
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Eduardo Nunez
Gesendet: Sonntag, 4. Oktober 2009 22:33
An: [email protected]
Betreff: st: Formatting tables with estpost & esttab
Dear statalister,
I have been trying to get the right code in estpost and esttab
(without success) to format tables as the example below (using auto
dataset):
Domestic (N=52) Foreign (N=22)
P-value Total (N=74)
Price 6179.3±3189.0 6070.1±2221.0
0.015 6146.0±2912.4
Mileage (mpg) 19.54±4.753 25.29±6.310
0.006 21.29±5.866
Repair Record 1978, n(%)
*0.000
1 2 (4.17)
0 (0)
2 (2.9)
2 8 (16.67)
0 (0)
8 (11.59)
3 27 (56.25)
3 (14.29) 30 (43.48)
4 9 (18.75)
9 (42.86) 18 (26.09)
5 2 (4.17)
9 (42.86) 11 (15.94)
*Omnibus P-value
The mean±SD [or median (IQR) when appropriate] for each variable and
for the total population with the p-value corresponding (either a
t-test or ranksum test);
For discrete variables, the n (%)...count(col percentage) and the
p-value corresponding to chi2.
I would really appreciate any help on this issue.
Best wishes,
Eduardo
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/