Closed tudorschlanger closed 5 months ago
resid(mod, na.rm = FALSE)
works as you are hoping
Hi, @kylebutts got you covered. Thanks Kyle.
base = setNames(iris, c("y", "x1", "x2", "x3", "species"))
base$y[1:5] = NA
est = feols(y ~ x1, base)
length(resid(est))
# 145
length(resid(est, na.rm = FALSE))
# 150
I am having issues with the size of the residuals vectors from an estimation. It does not correspond to the data frame size since there are NA values which are ignored.
The issue is better explained here: https://stackoverflow.com/questions/6882709/how-do-i-deal-with-nas-in-residuals-in-a-regression-in-r
The solution in lm package is to have na.action=na.exclude.
Could you also implement this? It would be very useful. Thank you!