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

st: b-coeff and p-values from "foreach" regression


From   "Garrard, Wendy M." <wendy.garrard@vanderbilt.edu>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: b-coeff and p-values from "foreach" regression
Date   Tue, 23 Nov 2004 21:46:28 -0600

Kit -- thanks so much for the syntax. I have been working with Stata
only a short time and have a long way to go yet on understanding the
command language.

I successfully ran your original syntax on my machine.  Next tried
substituting the random effects regression macro (metaregW) for line 4
in your syntax using the auto data (after generating a mock weight2
variable needed by the macro), thus:

   	 qui  metaregW price `v' [aw=weight2] , model(ml)    /* weight2
is a constant=1 for this test run */

But, I get one of two error messages: r(111) [headroom] not found; or
r(2000) no observations.

I know the metaregW macro will run in the simple foreach command, so
does that mean it should also work in this more complex foreach version?


Thanks in advance!
Wendy





Hi All,
As part of preliminary descriptive analysis I need to examine pairwise
correlations between the effect size and a large number of possible
covariates.  The tricky part is that I have discovered I need to examine
pairwise correlations which take into account a random effects
component.  I can do this by specifying bivariate random effect
regressions using a metaregW macro in a foreach command as below:

*****
 foreach var of varlist  VarGrp1_* VarGrp_2* VarGrp_3*   {
       metaregW EffectSize `var' [aw=weight] , model(ml) 
}
*****

But, this produces lots of extraneous output (R^2, Qs, 95%CIs, etc.)
since I only need the B1_coef and p-value from each run.

So, I am looking for a way to either capture the target values in a
table/list via a modification of the above command, or an alternative
method of creating a list of the B1_coefs and p's for this problem.

Any suggestions?

Much thanks,
Wendy

*
*   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