Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to extract the residuals from the rolling regression? #12

Open
nikosGeography opened this issue Dec 4, 2022 · 0 comments

Comments

@nikosGeography
Copy link

nikosGeography commented Dec 4, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant