effects                 package:base                 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 method
     for objects inheriting from class `"lm"'.

_U_s_a_g_e:

     effects(object, ...)
     effects.lm(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.

_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).

_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.

_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

