I have a feeling this is a pretty straightforward issue but cannot figure it
out. I'd like to run a large number of identical models on a large number of
hypothetical datasets (all contained within the master file "statafile" and
identified by a unique ID), while accumulating paremeter estimates and
standard errors into an output dataset. Below is my code, please see the
parts in parentheses-- any help is appreciated.
/* RUN THE FIRST MODEL AND CREATE A BASE DATASET FOR APPENDING */
use statafile, clear
keep if id == 1
glm y x [fweight=n], family(binomial) link(identity) noheader
(How to save beta and standard error for X in a "base" dataset?)
/* RUN THE REST OF THE MODELS AND APPEND TO THE BASE */
forvalues i = 2/100{
use statafile, clear
keep if id == `i'
glm y x [fweight=n], family(binomial) link(identity) noheader
(How to save beta and standard error for X in a dataset)
(How to append to the base dataset and accumulate rows)
}
Thanks.
Garth Rauscher
Assistant Professor
SPH Epidemiology and Biostatistics
University of Illinois at Chicago
1603 W Taylor St (M/C/ 923)
Chicago, IL 60612
(312) 413-4317 phone
(312) 996-0064 fax
[email protected] <mailto:[email protected]> email
*
* 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/