lm.influence              package:stats              R Documentation

_R_e_g_r_e_s_s_i_o_n _D_i_a_g_n_o_s_t_i_c_s

_D_e_s_c_r_i_p_t_i_o_n:

     This function provides the basic quantities which are used in
     forming a wide variety of diagnostics for checking the quality of
     regression fits.

_U_s_a_g_e:

     influence(model, ...)
     ## S3 method for class 'lm':
     influence(model, do.coef = TRUE, ...)
     ## S3 method for class 'glm':
     influence(model, do.coef = TRUE, ...)

     lm.influence(model, do.coef = TRUE)

_A_r_g_u_m_e_n_t_s:

   model: an object as returned by 'lm' or 'glm'.

 do.coef: logical indicating if the changed 'coefficients' (see below)
          are desired.  These need O(n^2 p) computing time.

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

_D_e_t_a_i_l_s:

     The 'influence.measures()' and other functions listed in *See
     Also* provide a more user oriented way of computing a variety of
     regression diagnostics.  These all build on 'lm.influence'.  Note
     that for GLMs (other than the Gaussian family with identity link)
     these are based on one-step approximations which may be inadequate
     if a case has high influence.

     An attempt is made to ensure that computed hat values that are
     probably one are treated as one, and the corresponding rows in
     'sigma' and 'coefficients' are 'NaN'.  (Dropping such a case would
     normally result in a variable being dropped, so it is not possible
     to give simple drop-one diagnostics.)

     'naresid' is applied to the results and so will fill in with 'NA's
     it the fit had 'na.action = na.exclude'.

_V_a_l_u_e:

     A list containing the following components of the same length or
     number of rows n, which is the number of non-zero weights. Cases
     omitted in the fit are omitted unless a 'na.action' method was
     used (such as 'na.exclude') which restores them.

     hat: a vector containing the diagonal of the 'hat' matrix.

coefficients: (unless 'do.coef' is false) a matrix whose i-th row
          contains the change in the estimated coefficients which
          results when the i-th case is dropped from the regression. 
          Note that aliased coefficients are not included in the
          matrix.

   sigma: a vector whose i-th element contains the estimate of the
          residual standard deviation obtained when the i-th case is
          dropped from the regression.  (The approximations needed for
          GLMs can result in this being 'NaN'.)

  wt.res: a vector of _weighted_ (or for class 'glm' rather _deviance_)
          residuals.

_N_o_t_e:

     The 'coefficients' returned by the R version of 'lm.influence'
     differ from those computed by S. Rather than returning the
     coefficients which result from dropping each case, we return the
     changes in the coefficients. This is more directly useful in many
     diagnostic measures.
      Since these need O(n^2 p) computing time, they can be omitted by
     'do.coef = FALSE'.

     Note that cases with 'weights == 0' are _dropped_ (contrary to the
     situation in S).

     If a model has been fitted with 'na.action=na.exclude' (see
     'na.exclude'), cases excluded in the fit _are_ considered here.

_R_e_f_e_r_e_n_c_e_s:

     See the list in the documentation for 'influence.measures'.

     Chambers, J. M. (1992) _Linear models._ Chapter 4 of _Statistical
     Models in S_ eds J. M. Chambers and T. J. Hastie, Wadsworth &
     Brooks/Cole.

_S_e_e _A_l_s_o:

     'summary.lm' for 'summary' and related methods;
      'influence.measures',
      'hat' for the hat matrix diagonals,
      'dfbetas', 'dffits', 'covratio', 'cooks.distance', 'lm'.

_E_x_a_m_p_l_e_s:

     ## Analysis of the life-cycle savings data
     ## given in Belsley, Kuh and Welsch.
     summary(lm.SR <- lm(sr ~ pop15 + pop75 + dpi + ddpi,
                         data = LifeCycleSavings),
             corr = TRUE)
     utils::str(lmI <- lm.influence(lm.SR))

     ## For more "user level" examples, use example(influence.measures)

