Displaying 20 results from an estimated 400 matches similar to: "Zero inflated negative binomial"
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
2007 Jul 26
1
zeroinfl() or zicounts() error
I'm trying to fit a zero-inflated poisson model using zeroinfl() from the
pscl library. It works fine for most models I try, but when I include either
of 2 covariates, I get an error.
When I include "PopulationDensity", I get this error: Error in solve.default
(as.matrix(fit$hessian)) : system is computationally singular:
reciprocal condition number = 1.91306e-34
When I
2004 May 21
1
Bug in update()? (PR#6902)
Dear all,
I noticed the following while playing around with fitting log-linear
models to contingency tables using R 1.8.1, but the problem also
exists under R 1.9.0.
A reproducible example uses the following contingency table:
> library(MASS)
> data(quine)
> tmp <- with(quine, expand.grid(Eth=levels(Eth), Sex=levels(Sex),
+ Lrn=levels(Lrn), Age=levels(Age)))
2010 Mar 03
1
Correct nested design for GLM
Hi,
I am currently running the following negative binomial GLM:
glm89.nb <- glm.nb(AvGUD ~ Year*Trt*Micro + (0 + Micro/Trt/Year))
where Year has 3 levels, Trt has 2 levels, and Micro has 3 levels.
>From what I have read the above model has a 3 way interaction
(Year*Trt*Micro), and Micro is nest within Trt and Trt is nested with Year
(0 + Micro/Trt/Year).
I was hoping someone could
2006 Sep 26
2
treatment effect at specific time point within mixed effects model
All,
The code below is for a pseudo dataset of repeated measures on patients
where there is also a treatment factor called "drug". Time is treated
as categorical.
What code is necessary to test for a treatment effect at a single time
point,
e.g., time = 3? Does the answer matter if the design is a crossover
design,
i.e, each patient received drug and placebo?
Finally, what would
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
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
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.
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
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 =
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
2010 Dec 06
1
waldtest and nested models - poolability (parameter stability)
Dear All,
I'm trying to use waldtest to test poolability (parameter stability) between
two logistic regressions. Because I need to use robust standard errors
(using sandwich), I cannot use anova. anova has no problems running the
test, but waldtest does, indipendently of specifying vcov or not. waldtest
does not appear to see that my models are nested. H0 in my case is the the
vector of
2011 Mar 12
3
betareg help
Dear R users,
I'm trying to do betareg on my dataset.
Dependent variable is not normally distributed and is proportion (of condom
use (0,1)).
But I'm having problems:
gyl<-betareg(cond ~ alcoh + drug, data=results)
Error in optim(par = start, fn = loglikfun, gr = gradfun, method = method, :
initial value in 'vmmin' is not finite
Why is R returning me error in optim()?
What
2006 Oct 05
2
treatment effect at specific time point within mixedeffects model
Hi David:
In looking at your original post it is a bit difficult to ascertain
exactly what your null hypothesis was. That is, you want to assess
whether there is a treatment effect at time 3, but compared to what. I
think your second post clears this up. You should refer to pages 224-
225 of Pinhiero and Bates for your answer. This shows how to specify
contrasts.
> -----Original Message-----
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
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
2009 Oct 23
3
opposite estimates from zeroinfl() and hurdle()
Dear all,
A question related to the following has been asked on R-help before, but
I could not find any answer to it. Input will be much appreciated.
I got an unexpected sign of the "slope" parameter associated with a
covariate (diam) using zeroinfl(). It led me to compare the estimates
given by zeroinfl() and hurdle():
The (significant) negative estimate here is surprising, given
2012 Mar 04
2
Can't find all levels of categorical predictors in output of zeroinfl()
Hello,
I?m using zero-inflated Poisson regression via the zeroinfl() function to
analyze data on seed-set of plants, but for some reason, I don?t seem to be
getting the output for all three levels of my two categorical predictors.
More about my data and model:
My response variable is the number of viable seeds (AVInt), and my two
categorical predictors are elevation (Elev) and Treatment
2006 Jan 24
1
non-finite finite-difference value[]
Dear R-helpers,
running a zeroinflated model of the following type:
zinb = zeroinfl(count=response ~., x = ~ . - response, z = ~. - response,
dist = "negbin", data = t.data, trace = TRUE)
generates the following message:
Zero-Inflated Count Model
Using logit to model zero vs non-zero
Using Negative Binomial for counts
dependent variable y:
Y
0 1 2 3
359 52 7 3
generating
2008 Feb 18
1
fitted.values from zeroinfl (pscl package)
Hello all:
I have a question regarding the fitted.values returned from the
zeroinfl() function. The values seem to be nearly identical to those
fitted.values returned by the ordinary glm(). Why is this, shouldn't
they be more "zero-inflated"?
I construct a zero-inflated series of counts, called Y, like so:
b= as.vector(c(1.5, -2))
g= as.vector(c(-3, 1))
x <- runif(100) # x