Single Degree of Freedom Effects from Fitted Model

DESCRIPTION:

Returns a vector, a bdVector 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 "bdLm".

USAGE:

effects(object) 

REQUIRED ARGUMENTS:

object
a fitted model, as returned by lm, bdLm, or another fitting function. Any object with a component named "effects" can be given as the object argument.

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.

DETAILS:

Suppose there are n observations and p coefficients in the model. With the default QR fitting algorithm, there will be max(n,p) effects, some of which are equal to 0. Some linear model algorithms (e.g., Choleski, SVD) produce only min(n,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. If r < p, some effects may equal 0. The last n-p effects are unlabeled, not being associated with specific degrees of freedom in the model or with specific observations.

If the response in the regression has multiple columns, there is one column of effects for each column of the response, and effects are correlated across columns.

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

SEE ALSO:

, .

EXAMPLES:

# Create a sample fitted object. 
fuel.fit <- lm(Fuel ~ Weight + Disp., data=fuel.frame) 
effects(fuel.fit)