effects {base}R Documentation

Effects from Fitted Model

Description

Returns (orthogonal) effects from a fitted (generalized) regression model. In case of a full rank n * p model.matrix, the first p effects correspond to coefficients and the remaining n - p ones to residuals.

Usage

effects(object, ...)
effects.lm(object, set.sign=FALSE)

Arguments

object list; typically, the result of a model fitting function such as lm.
set.sign logical. If TRUE, the sign of the effects corresponding to coefficients in the model will be set to agree with the signs of the corresponding coefficients, otherwise the sign is essentially arbitrary.

Details

...... FIXME ......

This page is not complete yet!

Value

A (named) numeric vector of the same length as residuals. The first p values are labeled according to the corresponding coefficients, the remaining ones are unlabeled.

The result has class "coef".

See Also

coef, fitted, etc.

Examples

y <- c(1:3,7,5)
x <- c(1:3,6:7)
( ee <- effects(lm(y ~ x)) )
c(round(ee - effects(lm(y+10 ~ I(x-3.8))),3))# just the first is different

[Package Contents]