Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

varmlm

Residual variance of a model


Description

Computes the unbiased estimate for the variance of the residuals of a model.

Usage

## S3 method for class 'mlm'
var(x,...) 
## S3 method for class 'lm'
var(x,...)

Arguments

x

a linear model object

...

Unused, for generic purposes only.

Details

The difference of this command to var(resid(X)) is that this command correctly adjusts for the degrees of freedom of the model.

Value

var.lm

returns a scalar giving the estimated variance of the residuals

var.mlm

returns a the estimated variance covariance matrix of the residuals

Author(s)

K.Gerald v.d. Boogaart http://www.stat.boogaart.de, Raimon Tolosana-Delgado

See Also

Examples

data(Orange)
var(lm(circumference~age,data=Orange))
var(lm(cbind(circumference,age)~age,data=Orange))

compositions

Compositional Data Analysis

v2.0-1
GPL (>= 2)
Authors
K. Gerald van den Boogaart <boogaart@hzdr.de>, Raimon Tolosana-Delgado, Matevz Bren
Initial release
2021-01-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.