Dear RATS team,
I would like to run rolling FMOLS regressions on a panel dataset using a (fixed) moving window across time (the number of individuals is constant over the rolling regressions and N=21 in my case). To be more precise I would like to obtain the FMOLS for all 21 individuals:
- from 1970:1 to 1980:1,
- from 1971:1 to 1981:1,
- from 1972:1 to 1982:1, etc.....
(I know that 10 observations is a too short time span of data, but here it's just an example). In order to be sure on my calculations I tried to run the rolling regressions with 2 different codes:
- code 1 (drawn from RATS UG p411):
do j=0,3
set panelsmpl = %period(t)>=(1970:1+j).and.%period(t)<=(1980:1+j);
@panelfm(det=constant,print=none,lags=k,smpl=panelsmpl); # LRWH LRAH;
comp betaFM = %beta(1); comp tFM = %tstats(1);
dis j ##.###### betaFM ##.###### tFM
end
I get the following results (coefficient estimates and their respective tstats are displayed) :
0 -0.370142 -24.500219
1 -0.355562 -25.112992
2 -0.317983 -29.502267
3 -0.303955 -34.377598
- code 2:
do j = 0,3
@panelfm(det=constant,print=none,lags=k) 1//1970:1+j 21//1980:1+j; # LRWH LRAH;
comp betaFM = %beta(1); comp tFM = %tstats(1);
dis j ##.###### betaFM ##.###### tFM
end do j
In that case I get :
0 -0.218970 -31.185422
1 -0.209792 -31.120658
2 -0.203410 -31.032100
3 -0.202815 -31.081982
Needless to say, the dataset is exactly the same in the 2 cases. Do you have any idea how to explain the discrepancies in the resulats? And which one of these 2 codes (if any) is the right way to estimate rolling regressions on a panel dataset?
Thanks in advance,
Best,
Romain
Rolling (FMOLS) regressions on a panel dataset
Re: Rolling (FMOLS) regressions on a panel dataset
The first of those is correct. The range 1//1970:1+j 21//1980:1+j doesn't restrict the date range on an individual basis; you need the SMPL using %PERIOD to do that. See Selecting Subsamples.
Re: Rolling (FMOLS) regressions on a panel dataset
Dear Tom,
Thanks for your quick and clear reply.
Best
Romain
Thanks for your quick and clear reply.
Best
Romain