zanegbinomial              package:VGAM              R Documentation

_Z_e_r_o-_A_l_t_e_r_e_d _N_e_g_a_t_i_v_e _B_i_n_o_m_i_a_l _D_i_s_t_r_i_b_u_t_i_o_n

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

     Fits a zero-altered negative binomial distribution based on a
     conditional model involving a binomial distribution and a
     positive-negative binomial distribution.

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

     zanegbinomial(lp0="logit", lmunb = "loge", lk = "loge",
                   ep0=list(), emunb =list(), ek = list(),
                   ik = 1, zero = -3, cutoff = 0.995, method.init=3)

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

     lp0: Link function for the parameter p0, called 'p0' here. See
          'Links' for more choices.

   lmunb: Link function applied to the 'munb' parameter, which is the
          mean munb of an ordinary negative binomial distribution. See
          'Links' for more choices.

      lk: Parameter link function applied to the reciprocal of the
          dispersion parameter, called 'k'. That is, as 'k' increases,
          the variance of the response decreases. See 'Links' for more
          choices.

ep0, emunb, ek: List. Extra argument for the respective links. See
          'earg' in 'Links' for general information.

      ik: Initial values for 'k'. They must be positive, and one value
          for each response/species.

    zero: Integer valued vector, usually assigned -3 or 3 if used at
          all.  Specifies which of the three linear predictors are
          modelled as an intercept only. By default, the 'k' parameter
          (after 'lk' is applied) for each response is modelled as a
          single unknown number that is estimated.  It can be modelled
          as a function of the explanatory variables by setting
          'zero=NULL'. A negative value means that the value is
          recycled, so setting -3 means all 'k' are intercept only.

  cutoff: A numeric which is close to 1 but never exactly 1.  Used to
          specify how many terms of the infinite series are actually
          used. The sum of the probabilites are added until they reach
          this value or more.  It is like specifying 'p' in an
          imaginary function 'qnegbin(p)'.

method.init: See 'negbinomial'.

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

     The response Y is zero with probability p0, or Y has a
     positive-negative binomial distribution with probability 1-p0. 
     Thus 0 < p0 < 1, which is modelled as a function of the
     covariates.  The zero-altered negative binomial distribution
     differs from the zero-inflated negative binomial distribution in
     that the former has zeros coming from one source, whereas the
     latter has zeros coming from the negative binomial distribution
     too.  The zero-inflated negative binomial distribution is
     currently not implemented in the 'VGAM' package.  Some people call
     the zero-altered negative binomial a _hurdle_ model.

     For one response/species, by default, the three linear/additive
     predictors are (logit(p0), log(munb), log(k))^T.  This vector is
     recycled for multiple species.

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

     An object of class '"vglmff"' (see 'vglmff-class'). The object is
     used by modelling functions such as 'vglm', and 'vgam'.

     The 'fitted.values' slot of the fitted object, which should be
     extracted by the generic function 'fitted', returns the mean mu
     which is given by 

              mu = (1-p0) * munb / [1 - (k/(k+munb))^k].

_W_a_r_n_i_n_g:

     Convergence for this 'VGAM' family function seems to depend quite
     strongly on providing good initial values.

     Inference obtained from 'summary.vglm' and 'summary.vgam' may or
     may not be correct.  In particular, the p-values, standard errors
     and degrees of freedom may need adjustment. Use simulation on
     artificial data to check that these are reasonable.

_N_o_t_e:

     Note this family function allows p0 to be modelled as functions of
     the covariates. It is a conditional model, not a mixture model.

     This family function effectively combines 'posnegbinomial' and
     'binomialff' into one family function.

     This family function can handle a multivariate response, e.g.,
     more than one species.

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

     T. W. Yee

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

     Welsh, A. H., Cunningham, R. B., Donnelly, C. F. and Lindenmayer,
     D. B. (1996) Modelling the abundances of rare species: statistical
     models for counts with extra zeros. _Ecological Modelling_, *88*,
     297-308.

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

     'posnegbinomial', 'binomialff', 'rposnegbin', 'zipoisson'.

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

     ## Not run: 
     x = runif(n <- 2000)
     p0 = logit(-1 + 2*x, inverse=TRUE)
     y1 = rposnegbin(n, munb=exp(0+2*x), k=exp(1))   # With covariates
     y2 = rposnegbin(n, munb=exp(1+2*x), k=exp(1))   # With covariates
     y1 = ifelse(runif(n) < p0, 0, y1)
     y2 = ifelse(runif(n) < p0, 0, y2)
     table(y1)
     table(y2)

     fit = vglm(cbind(y1,y2) ~ x, zanegbinomial, trace=TRUE)
     coef(fit, matrix=TRUE)
     fitted(fit)[1:9,]
     predict(fit)[1:9,]
     ## End(Not run)

