Single Degree of Freedom Effects from Fitted Model

DESCRIPTION:
Returns a vector of matrix of uncorrelated effects.

This function is generic (see Methods); method functions can be written to handle specific classes of data. Classes which already have methods for this function include: lm.


USAGE:
effects(object)

REQUIRED ARGUMENTS:
object:
a fitted model, as returned by lm or other fitting functions, or, by default any object with a component named "effects".

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. With the default fitting there will be min(n, p) of them for n observations and p coefficients in the model. Some linear model algorithms (e.g., Choleski), however, produce only p effects. If the rank of the model matrix is r, the first r effects are associated with the estimable coefficients and the rest with residuals. Note that this involves pivoting of values in the case of rank-deficient models. Pivoted or not, the effects associated with the p coefficients are labeled appropriately. The last n-p effects are unlabeled, not being associated with specific degrees of freedom in the model or with specific observations.

In the case of models like glm or gam, the effects are those of the underlying weighted linear model.


SEE ALSO:
coef , qqnorm.aov .

EXAMPLES:
# create a sample object:
fuel.fit <- lm(fuel ~ Weight + Disp., fuel.frame)
effects(fuel.fit)