This function provides the basic quantities which are used in forming a wide variety of diagnostics for checking the quality of regression fits.
1 2 3 4 5 6 7
an object as returned by
logical indicating if the changed
further arguments passed to or from other methods.
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
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
NAs it the fit had
na.action = na.exclude.
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
method was used (such as
na.exclude) which restores them.
a vector containing the diagonal of the ‘hat’ matrix.
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
a vector of weighted (or for class
coefficients returned by the R version
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 p^2) computing time, they can be omitted by
do.coef = FALSE. (Prior to R 4.0.0, this was much worse, using
an O(n^2 p) algorithm.)
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
See the list in the documentation for
Chambers, J. M. (1992) Linear models. Chapter 4 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole.
summary and related methods;
hat for the hat matrix diagonals,
1 2 3 4 5 6 7 8
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.