effects
Single Degree-of-freedom Effects from a Fitted Model

Description

Returns a vector or matrix of uncorrelated effects.
This function is generic; see the help file for Methods for more information. Method functions can be written to handle specific classes of data. Classes that already have methods for this function include "lm" and "glm".

Usage

effects(object, ...)
## S3 method for class 'lm':
effects(object, set.sign = FALSE, ...)
## S3 method for class 'glm':
effects(object, ...)

Arguments

object a fitted model, as returned by lm or a related model fitting function.
set.sign a logical value; 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 signs are determined by the algorithm for the orthogonal decomposition to promote numerical stability.
Value
a vector or, if the response was a matrix, a matrix of effects. These are single-degree-of-freedom values, orthogonal and hence uncorrelated under standard linear model assumptions.
The first length(coef(object)) entries in the output will be labelled with the coefficient names. For a least-squares problem their squares are the sum of squares associated with that coefficient. The remaining entries will not be labelled and sum of their squares is the residual sum of squares.
If object inherits from the class lm, but not also glm, the return value will also be given the the class coef and the attribute assign, copied from object.
Differences between Spotfire Enterprise Runtime for R and Open-source R
In open-source R, when effects component of object is NULL, effects is stopped with an error. In Spotfire Enterprise Runtime for R, it returns NULL.
See Also
anova, coef.
Examples
fit <- lm(data=ToothGrowth, len ~ supp + dose)
effects(fit)[1:3]^2
# compare to "Sum Sq" column in anova table
anova(fit)
Package stats version 6.1.4-13
Package Index