powered by
Computes the unbiased estimate for the variance of the residuals of a model.
# S3 method for mlm var(x,...) # S3 method for lm var(x,...)
a linear model object
Unused, for generic purposes only.
returns a scalar giving the estimated variance of the residuals
returns a the estimated variance covariance matrix of the residuals
The difference of this command to var(resid(X)) is that this command correctly adjusts for the degrees of freedom of the model.
var(resid(X))
vcov
# NOT RUN { data(Orange) var(lm(circumference~age,data=Orange)) var(lm(cbind(circumference,age)~age,data=Orange)) # }
Run the code above in your browser using DataLab