[R] classification using zero-inflated negative binomial mixture model

Ben Bolker bbolker at gmail.com
Mon Jul 9 18:00:15 CEST 2012


Kai Ying <yingk <at> iastate.edu> writes:

> 
> Hi,
>    I want using zero-inflated negative binomial regression model to
> classify data(a vector of data), that is I want know each observed value is
> more likely belong to the "zero" or "count" distribution(better with
> relative probability). My data is some like:
> 
>    count site samp
> 
>  12909    1    1
> 
>    602     1    2
> 
>     50      1    3
> 
>   1218    1     4
> 
>  91291   1     5
> 
> while "count" is the data with a mixture of "zero" and "non-zero"
> distribution I want know, and "site", "samp" are two prediction valuables
> with additive effect(but I am not interested in it).
> 
>   I have tried the zeroinfl function of pscl package to fit zero-inflated
> negative binomial regression. But it  can not give you the classification
> result of "count".  Can anyone help with some indication of how to do it or
> other tools that can do this job ??

  Not sure, but you may be able to do this by hand.

  For a predicted mean value mu, overdispersion parameter k, and
zero-inflation probability p, the probability p_z of a structural zero
is p, while the probability of a sampling zero p_s is (k/(mu+k))^k ;
therefore the probability that an observed zero is a structural 
zero is p_z/(p_s+p_z) ...



More information about the R-help mailing list