Replication of the paper: “A Comprehensive Look at the Empirical Performance of Equity Premium Prediction”

I recently replicated the paper "A Comprehensive Look at the Empirical Performance of Equity Premium Prediction" and found out that my estimation of the equity premium differs from the data provided by the authors. I show my R code and how I calculate the equity premium.

$$R_{t+1} = \frac{P_{t+1} + D_{t+1}}{P_{t}},$$ where $$P_{t+1}$$ - price and $$D_{t+1}$$ is the dividends at time $$t+1$$. Then we take the log of this to obtain $$r_{t+1} = \log{R_{t+1}}$$ log returns. Finally we substract the log-risk free rate $$r_f = \log{(R_f + 1)}$$ from the log-returns $$rp_{div} = r_{t+1} - r_{f}$$.

R code:

colnames(annualy)[1] <- "Datum"
colnames(annualy)[3] <- "Dividends"
colnames(annualy)[4] <- "Yields"

#Total Return +
annualy <- annualy[, IndexDiv := Index + Dividends]

#Log returns
annualy <- annualy[, logretdiv:= c(NA, log(annualy$$IndexDiv[-1]) - log(annualy$$Index[-nrow(annualy)]))]

#The logarithm of risk-free rate
annualy <- annualy[, logRfree := log(Rfree + 1)]


Then if you compare the final value $$rp_{div}$$ with CRSP_SPvw or CRSP_SPvwx you will that they are close, but not the same.