Statalist The Stata Listserver


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

st: re: predicting y, with other variables


From   Kit Baum <baum@bc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: re: predicting y, with other variables
Date   Tue, 22 May 2007 10:39:15 -0400

sacrificial cabbage

Alessia said

I hope some of you can help me...
I estimate a regression and I saved the coefficients e(b) in the
corresponding matrix. Now I would like to apply these coefficients
estimates to the same set of x's variables, but for one that I want to
substitute with another and calculate the predicted values (to see
which is the variation in the rpedicted values using this other
variables). Anyone of you knows how to do this?
I tried creating a matrix with the new x's variables, but my n=2400
and so the matsize set does not allow me to create such a matrix.


Just create additional observations in your x matrix for the observations for which you want to predict 'out of sample'. When you run the regression, those observations will be ignored as their value of y is missing. Then

predict double oos if ~e(sample)

will generate predictions (using the default , xb) for the observations that are not in the regression sample.


Kit Baum, Boston College Economics and DIW Berlin
http://ideas.repec.org/e/pba1.html
An Introduction to Modern Econometrics Using Stata:
http://www.stata-press.com/books/imeus.html


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