varmlm: Residual variance of a model

Description Usage Arguments Details Value Author(s) See Also Examples

Description

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

Usage

1
2
3
4
5
## 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

vcov

Examples

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


Search within the compositions package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.