ls.diag                 package:base                 R Documentation

_C_o_m_p_u_t_e _D_i_a_g_n_o_s_t_i_c_s _f_o_r `_l_s_f_i_t' _R_e_g_r_e_s_s_i_o_n _R_e_s_u_l_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Computes basic statistics, including standard errors, t- and
     p-values for the regression coefficients.

_U_s_a_g_e:

     ls.diag(ls.out)

_A_r_g_u_m_e_n_t_s:

  ls.out: Typically the result of `lsfit()'

_V_a_l_u_e:

     A `list' with the following numeric components. 

 std.dev: The standard deviation of the errors, an estimate of sigma.

     hat: diagonal entries h_{ii} of the hat matrix H

 std.res: standardized residuals

stud.res: studentized residuals

   cooks: Cook's distances

   dfits: DFITS statistics

correlation: correlation matrix

 std.err: standard errors of the regression coefficients

cov.scaled: Scaled covariance matrix of the coefficients

cov.unscaled: Unscaled covariance matrix of the coefficients

_R_e_f_e_r_e_n_c_e_s:

     Belsley, D. A., Kuh, E. and Welsch, R. E. (1980) Regression
     Diagnostics. New York: Wiley.

_S_e_e _A_l_s_o:

     `hat' for the hat matrix diagonals, `ls.print', `lm.influence',
     `summary.lm', `anova'.

_E_x_a_m_p_l_e_s:

     ##-- Using the same data as the lm(.) example:
     lsD9 <- lsfit(x = as.numeric(gl(2, 10, 20)), y = weight)
     dlsD9 <- ls.diag(lsD9)
     str(dlsD9, give.attr=FALSE)
     abs(1 - sum(dlsD9$hat) / 2) < 10*.Machine$double.eps # sum(h.ii) = p
     plot(dlsD9$hat, dlsD9$stud.res, xlim=c(0,0.11))
     abline(h = 0, lty = 2, col = "lightgray")

