Statalist The Stata Listserver


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

st: Re: Accumulating parameter estimates


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   st: Re: Accumulating parameter estimates
Date   Tue, 12 Jun 2007 06:59:27 -0400

...
see -help statsby- for a pre-built solution to your problem.

Michael Blasnik

----- Original Message ----- From: "Garth Rauscher" <[email protected]>
To: <[email protected]>
Sent: Tuesday, June 12, 2007 12:10 AM
Subject: st: Accumulating parameter estimates



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)

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