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

st: Storing coefficients from a stepwise model


From   Elaine Thomas <e.thomas@cphc.keele.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: Storing coefficients from a stepwise model
Date   Tue, 01 Mar 2005 12:52:37 +0000

Dear all

I want to perform a stepwise logistic procedure on a number of bootstrapped samples and store the coefficients from each application of the regression in a single file.
I have thus far been able to generate the bootstrapped samples (thanks to David Harrison!) and store the coefficients - however, only if I do not use a stepwise approach to the regression, but simply tell it to fit a model containing a set number of independent variables, say x1 -x5, - this works well. So I get a single new file which contains the coefficients for each cycle, ie

Sample x1 x2 x3 x4 x5
1 0.24 0.35 0.84 0.08 0.75
2 0.22 0.40 0.78 0.12 0.69 ......

The complication in using the sw procedure is that the model derived in each sample may contain anywhere from all to none of the variables offered and when I try to get Stata to store the coefficients for the offered vbls, say x1-x5, I can't get it to store "." for those vbls that are not chosen in that cycle of the procedure

What I want is the same form of file as above but with . or even 0 for those vbls not ending up in the model for that sample, ie.

Sample x1 x2 x3 x4 x5
1 0.24 0 0.84 0.08 0.75
2 0.22 0.40 0.78 0 0.69 ......

Any help would be gratefully received

Best wishes
Elaine Thomas


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