vcovOPG               package:sandwich               R Documentation

_O_u_t_e_r _P_r_o_d_u_c_t _o_f _G_r_a_d_i_e_n_t_s _C_o_v_a_r_i_a_n_c_e _M_a_t_r_i_x _E_s_t_i_m_a_t_i_o_n

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

     Outer product of gradients estimation for the covariance matrix of
     the coefficient estimates in regression models.

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

     vcovOPG(x, adjust = FALSE, ...)

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

       x: a fitted model object.

  adjust: logical. Should a finite sample adjustment be made? This
          amounts to multiplication with 

                               n/(n-k)

          where 

                                  n

          is the number of observations and 

                                  k

          the number of estimated parameters.

     ...: arguments passed to the 'estfun' function.

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

     In correctly specified models, the "meat" matrix (cross product of
     estimating functions, see 'meat') and the inverse of the "bread"
     matrix (inverse of the derivative of the estimating functions, see
     'bread') are equal and correspond to the Fisher information
     matrix. Typically, an empirical version of the bread is used for
     estimation of the information but alternatively it is also
     possible to use the meat. This method is also known as the outer
     product of gradients (OPG) estimator (Cameron & Trivedi 2005).

     Using the 'sandwich' infrastructure, the OPG estimator could
     easily be computed via 'solve(meat(obj))' (modulo scaling). To
     employ numerically more stable implementation of the inversion,
     this simple convenience function can be used: 'vcovOPG(obj)'.

     Note that this only works if the 'estfun()' method computes the
     maximum likelihood scores (and not a scaled version such as least
     squares scores for '"lm"' objects).

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

     A matrix containing the covariance matrix estimate.

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

     Cameron AC and Trivedi PK (2005), _Microeconometrics: Methods and
     Applications_. Cambridge University Press, Cambridge.

     Zeileis A (2006), Object-oriented Computation of Sandwich
     Estimators. _Journal of Statistical Software_, *16*(9), 1-16. URL
     <URL: http://http://www.jstatsoft.org/v16/i09/>.

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

     'meat', 'bread', 'sandwich'

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

     ## generate poisson regression relationship
     x <- sin(1:100)
     y <- rpois(100, exp(1 + x))
     ## compute usual covariance matrix of coefficient estimates
     fm <- glm(y ~ x, family = poisson)
     vcov(fm)
     vcovOPG(fm)

