theta.md                package:MASS                R Documentation

_E_s_t_i_m_a_t_e _t_h_e_t_a _o_f _t_h_e _N_e_g_a_t_i_v_e _B_i_n_o_m_i_a_l

_D_e_s_c_r_i_p_t_i_o_n:

     Given the estimated mean vector, estimate 'theta' of the Negative
     Binomial Distribution.

_U_s_a_g_e:

     theta.md(y, mu, dfr, limit = 20, eps = .Machine$double.eps^0.25)

     theta.ml(y, mu, n, limit = 10, eps = .Machine$double.eps^0.25,
              trace = FALSE)

     theta.mm(y, mu, dfr, limit = 10, eps = .Machine$double.eps^0.25)

_A_r_g_u_m_e_n_t_s:

       y: Vector of observed values from the Negative Binomial. 

      mu: Estimated mean vector. 

       n: Number of data points (defaults to length of 'y') 

     dfr: Residual degrees of freedom (assuming 'theta' known). 

   limit: Limit on the number of iterations. 

     eps: Tolerance to determine convergence. 

   trace: logical: should iteration progress be printed? 

_D_e_t_a_i_l_s:

     'theta.md' estimates by equating the deviance to the residual
     degrees of freedom, an analogue of a moment estimator.

     'theta.ml' uses maximum likelihood.

     'theta.mm' calculates the moment estimator of 'theta' by equating
     the Pearson chi-square sum((y-mu)^2/(mu+mu^2/theta)) to the
     residual degrees of freedom.

_V_a_l_u_e:

     The required estimate of 'theta', as a scalar. For 'theta.ml', the
     standard error is given as attribute '"SE"'.

_S_e_e _A_l_s_o:

     'glm.nb'

_E_x_a_m_p_l_e_s:

     quine.nb <- glm.nb(Days ~ .^2, data = quine)
     theta.md(quine$Days, fitted(quine.nb), dfr = df.residual(quine.nb))
     theta.ml(quine$Days, fitted(quine.nb))
     theta.mm(quine$Days, fitted(quine.nb), dfr = df.residual(quine.nb))

