Zero-inflated negative binomial distribution in R
1
0
Entering edit mode
5.4 years ago
ma23 ▴ 40

Hi!

I have a row with data looking like this:

GeneID                    srr1 srr2 srr3   srr4   srr5   srr6   srr7  srr8    srr9  srr10 srr11 srr12 srr13 srr14 srr15 srr16 srr17

ENSG00000223972 0       1       0     1       0       0       0       0       1       0       0       0       1       1       0       0       0

I want to check it for the zero-inflated negative binomial distribution. So I want to use the function zeroinfl from the pscl package. The function requires a formula as its first parametr.

zeroinfl(formula = , data =  my_vector, dist = "negbin", EM = TRUE)

What should I put in the formula ?

r zero-inflated negative binomial • 1.3k views
ADD COMMENT
1
Entering edit mode
5.3 years ago

What your data is and what you're trying to achieve are unclear.
First, note that zeroinfl builds a regression model. This doesn't tell you if the zero-inflated negative binomial is the best distribution to model your data if that's what you want. For this you would need to build models with other distributions and compare them.
Second, you need to clarify what the variables are that you want to use to model the counts.
In the zero-inflated negative binomial model, the occurrence of 0 is assumed caused by two different processes. So the model has to have two parts: one that models the counts and a part that models which of the two processes is associated with the excess 0s. The formula would look like counts ~ variables to model the counts | variables to model the processes.

ADD COMMENT
0
Entering edit mode

Ok, thank you. About my data - it present the gene (ENSG00000223972) expression over a number of people - they are named srr1.... The initial idea was to check whether the expression may be discribed by the negative binomial or Poisson distribution.

ADD REPLY

Login before adding your answer.

Traffic: 1862 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6