hccm                   package:car                   R Documentation

_H_e_t_e_r_o_s_c_e_d_a_s_t_i_c_i_t_y-_C_o_r_r_e_c_t_e_d _C_o_v_a_r_i_a_n_c_e _M_a_t_r_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Calculates heteroscedasticity-corrected covariance matrices for
     unweighted linear models. These are also called
     ``White-corrected''
 covariance matrices.

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


     hccm(model, ...)

     hccm.lm(model, type=c("hc3", "hc0", "hc1", "hc2"))

     hccm.default(model, ...)

_A_r_g_u_m_e_n_t_s:

   model: an unweighted linear model, produced by `lm'.

    type: one of `"hc0"', `"hc1"', `"hc2"', or `"hc3"'; the
 first of
          these gives the classic White correction. The others are
          described in
 Long and Ervin (2000).

     ...: arguments to pass to `hccm.lm'.

_D_e_t_a_i_l_s:

     The classical White-corrected coefficient covariance matrix
     (`"hc0"') is

               V(b) = inv(X'X) X' diag(e^2) X inv(X'X)

     where e^2 are the squared residuals, and X is the model
 matrix.
     The other methods represent adjustments to this formula.

     The function `hccm.default' simply catches non-`lm' objects.

_V_a_l_u_e:

     The heteroscedasticity-corrected covariance matrix for the model.

_A_u_t_h_o_r(_s):

     John Fox jfox@mcmaster.ca

_R_e_f_e_r_e_n_c_e_s:

     Long, J. S. and Ervin, L. H. (2000) 
 Using heteroscedasity
     consistent standard errors in the linear regression model. 
 The
     American Statistician 54, 217-224.

     White, H. (1980)
 A heterskedastic consistent covariance matrix
     estimator and a direct test of heteroskedasticity.
 Econometrica
     48, 817-838.

_S_e_e _A_l_s_o:

     `ncv.test', `spread.level.plot'

_E_x_a_m_p_l_e_s:


     options(digits=4)
     data(Ornstein)
     mod<-lm(interlocks~assets+nation, data=Ornstein)
     Var(mod)
     ##             (Intercept)     assets  nationOTH   nationUK   nationUS
     ## (Intercept)   1.079e+00 -1.588e-05 -1.037e+00 -1.057e+00 -1.032e+00
     ## assets       -1.588e-05  1.642e-09  1.155e-05  1.362e-05  1.109e-05
     ## nationOTH    -1.037e+00  1.155e-05  7.019e+00  1.021e+00  1.003e+00
     ## nationUK     -1.057e+00  1.362e-05  1.021e+00  7.405e+00  1.017e+00
     ## nationUS     -1.032e+00  1.109e-05  1.003e+00  1.017e+00  2.128e+00
     hccm(mod)             
     ##             (Intercept)     assets  nationOTH   nationUK   nationUS
     ## (Intercept)   1.4808521 -1.640e-05 -1.445e+00 -1.460e+00 -1.455e+00
     ## assets       -0.0000164  2.425e-09  1.079e-05  1.324e-05  1.161e-05
     ## nationOTH    -1.4451983  1.079e-05  6.743e+00  1.432e+00  1.430e+00
     ## nationUK     -1.4600207  1.324e-05  1.432e+00  3.722e+00  1.440e+00
     ## nationUS     -1.4550976  1.161e-05  1.430e+00  1.440e+00  1.840e+00

