Rev 68948 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/stats/man/effects.Rd% Part of the R package, https://www.R-project.org% Copyright 1995-2007 R Core Team% Distributed under GPL 2 or later\name{effects}\title{Effects from Fitted Model}\usage{effects(object, \dots)\method{effects}{lm}(object, set.sign = FALSE, \dots)}\alias{effects}\alias{effects.lm}\alias{effects.glm}\arguments{\item{object}{an \R object; typically, the result of a model fitting functionsuch as \code{\link{lm}}.}\item{set.sign}{logical. If \code{TRUE}, the sign of the effectscorresponding to coefficients in the model will be set to agree with thesigns of the corresponding coefficients, otherwise the sign isarbitrary.}\item{\dots}{arguments passed to or from other methods.}}\description{Returns (orthogonal) effects from a fitted model, usually a linearmodel. This is a generic function, but currently only has a methods forobjects inheriting from classes \code{"lm"} and \code{"glm"}.}\details{For a linear model fitted by \code{\link{lm}} or \code{\link{aov}},the effects are the uncorrelated single-degree-of-freedom valuesobtained by projecting the data onto the successive orthogonalsubspaces generated by the QR decomposition during the fittingprocess. The first \eqn{r} (the rank of the model) are associated withcoefficients and the remainder span the space of residuals (but arenot associated with particular residuals).Empty models do not have effects.}\value{A (named) numeric vector of the same length as\code{\link{residuals}}, or a matrix if there were multiple responsesin the fitted model, in either case of class \code{"coef"}.The first \eqn{r} rows are labelled by the corresponding coefficients,and the remaining rows are unlabelled. Note that in rank-deficientmodels the corresponding coefficients will be in a differentorder if pivoting occurred.}\references{Chambers, J. M. and Hastie, T. J. (1992)\emph{Statistical Models in S.}Wadsworth & Brooks/Cole.}\seealso{\code{\link{coef}}}\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}\keyword{models}\keyword{regression}