Statalist The Stata Listserver


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

st: RE: Re: Accumulating parameter estimates


From   "Newson, Roger B" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: Accumulating parameter estimates
Date   Tue, 12 Jun 2007 12:40:41 +0100

Another possibility is the -parmest- package, downloadable from SSC from
within Stata using the -ssc- command. The -parmby- module of the
-parmest- package creates an output dataset (or resultsset) with 1
observation per parameter per by-group and data on parameter estimates,
standard errors, confidence limits, P-values and other parameter
attributes specified by the user. The -statsby- command, on the other
hand, creates an output dataset (or resultsset) with 1 observation per
by-group and data on statistics for that by-group.

If you are fitting multiple models, then the datasets from the various
models can be appended using the -dsconcat- package, also downloadable
from SSC. More about -parmest-, -dsconcat- and other resultsset-handling
packages can be found on my website (see References below). If your
version of Stata is not Version 9, then previous versions of these
packages can be downloaded from my website by typing, in Stata,

net from http://www.imperial.ac.uk/nhli/r.newson/

I hope this helps.

Roger


References

Newson R. Resultssets, resultsspreadsheets and resultsplots in Stata.
Presented at the 4th German Stata User Meeting, 31 March, 2006. Download
from
http://www.imperial.ac.uk/nhli/r.newson/

Generalized confidence interval plots using commands or dialogs.
Presented at the 11th UK Stata User Meeting, 17-18 May, 2005. Download
from
http://www.imperial.ac.uk/nhli/r.newson/

Newson R. From datasets to resultssets in Stata. Presented at the 10th
UK Stata User Meeting, 28-29 June, 2004. Download from
http://www.imperial.ac.uk/nhli/r.newson/

Newson R. Confidence intervals and p-values for delivery to the end
user. The Stata Journal 2003; 3(3): 245-269. Download pre-publication
draft from
http://www.imperial.ac.uk/nhli/r.newson/

Newson R. Creating plots and tables of estimation results using parmest
and friends. Presented at the 8th UK Stata User Meeting, 20-21 May,
2002. Download from
http://www.imperial.ac.uk/nhli/r.newson/
 


Roger Newson
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected] 
www.imperial.ac.uk/nhli/r.newson/

Opinions expressed are those of the author, not of the institution.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Michael
Blasnik
Sent: 12 June 2007 11:59
To: [email protected]
Subject: st: Re: Accumulating parameter estimates

...
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/

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