Hi All, I have encountered a problem I hoped someone here would be able to help me out with. The setup is I want to estimate a simple OLS, proc reg, on observations prior to a specified data and then predict on all observations in my sample to calculate residuals. The estimation command is proc reg data=analy6_w2; model felt_200 = jan feb mar apr may jun jul aug sep okt nov dec /noint ; where dto <= 17897; run; However, 17897 is end of 2008 and I would to use to parameter estimate on the monthly dummies for prediction and calculations of residuals on my full sample (dto goes to 18840). Basically want I would like is to subtract the monthly average in jan 2008 from the monthly average in jan 2009, and jan 2010 and 2011 same with feb and so on. At the moment I am doing by hand like this: data analy6_w3; set analy6_w2; IF jan=1 THEN res = felt_200 - 134662; IF feb=1 THEN res = felt_200 - 130125; IF mar=1 THEN res = felt_200 - 156824; IF apr=1 THEN res = felt_200 - 139780; IF may=1 THEN res = felt_200 - 157908; IF jun=1 THEN res = felt_200 - 119785; IF jul=1 THEN res = felt_200 - 128617; IF aug=1 THEN res = felt_200 - 113352; IF sep=1 THEN res = felt_200 - 119487; IF okt=1 THEN res = felt_200 - 186362; IF nov=1 THEN res = felt_200 - 149815; IF dec=1 THEN res = felt_200 - 290729; run; But there must be an easier way. Thanks in advance! Peer
... View more