Statalist


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

st: How to 'predict' residual by region? Seasonal adjustment?


From   Galina An <ang@kenyon.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: How to 'predict' residual by region? Seasonal adjustment?
Date   Thu, 07 Aug 2008 17:06:49 -0400

Dear stata users,
I have another related question. I need to 'predict' residual by region. When I run the following code it only uses the coefficients from the last regression to predict residuals:

by region: reg migration t2 t3 t4
predict r, resid

if I try to do the loop, it says that r is already defined:

levelsof region_code, local(levels)
foreach levl of local levels {
reg migration t4 t2 t3 if region_code == `levl'
predict r, resid
}

Also, does anybody know a good seasonal adjustment procedure in Stata?
Thank you!

--
Galina An
Assistant Professor
Economics Department
Kenyon College

*
* 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   |   What's new   |   Site index