[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: Re: How to refer to the constant in a previously estimated regression? |

Date |
Wed, 1 Jul 2009 22:06:49 +0200 |

<> *** sysuse auto, clear reg pr we re tr estimates save "modelA", replace reg pr we re tr tu estimates save "modelB", replace clear* sysuse auto, clear est use "modelA" predict newmodelA, xb replace newmodelA=newmodelA-_b[_cons] est use "modelB" predict newmodelB, xb replace newmodelB=newmodelB-_b[_cons] *** HTH Martin _______________________

To: <statalist@hsphsun2.harvard.edu> Sent: Wednesday, July 01, 2009 7:29 PM

I'm using Stata 10. I've previously estimated a couple of regressionmodelsand have saved the model coefficients to a .ster file. Now want to usethese model coefficients in conjunction with some new data to formpredictedvalues. I recall the old estimates using: estimates use "modelA" estimates store modelA estimates use "modelB" estimates store modelB Then I use: estimates for modelA: predict newmodelA, xb estimates for modelB: predict newmodelB, xb Both regression models included a constant and so the new sets of predictions (newmodelA and newmodelB) both incorporate their respectiveconstants. However, I'd like to subtract the regression constant frombothsets of predictions. In other words I'd like to: gen prednoconsA=newmodelA - [constant from model A] gen prednoconsB=newmodelB - [constant from model B]How do I refer to [constant from model A] and [constant from model B] todothis? Thanks. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: How to refer to the constant in a previously estimated regression?***From:*"sdm1" <sdm1@york.ac.uk>

- Prev by Date:
**RE: st: Obtaining Descriptive Statistics with Multiply Imputed Data** - Next by Date:
**Re: st: AW: RE: count in matched family-individuals file** - Previous by thread:
**st: How to refer to the constant in a previously estimated regression?** - Next by thread:
**st: Monthly observations to quarterly averages** - Index(es):

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