Displaying 20 results from an estimated 3000 matches similar to: "Getting predicted values from a zero-inflated negative binomial using zeroinfl()"
2024 Jan 04
1
Obtaining a value of pie in a zero inflated model (fm-zinb2)
Are you referring to the zeroinfl() function in the countreg package? If
so, I think
predict(fm_zinb2, type = "zero", newdata = some.new.data)
will give you pi for each combination of covariate values that you
provide in some.new.data
where pi is the probability to observe a zero from the point mass component.
As to your second question, I'm not sure that's possible, for any
2024 Jan 04
1
Obtaining a value of pie in a zero inflated model (fm-zinb2)
I am running a zero inflated regression using the zeroinfl function similar to the model below:
fm_zinb2 <- zeroinfl(art ~ . | ., data = bioChemists, dist = "poisson")
summary(fm_zinb2)
I have three questions:
1) How can I obtain a value for the parameter pie, which is the fraction of the population that is in the zero inflated model vs the fraction in the count model?
2) For
2012 Apr 26
2
Lambert (1992) simulation
Hi,
I am trying to replicate Lambert (1992)'s simulation with zero-inflated
Poisson models. The citation is here:
@article{lambert1992zero,
Author = {Lambert, D.},
Journal = {Technometrics},
Pages = {1--14},
Publisher = {JSTOR},
Title = {Zero-inflated {P}oisson regression, with an application to defects
in manufacturing},
Year = {1992}}
Specifically I am trying to recreate Table 2. But my
2010 Feb 04
1
Zero inflated negat. binomial model
Dear R crew:
I think I am in the right mailing list. I have a very simple dataset consisting of two variables: cestode intensity and chick size (defined as CAPI). Intensity is clearly overdispersed, with way too many zeroes. I'm interested in looking at the association between these two variables, i.e. how well does chick size predict tape intensity?
I fit a zero inflated negat. binomial
2011 May 23
1
Interpreting the results of the zero inflated negative binomial regression
Hi,
I am new to R and has been depending mostly on the online tutotials to learn
R. I have to deal with zero inflated negative binomial distribution. I am
however unable to understand the following example from this link
http://www.ats.ucla.edu/stat/r/dae/zinbreg.htm
The result gives two blocks.
*library(pscl)
zinb<-zeroinfl(count ~ child + camper | persons, dist = "negbin", EM =
2012 May 16
1
clusters in zero-inflated negative binomial models
Dear all,
I want to build a model in R based on animal collection data, that look like the following
Nr Village District Site Survey Species Count
1 AX A F Dry B 0
2 AY A V Wet A 5
3 BX B F Wet B 1
4 BY B V Dry B 0
Each data point shows one collection unit in a certain Village, District, Site, and Survey for a certain Species. 'Count' is the number of animals collected in that
2024 Jan 06
0
Help request: Parsing docx files for key words and appending to a spreadsheet
Hi Tim
This is brilliant - thank you!!
I've had to tweak the basePath line a bit (I am on a Linux machine), but
having done that, the code works as intended. This is a truly helpful
contribution that gives me ideas about how to work it through for the
missing fields, which is one of the major sticking points I kept bumping
up against.
Thank you so much for this.
All the best
Andy
On
2008 Dec 16
1
Prediction intervals for zero inflated Poisson regression
Dear all,
I'm using zeroinfl() from the pscl-package for zero inflated Poisson
regression. I would like to calculate (aproximate) prediction intervals
for the fitted values. The package itself does not provide them. Can
this be calculated analyticaly? Or do I have to use bootstrap?
What I tried until now is to use bootstrap to estimate these intervals.
Any comments on the code are welcome.
2010 Mar 03
1
Zero inflated negative binomial
Hi all,
I am running the following model:
> glm89.nb <- glm.nb(AvGUD ~ Year*Trt*Micro)
where Year has 3 levels, Trt has 2 levels and Micro has 3 levels.
However when I run it has a zero inflated negative binomial (as I have lots
of zeros) I get the below error message:
> Zinb <- zeroinfl(AvGUD ~ Year*Trt*Micro |1, data = AvGUD89, dist =
"negbin")
Error in optim(fn =
2011 Dec 26
2
Zero-inflated Negative Binomial Error
Hello,
I am having a problem with the zero-inflated negative binomial (package
pscl). I have 6 sites with plant populations, and I am trying to model the
number of seeds produced as a function of their size and their site. There
are a lot of zero's because many of my plants get eaten before flowering,
thereby producing 0 seeds, and that varies by site. Because of that and
because the
2013 Jun 04
1
Zero-Inflated Negative Binomial Regression
Hi!
I'm running a zero-inflated negative binomial regression on a large (n=54822) set of confidential data. I'm using the code:
ZerNegBinRegress<-zeroinfl(Paper~.|., data=OvsP, dist="negbin", EM=TRUE)
And keep getting the error:
Warning message:
glm.fit: fitted probabilities numerically 0 or 1 occurred
I've done enough reading about this error to realize that I have
2010 Feb 11
1
Zero-inflated Negat. Binom. model
Dear R crew:
I am sorry this question has been posted before, but I can't seem to solve
this problem yet.
I have a simple dataset consisting of two variables: cestode intensity and
chick size (defined as CAPI).
Intensity is a count and clearly overdispersed, with way too many zeroes.
I'm interested in looking at the association between these two variables,
i.e. how well does chick
2005 Mar 11
0
Negative binomial regression for count data,
Dear list,
I would like to know:
1. After I have used the R code (http://pscl.stanford.edu/zeroinfl.r) to fit a zero-inflated negative binomial model, what criteria I should follow to compare and select the best model (models with different predictors)?
2. How can I compare the model I get from question 1 (zero-inflated negative binomial) to other models like glm family models or a logistic
2006 Jul 20
0
Convergence warnings from zeroinfl (package pscl)
Dear R-Helpers,
Can anyone please help me to interpret warning messages from zeroinfl
(package pscl) while fitting a zero inflated negative binomial model?
The console reports convergence and the parameters seam reasonable, but
these
<<Warning messages:
1: algorithm did not converge in: glm.fit(X, Y, family = poisson())
2: fitted rates numerically 0 occurred in: glm.fit(X, Y, family =
2008 Sep 14
0
Question on glm.nb vs zeroinfl vs hurdle models
Good afternoon,
I?m in need of an advice regarding a proper use of glm.nb, zeroinfl or hurdle with my dataframe.
I can not provide a self-contained example, since I need an advice on this current dataset and its ?contradictory? results.
So.... i have a dataset which contains 1309 cases and 11 variables, highly right-skewed and heavily zeroinflated (with over 1100 cases that have 0 value
2009 Nov 29
1
Convergence problem with zeroinfl() and hurdle() when interaction term added
Hello,
I have a data frame with 1425 observations, 539 of which are zeros. I
am trying to fit the following ZINB:
f3<-formula(Nbr_Abs~ Zone * Year + Source)
ZINB2<-zeroinfl(f3, dist="negbin", link= "logit", data=TheData,
offset=log(trans.area), trace=TRUE)
Zone is a factor with 4 levels, Year a factor with 27 levels, and
Source a factor with 3 levels. Nbr_Abs is counts
2011 Jun 01
3
Zero-inflated regression models: predicting no 0s
Hi all,
First post for me here, but I have been reading on the forum for almost two
years now. Thanks to everyone who contributed btw!
I have a dataset of 4000 observations of count of a mammal and I am trying
to predict abundance from a inflated-zero model as there is quite a bit of
zeros in the response variable.
I have tried multiple options, but I might do something wrong as every
2011 Nov 17
1
How to Fit Inflated Negative Binomial
Dear All,
I am trying to fit some data both as a negative binomial and a zero
inflated binomial.
For the first case, I have no particular problems, see the small snippet
below
library(MASS) #a basic R library
set.seed(123) #to have reproducible results
x4 <- rnegbin(500, mu = 5, theta = 4)
#Now fit and check that we get the right parameters
fd <- fitdistr(x4, "Negative
2012 Jul 09
1
classification using zero-inflated negative binomial mixture model
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
2010 Apr 12
1
zerinfl() vs. Stata's zinb
Hello,
I am working with zero inflated models for a current project and I am
getting wildly different results from R's zeroinfl(y ~ x, dist="negbin")
command and Stata's zinb command. Does anyone know why this may be? I find
it odd considering that zeroinfl(y ~ x, dist="poisson") gives identical to
output to Stata's zip function.
Thanks,
--david
[[alternative