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, ...)

     ## S3 method for class 'lm':
     hccm(model, type=c("hc3", "hc0", "hc1", "hc2", "hc4"), ...)

     ## Default S3 method:
     hccm(model, ...)

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

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

    type: one of '"hc0"', '"hc1"', '"hc2"', '"hc3"', or '"hc4"'; the
          first of these gives the classic White correction. The
          '"hc1"', '"hc2"', and '"hc3"' corrections are described in
          Long and Ervin (2000); '"hc4"' is described in Cribari-Neto
          (in press).

     ...: 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:

     Cribari-Neto, F. (in press) Asymptotic inference under
     heteroskedasticity of unknown form. _Computational Statistics and
     Data Analysis_.

     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.664e+00 -3.957e-05 -1.569e+00 -1.611e+00 -1.572e+00
     ## assets       -3.957e-05  6.752e-09  2.275e-05  3.051e-05  2.231e-05
     ## nationOTH    -1.569e+00  2.275e-05  8.209e+00  1.539e+00  1.520e+00
     ## nationUK     -1.611e+00  3.051e-05  1.539e+00  4.476e+00  1.543e+00
     ## nationUS     -1.572e+00  2.231e-05  1.520e+00  1.543e+00  1.946e+00

