Nick
It does not work in my case. The Beta and Constant I get is by month id, but Y is daily.....
It does not work in my case. The Beta and Constant I get is by month id, but Y is daily.....
. webuse grunfeld, clear
. rangestat (reg) mvalue invest, int(year 0 0)
. gen double residual = mvalue - b_cons - b_invest * invest
. list mvalue invest b_cons b_invest residual if year == 1950
+------------------------------------------------------+
| mvalue invest b_cons b_invest residual |
|------------------------------------------------------|
16. | 3755.6 642.9 221.98708 4.9984306 320.12187 |
36. | 1677.4 418.8 221.98708 4.9984306 -637.92973 |
56. | 1610.5 93.5 221.98708 4.9984306 921.15966 |
76. | 693.5 100.66 221.98708 4.9984306 -31.629126 |
96. | 240.1 55.74 221.98708 4.9984306 -260.49961 |
|------------------------------------------------------|
116. | 673.8 77.34 221.98708 4.9984306 65.2343 |
136. | 140.8 42.53 221.98708 4.9984306 -293.77033 |
156. | 635.2 32.24 221.98708 4.9984306 252.06352 |
176. | 274.6 43.48 221.98708 4.9984306 -164.71884 |
196. | 69.05 3.42 221.98708 4.9984306 -170.03171 |
+------------------------------------------------------+
Comment