Skip to content

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

@nikosGeography

Description

@nikosGeography

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions