yip88                  package:VGAM                  R Documentation

_Z_e_r_o-_I_n_f_l_a_t_e_d _P_o_i_s_s_o_n _D_i_s_t_r_i_b_u_t_i_o_n (_Y_i_p (_1_9_8_8) _a_l_g_o_r_i_t_h_m)

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

     Fits a zero-inflated Poisson distribution based on Yip (1988).

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

     yip88(link.lambda = "loge", n.arg = NULL)

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

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

   n.arg: The total number of observations in the data set. Needed when
          the response variable has all the zeros deleted from it, so
          that the number of zeros can be determined.

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

     The method implemented here, Yip (1988), maximizes a _conditional_
     likelihood. Consequently, the methodology used here deletes the
     zeros from the data set, and is thus related to the positive
     Poisson distribution (where P(Y=0) = 0).

     The probability function of Y is 0 with probability phi, and
     Poisson(lambda) with probability 1-phi.  Thus

                   P(Y=0) = phi + (1-phi) * P(W=0)

     where W is Poisson(lambda). The mean, (1-phi) * lambda, can be
     obtained by the extractor function 'fitted' applied to the object.

     This family function treats phi as a scalar.  If you want to model
     both phi and lambda as a function of covariates, try 'zipoisson'.

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

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

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

     Under- or over-flow may occur if the data is ill-conditioned. Yip
     (1988) only considered phi being a scalar and not modelled as a
     function of covariates.  To get around this limitation, try
     'zipoisson'.

     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:

     The data may be inputted in two ways.  The first is when the
     response is a vector of positive values, with the argument 'n' in
     'yip88' specifying the total number of observations.  The second
     is simply include all the data in the response.  In this case, the
     zeros are trimmed off during the computation, and the 'x' and 'y'
     slots of the object, if assigned, will reflect this.

     The estimate of phi is placed in the 'misc' slot as '@misc$phi'.
     However, this estimate is computed only for intercept models,
     i.e., the formula is of the form 'y ~ 1'.

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

     Thomas W. Yee

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

     Yip, P. (1988) Inference about the mean of a Poisson distribution
     in the presence of a nuisance parameter. _The Australian Journal
     of Statistics_, *30*, 299-306.

     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', 'Zipois', 'zapoisson', 'pospoisson', 'poissonff',
     'dzipois'.

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

     # Generate some artificial data
     n = 1000
     phi = 0.35  
     lambda = 2
     y = rzipois(n, lambda, phi)
     table(y)

     # Two equivalent ways of fitting the same model
     fit1 = vglm(y ~ 1, yip88(n=length(y)), subset=y>0, trace=TRUE, crit="c")
     fit2 = vglm(y ~ 1, yip88, trace=TRUE, crit="c")
     true.mean = (1-phi) * lambda
     true.mean
     mean(y) 
     fitted(fit1)[1:5,]
     fit1@misc$phi      # The estimate of phi

     # Compare the ZIP with the positive Poisson distribution 
     pp = vglm(y ~ 1, pospoisson, subset=y>0, tr=TRUE, crit="c")
     coef(pp)
     Coef(pp)
     (coef(fit1) - coef(pp))   # Same 
     ((fitted(fit1) - fitted(pp))[1:5,])   # Different 

     # Another example ------------------------------
     y = 0:7    # Data from Angers and Biswas (2003)
     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, yip88(n=length(yy)), subset=yy>0, trace=TRUE, crit="c")
     fit3@misc$phi  # Estimate of phi (they get 0.5154 with standard error 0.0707)
     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)

