residuals-methods            package:aod            R Documentation

_R_e_s_i_d_u_a_l_s _f_o_r _M_a_x_i_m_u_m-_L_i_k_e_l_i_h_o_o_d _a_n_d _Q_u_a_s_i-_L_i_k_e_l_i_h_o_o_d _M_o_d_e_l_s

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

     Residuals of models fitted with functions 'betabin' and 'negbin'
     (formal class "glimML"), or  'quasibin' and 'quasipois' (formal
     class "glimQL").

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

       ## S4 method for signature 'glimML':
       residuals(object, type = c("pearson", "response", "link"), ...)
       ## S4 method for signature 'glimQL':
       residuals(object, type = c("pearson", "response", "link"), ...)
       

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

  object: Fitted model of formal class "glimML" or "glimQL".

    type: Character string for the type of residual: "pearson"
          (default) or "response".

     ...: Further arguments to be passed to the function, such as
          'na.action'.

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

     For models fitted with 'betabin' or 'quasibin', Pearson's
     residuals are computed as:

 (y - n * p.fit) / (n * p.fit * (1 - p.fit) * (1 + (n - 1) * phi))^{0.5}

     where y and n are respectively the numerator and the denominator
     of the response, p.fit  is the fitted probability and phi is the
     fitted overdispersion parameter. When n = 0, the  residual is set
     to 0. Response residuals are computed as y/n - p.fit.
      For models fitted with 'negbin' or 'quasipois', Pearson's
     residuals are computed as:

             (y - y.fit) / (y.fit + phi * y.fit^2)^{0.5}

     where y and y.fit are the observed and fitted counts,
     respectively. Response residuals are  computed as y - y.fit.

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

     A numeric vector of residuals.

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

     Matthieu Lesnoff matthieu.lesnoff@cirad.fr, Renaud Lancelot
     renaud.lancelot@cirad.fr

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

     'residuals.glm'

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

       data(orob2)
       fm <- betabin(cbind(y, n - y) ~ seed, ~ 1,
                      link = "logit", data = orob2)
       #Pearson's chi-squared goodness-of-fit statistic
       sum(residuals(fm, type = "pearson")^2)
       

