I am trying to replicate Boons et al. (JFE, 2020) in R. First, I have a panel dataset with firm- and month-level variations in stock returns. Then, I have an inflation dataset that has times-series variations only. I regress the excess returns on the residual of inflation ARMA(1,1). That is:
R_{i,t}=a+β_{i,t}∗u_{t}+ε_{i,t}
{i} stands for firm, and {t} is month. Excess returns (R_{i,t}) are different each firm and month. In contrast, u_{t} is a residual of inflation ARMA (1,1) and has time-series variations only. Now, I want β_{i,t} to have both firm-level and time-series variations.
I ran a simple OLS regression as follows:
ols<-lm(ret~res, data=data)
where ret stands for R_{i,t} and res indicates u_{t}.
However, coefficients only have 597 values, showing only time-series variations and no firm-level variations. Screenshot of results: ols How can I obtain β_{i,t} that is different for each firm and month?