Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: estout and stats option


From   "raoul reulen" <[email protected]>
To   [email protected]
Subject   st: estout and stats option
Date   Wed, 21 May 2008 14:53:43 +0100

Dear all,

I'm running a meta-regression within a loop and want to use estout to
write the output to an excel file.
I want to run the regression model for several different groups and
have used a loop to do this.
Estout works fine, but I also want to add a certain p-value by using
the stats option (see example below). Estout puts the p-value
below the estimate in the same column. I wondered whether it is
possible to put the p-value in a separate column.
Thanks very much,



.forvalues i = 1/26  {
.metareg log_srr if  group`i' == 1 , wsse(selog_srr)
.est store m1
.estadd scalar pval`i' = chi2tail(e(df_Q), e(Q)):m1

.estout m1  using "C:\data\ma_reg.xls",	 /// 	
cells("b (fmt(%9.1f)) & ci(par( ( - ) ))" ) eform  ///	
varlabels( _cons "group`i'" )		 ///		
label collabels(, none)  mlabels(, none) stats( pval`i'  )
}


Raoul
-------------------------------------------------------
Raoul C. Reulen
Cancer Research UK Training Fellow
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index