You'd have to use a matrix to add the p-value to e(). Assuming that
there is only a constant in the model you could do something like
this:
forvalues i = 1/26 {
metareg log_srr if group`i' == 1 , wsse(selog_srr)
mat pval = e(b)
mat pval[1,1] = chi2tail(e(df_Q), e(Q))
estadd matrix pval
estout . , cells("b(fmt(%9.1f)) & ci(par( ( - ) )) pval")
}
ben
On Wed, May 21, 2008 at 3:53 PM, raoul reulen <[email protected]> wrote:
> 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/
>
*
* 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/