Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Generating comparison tables


From   Roy Wada <[email protected]>
To   <[email protected]>
Subject   RE: st: Generating comparison tables
Date   Wed, 22 Apr 2009 11:29:00 -0700

 
The complete codes should have bee the following:
 
sysuse auto, clear
cap reg mpg fore            /* disables checking for e(b)*/
ren foreign treatment
egen outcome=cut(mpg), group(3)
qui levelsof outcome
 
mat pval=.051, .733, .825 /* insert local macro here */
mat colname pval=`r(levels)'

bys treatment: outreg2 outcome using myfile, tab replace
outreg2 using myfile, matrix(pval) excel

 
The checking for e(b) needs to be disabled, which can be done by running any 
regression beforehand. I guess it needs to be permanently disabled.
 
Roy
 

> This is very vague. But you can do something like this. It will give you freq, 
> percentage, and p-value, just as you asked.
> 
> sysuse auto, clear
> ren foreign treatment
> egen outcome=cut(mpg), group(3)
> qui levelsof outcome
> 
> mat pval=.051, .733, .825 /* insert local macro here */
> mat colname pval=`r(levels)'
> 
> cap erase myfile.txt
> bys treatment: outreg2 outcome using myfile, tab
> outreg2 using myfile, matrix(pval)
> 
_________________________________________________________________
Rediscover Hotmail®: Now available on your iPhone or BlackBerry
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile2_042009
*
*   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/



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