effects                package:stats                R Documentation

_E_f_f_e_c_t_s _f_r_o_m _F_i_t_t_e_d _M_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     Returns (orthogonal) effects from a fitted model, usually a linear
     model. This is a generic function, but currently only has a
     methods for objects inheriting from classes '"lm"' and '"glm"'.

_U_s_a_g_e:

     effects(object, ...)

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

_A_r_g_u_m_e_n_t_s:

  object: an R object; 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
          arbitrary.

     ...: arguments passed to or from other methods.

_D_e_t_a_i_l_s:

     For a linear model fitted by 'lm' or 'aov', the effects are the
     uncorrelated single-degree-of-freedom values obtained by
     projecting the data onto the successive orthogonal subspaces
     generated by the QR decomposition during the fitting process. The
     first r (the rank of the model) are associated with coefficients
     and the remainder span the space of residuals (but are not
     associated with particular residuals).

     Empty models do not have effects.

_V_a_l_u_e:

     A (named) numeric vector of the same length as 'residuals', or a
     matrix if there were multiple responses in the fitted model, in
     either case of class '"coef"'.

     The first r rows are labelled by the corresponding coefficients,
     and the remaining rows are unlabelled.  Note that in
     rank-deficient models the corresponding coefficients will be in a
     different order if pivoting occurred.

_R_e_f_e_r_e_n_c_e_s:

     Chambers, J. M. and Hastie, T. J. (1992) _Statistical Models in
     S._ Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'coef'

_E_x_a_m_p_l_e_s:

     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

