I need to extract residuals from a model in R where I have used
lm_robust(XS1 ~ rmrf + smb + hml + umd, data=df)
Does anybody know how to do it, please?
The use of residuals()
, resid()
, rstandard()
don't work with this function.
I need to extract residuals from a model in R where I have used
lm_robust(XS1 ~ rmrf + smb + hml + umd, data=df)
Does anybody know how to do it, please?
The use of residuals()
, resid()
, rstandard()
don't work with this function.
library(estimatr)
model <- lm_robust(XS1 ~ rmrf + smb + hml + umd, data = df)
df$residuals <- (model$fitted.values - df$XS1)
Can you calculate the residuals like this?