Due to the size of my dataset I'm bound to use Speedlm
, fastLm
or biglm
.
Unfortunately I'm stuck to using speedlm
as fastlm
doesn't have an update
function, and biglm
only supports single core.
Using speedlm I want to show all residuals. I know that for lm
or fastlm
I can simply use the residuals()
function. However it turns out speedlm
doesn't support this.
lmfit <- speedglm(formula , res)
print(names(lmfit))
[1] "coefficients" "coef" "df.residual" "XTX" "Xy" "nobs" "nvar" "ok" "A" "RSS" "rank" "pivot" "sparse" "yy" "X1X" "intercept" "method" "terms" "call"
lmfit <- fastLm(formula, res)
print(names(lmfit))
[1] "coefficients" "stderr" "df.residual" "fitted.values" "residuals" "call" "intercept" "formula"
Is there a way to show all residuals using speedlm
?
When attempting to print(residuals(lmfit))
it just prints a NULL
Edit:
When using the method mentioned by @Roland, it returns purely NA
's
lmfit <- speedlm(formula , res, fitted=TRUE)
resids <- res$Daily_gain - predict(lmfit, newdata=res)
print(summary(resids))
# Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
# NA NA NA NaN NA NA 829780