Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: Using Spline Results from one Dataset to Estimate Values for a Second Dataset


From   NEPPC RA <[email protected]>
To   [email protected]
Subject   st: Using Spline Results from one Dataset to Estimate Values for a Second Dataset
Date   Tue, 13 Mar 2012 15:54:54 -0400

Hello,

I am using mkspline to derive a cost function for per capita
expenditure in a certain subset of my data, let's call it subset "A".
I then want to use the results from that regression to estimate values
for a completely different subset. Usually I can simply regress on the
variables in question and then specify predict XYZ. However, since
mkspline creates a series of variables only for subset "A", I can't
create predictions for the second subset. Any suggestions?

Code is below:

"mkspline PCspline_pop=ev_pop if dataset=="Original", cubic displayknots"
"xi: regressPCEXP `log'PCspline_pop* i.fips if dataset=="Original",
vce(cluster fips)"
"predict PCEXP_spline"

Tal Elmatad
Senior Research Assistant
Federal Reserve Bank of Boston
*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index