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

st: RE: 'Outreg'-ing command after the 'Repeat Stata command'


From   meganweil <meganweil@netzero.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: RE: 'Outreg'-ing command after the 'Repeat Stata command'
Date   Thu, 18 Sep 2003 14:25:26 -0400

Thanks Nick for your help.  Of course, after trying for days to figure out a way to do this, I found my answer almost immediately after posting my question.  You can use multiple commands in the 'repeat stata' command by separating them with a \.  Then one can name each of the outreg files based on the outcome variable for example:
 
for testa testb: regress X lead\ outreg using "X.doc"
for testa testb: regress X lead age gender\ outreg using "X.doc", append
 
If anyone has any other suggestions, let me know.
 

 
Question: Is there a way to use the 'Outreg' command after using the 'Repeat Stata command'? 
    This is my first posting so forgive me if I don't know the 'right' way to ask my question.
Details: I am using multiple linear regression for twenty different dependent outcomes variables.  There are several different 'models' I am looking at, which are consistent across the outcomes.  For each model, the independent variables are all the same.  So rather than type each equation separately I am using the Repeat Stata command for each model.  Now I need to compare different models for the outcome variables.  So for each outcome variable, I would like to look at the beta coefficient and confidence interval for the first independent variable for each model.
    My output would ideally look something like the following:
 
Test A Score:    Model 1    Model 2    Model 3
 
blood lead         beta1        beta2        beta3           
                        (CI1)         (CI2)         (CI3)
 
age                                   beta2a     beta3a
                                        (CI2a)       (CI3a)
 
gender                                             beta3b
                                                       (CI3b)
 
 
Test B Score:    Model 1    Model 2    Model 3
 
blood lead         beta1        beta2        beta3           
                        (CI1)         (CI2)         (CI3)
 
age                                   beta2a     beta3a
                                        (CI2a)       (CI3a)
 
gender                                             beta3b
                                                       (CI3b)
 
The problem is after typing the command:
 
for testa testb: regress X
 
. . . if I then use the outreg command it only captures the last regression.  Is there a way to use outreg to capture all of the regressions?  Thank you for any help!
 
 
 



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