Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[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 <neppcra@gmail.com>
To   statalist@hsphsun2.harvard.edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index