zapoisson                package:VGAM                R Documentation

_Z_e_r_o-_A_l_t_e_r_e_d _P_o_i_s_s_o_n _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 Poisson distribution based on a conditional
     model involving a binomial distribution and a positive-Poisson
     distribution.

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

     zapoisson(lp0 = "logit", llambda = "loge")

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

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

 llambda: Link function for the usual lambda parameter. See 'Links' for
          more choices.

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

     The response Y is zero with probability p0, or Y has a
     positive-Poisson(lambda) distribution with probability 1-p0.  Thus
     0 < p0 < 1, which is modelled as a function of the covariates. 
     The zero-altered Poisson distribution differs from the
     zero-inflated Poisson distribution in that the former has zeros
     coming from one source, whereas the latter has zeros coming from
     the Poisson distribution too.  Some people call the zero-altered
     Poisson a _hurdle_ model.

     For one response/species, by default, the two linear/additive
     predictors are (logit(p0), log(lambda))^T.

_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) * lambda / [1 - exp(-lambda)].

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

     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:

     There are subtle differences between this family function and
     'yip88' and 'zipoisson'. In particular, 'zipoisson' is a _mixture_
     model whereas 'zapoisson' and 'yip88' are _conditional_ models.

     Note this family function allows p0 to be modelled as functions of
     the covariates. It can be thought of an extension of 'yip88',
     which is also a  conditional model but its phi parameter is a
     scalar only.

     This family function effectively combines 'pospoisson' 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.

     Angers, J-F. and Biswas, A. (2003) A Bayesian analysis of
     zero-inflated generalized Poisson model. _Computational Statistics
     & Data Analysis_, *42*, 37-46.

     Documentation accompanying the 'VGAM' package at <URL:
     http://www.stat.auckland.ac.nz/~yee> contains further information
     and examples.

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

     'zipoisson', 'yip88', 'pospoisson', 'posnegbinomial',
     'binomialff', 'rpospois'.

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

     x = runif(n <- 1000)
     p0 = logit(-1 + 1*x, inverse=TRUE)
     lambda = loge(-0.3 + 2*x, inverse=TRUE)
     y = ifelse(runif(n) < p0, 0, rpospois(n, lambda))
     table(y)
     fit = vglm(y ~ x, zapoisson, trace=TRUE)
     fit = vglm(y ~ x, zapoisson, trace=TRUE, crit="c")
     fitted(fit)[1:5]
     predict(fit)[1:5,]
     predict(fit, untransform=TRUE)[1:5,]
     coef(fit, matrix=TRUE)

     # Another example ------------------------------
     # Data from Angers and Biswas (2003)
     y = 0:7;   w = c(182, 41, 12, 2, 2, 0, 0, 1)
     y = y[w>0]
     w = w[w>0]
     yy = rep(y,w)
     fit3 = vglm(yy ~ 1, zapoisson, trace=TRUE, crit="c")
     coef(fit3, matrix=TRUE)
     Coef(fit3)  # Estimate of lambda (they get 0.6997 with standard error 0.1520)
     fitted(fit3)[1:5]
     mean(yy) # compare this with fitted(fit3)

