zibinomial               package:VGAM               R Documentation

_Z_e_r_o-_I_n_f_l_a_t_e_d _B_i_n_o_m_i_a_l _D_i_s_t_r_i_b_u_t_i_o_n _F_a_m_i_l_y _F_u_n_c_t_i_o_n

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

     Fits a zero-inflated binomial distribution by maximum likelihood
     estimation.

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

     zibinomial(lphi="logit", link.mu="logit",
                ephi=list(), emu=list(),
                iphi=NULL, zero=1, mv=FALSE)

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

    lphi: Link function for the parameter phi. See 'Links' for more
          choices.

 link.mu: Link function for the usual binomial probability mu
          parameter. See 'Links' for more choices.

ephi, emu: List. Extra argument for the respective links. See 'earg' in
          'Links' for general information.

    iphi: Optional initial value for phi, whose value must lie between
          0 and 1.  The default is to compute an initial value
          internally.

    zero: An integer specifying which linear/additive predictor is
          modelled as intercepts only.  If given, the value must be
          either 1 or 2, and the default is the first. Setting
          'zero=NULL' enables both phi and mu to be modelled as a
          function of the explanatory variables.

      mv: Logical. Currently it must be 'FALSE' to mean the function
          does not handle multivariate responses. This is to remain
          compatible with the same argument in 'binomialff'.

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

     This function uses Fisher scoring and is based on

                 P(Y=0) =  phi + (1-phi) * (1-mu)^N,

     for y=0, and 

    P(Y=y) = (1-phi) * choose(N,Ny) * mu^(N*y) * (1-mu)^(N*(1-y)).

     for y=1/N,2/N,...,1. That is, the response is a sample proportion
     out of N trials, and the argument 'size' in 'rzibinom' is N here.
     The parameter phi satisfies 0 < phi < 1.  The mean of Y is E(Y) =
     (1-phi) * mu and these are returned as the fitted values. By
     default, the two linear/additive predictors are (logit(phi),
     logit(mu))^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'.

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

     Numerical problems can occur. Half-stepping is not uncommon. If
     failure to converge occurs, make use of the argument 'iphi'.

_N_o_t_e:

     The response variable must have one of the formats described by
     'binomialff', e.g., a factor or two column matrix or a vector of
     sample proportions with the 'weights' argument  specifying the
     values of N.

     To work well, one needs N>1 and mu>0, i.e., the larger N and mu
     are, the better.

     For intercept-models and constant N over the n observations, the
     'misc' slot has a component called 'p0' which is the estimate of
     P(Y=0).  This family function currently cannot handle a
     multivariate response (only 'mv=FALSE' can be handled).

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

     T. W. Yee

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

     'rzibinom', 'binomialff', 'posbinomial', 'rbinom'.

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

     size = 10  # number of trials; N in the notation above
     n = 200
     phi = logit(0,inv=TRUE)  # 0.50
     mubin = logit(-1,inv=TRUE) # Mean of an ordinary binomial distribution
     sv = rep(size, len=n)
     y = rzibinom(n=n, size=sv, prob=mubin, phi=phi) / sv # A proportion
     table(y)
     fit = vglm(y ~ 1, zibinomial, weight=sv, trace=TRUE)
     coef(fit, matrix=TRUE)
     Coef(fit) # Useful for intercept-only models
     fit@misc$p0  # Estimate of P(Y=0)
     fitted(fit)[1:4,]
     mean(y) # Compare this with fitted(fit)
     summary(fit)

