Hi, I am performing a rolling regression (i.e., I am using a moving window). I have two variables, the y (called ntl) and x (called tirs20). Here is the code:
block.data = read.csv ("path/block.data.psf.csv")
eq = ntl ~ tirs20
model = roll_regress(eq, block.data, width = 5, do_downdates = TRUE, do_compute = "r.squareds")
coeff = as.data.frame(model$coefs)
The function's output is the model's coefficients (intercept and slope). I was wondering if there is a way to add the residuals of the regression as a new column to the coeff data frame.
If necessary, I can share my csv.