Regression:
BTM(i,t)=a(t) +a(i)+beta1*R(i,t)+beta2*R(i,t-1)+beta3*R(i,t-2)+beta4*R(i,t-3)+beta5*R(i,t-4) + noise
where a(t), a(i) are the fixed firm and time effects (which capture the mean of the dependent variable BTM for each firm across years and for each year across firms, respectively).
Two components are required to be estimated (following the approach explained below):
LAG=beta1*R(i,t)+beta2*R(i,t-1)+beta3*R(i,t-2)+beta4*R(i,t-3)+beta5*R(i,t-4)
FIRM=a(i)
The regression is estimated in an iterative fashion (rolling regression) using successive five-year panels of data and the components LAG and FIRM are estimated for the last year in the panel. The five year panel of data is shifted forward one year at a a time and the components LAG and FIRM are re-estimated.
For example, the BTM equation is estimated for years (say 1 to 5) and the estimated betas are used to calculated the component of LAG for the last year of that panel (i.e. year 5) and also FIRM. Then the process is repeated for the successive five year panel (i.e. from year 6 to 10), and so on for the the entire sample.
I tried the following:
forval j = 0/6 {
gen b`j'=.
forvalues y = 1972/2015 {
local low = `y' - 4
regress BTM R l.R l2.R l3.R l4.R i.firm i.yr (yr, `low', `y')
replace b0 = _b[_cons] if e(sample)
forval j = 1/6 {
replace b`j' = _b[``j''] if e(sample)
}
}
gen LAG = b1*R + b2*L.R+ b3*L2.R + ///
b4*L3.R + b5*L4.R
gen FIRM=
>>>>>>>>>>>
The code is not correct and I can not estimate the FIRM component.
Can you please suggest a proper way to estimate the regression and the components?
BTM(i,t)=a(t) +a(i)+beta1*R(i,t)+beta2*R(i,t-1)+beta3*R(i,t-2)+beta4*R(i,t-3)+beta5*R(i,t-4) + noise
where a(t), a(i) are the fixed firm and time effects (which capture the mean of the dependent variable BTM for each firm across years and for each year across firms, respectively).
Two components are required to be estimated (following the approach explained below):
LAG=beta1*R(i,t)+beta2*R(i,t-1)+beta3*R(i,t-2)+beta4*R(i,t-3)+beta5*R(i,t-4)
FIRM=a(i)
The regression is estimated in an iterative fashion (rolling regression) using successive five-year panels of data and the components LAG and FIRM are estimated for the last year in the panel. The five year panel of data is shifted forward one year at a a time and the components LAG and FIRM are re-estimated.
For example, the BTM equation is estimated for years (say 1 to 5) and the estimated betas are used to calculated the component of LAG for the last year of that panel (i.e. year 5) and also FIRM. Then the process is repeated for the successive five year panel (i.e. from year 6 to 10), and so on for the the entire sample.
I tried the following:
forval j = 0/6 {
gen b`j'=.
forvalues y = 1972/2015 {
local low = `y' - 4
regress BTM R l.R l2.R l3.R l4.R i.firm i.yr (yr, `low', `y')
replace b0 = _b[_cons] if e(sample)
forval j = 1/6 {
replace b`j' = _b[``j''] if e(sample)
}
}
gen LAG = b1*R + b2*L.R+ b3*L2.R + ///
b4*L3.R + b5*L4.R
gen FIRM=
>>>>>>>>>>>
The code is not correct and I can not estimate the FIRM component.
Can you please suggest a proper way to estimate the regression and the components?
Comment