Questions tagged [pscl]

An R package to provide various functions conducting bayesian analysis of item-response theory (IRT) models, roll call analysis, computing highest density regions, maximum likelihood estimation of zero-inflated and hurdle models for count data, goodness-of-fit measures for GLMs, data sets used in writing and teaching at the Political Science Computational Laboratory, and seats-votes curves.

25 questions
7
votes
3 answers

ideal() in R package pscl not producing repeatable results

I'm working with the pscl package in R and trying to get it to produce testable/reproducible results. I've taken a look at the underlying C code and it appears as though GetRNGstate() and PutRNGstate() are being called in the right places but it…
Adam Hyland
  • 878
  • 1
  • 9
  • 21
4
votes
1 answer

Any difference between modelobject$residuals and residuals(modelobject) in R package pscl?

I'm trying to build some models using Zero-Inflated Poisson regression using pscl package and after having manipulated the output object which turns to be zeroinfl, I find that doing residuals(fm_zip) is not equal to fm_zip$residuals. The following…
nhern121
  • 3,831
  • 6
  • 27
  • 40
4
votes
2 answers

pscl package of R

I was running the xyplot of presidential elections in the pscl package and got the error data(presidentialElections) library(lattice) xyplot(demVote ~ year | state, panel=panel.lines, ylab="Democratic Vote for President (percent)", …
Metrics
  • 15,172
  • 7
  • 54
  • 83
3
votes
1 answer

Is there a way to plot hurdle model results pscl package or a way to plot the count - zero truncated negbin part of hurdle model in r?

Is there a way to plot hurdle model results in R? I was able to plot the zero part (binomial with logit link) of the hurdle model (below) but I can't figure out how to plot the count part of the model (truncated negative binomial with log link). I…
FishyFishies
  • 301
  • 3
  • 14
3
votes
1 answer

hurdle model prediction - count vs response

I'm working on a hurdle model and ran into a question I can't quite figure out. It was my understanding that the overall response prediction of the hurdle is the multiplication of the count prediction by the probability prediction. I.e., the overall…
user2602640
  • 640
  • 6
  • 21
3
votes
0 answers

How to use the predict() function in the R package "pscl" with categorical predictor variables

I'm fitting count data (number of fledgling birds produced per territory) using zero-inflated poisson models in R, and while model fitting is working fine, I'm having trouble using the predict function to get estimates for multiple values of one…
2
votes
1 answer

Difference in results between glmmTMB and zeroinf (in pscl)

I applied glmmTMB and zeroinfl in pscl to the same dataset. I obtained the identical coefficients for the conditional part, but the coefficients for the binary part are somewhat different. Any idea on the potential factors that makes the…
KLee
  • 105
  • 1
  • 9
2
votes
0 answers

how to generate confident intervals for predictions of hurdle models

I'm using 'pscl' package to build hurdle models, in order to model the abundance of birds as a function of environmental variables. I am interested in predicting the probability of occurrence and abundance in non-sampled areas, in order to generate…
2
votes
1 answer

Pseudo R² for a Poisson GLM with offset

My question may be of technical nature: I am trying to model disease counts (d) by using population (p) as offset to control for exposure. In R, I found two possible ways to go: m1 -> glm(d ~ 1 + offset(log(n)), family=poisson, data=dat) m2 -> glm(d…
Gion Mors
  • 313
  • 1
  • 3
  • 20
2
votes
0 answers

Simulation and validation with pscl hurdle

I am fitting a hurdle model using pscl's hurdle function. I have not been able to tackle the following issues related to the object returned by hurdle: Is there a straightforward way to simulate using the object produced by hurdle? Is there a…
Iliya Markov
  • 71
  • 1
  • 6
1
vote
1 answer

`zeroinfl` from the `pscl` and `countreg` packages give very different results. Why?

I am experimenting with the mdvis dataset from the COUNT package of R for a teaching purpose. I fitted a zero-inflated negative-binomial model using the zeroinfl function from the pscl and countreg packages. However, the results of zeroinfl from the…
Ayalew A.
  • 113
  • 6
1
vote
0 answers

Back transforming pscl hurdle model output in R

Here's the setup of my hurdle model from the pscl package: m1 <- hurdle(p_eaten ~ state + species + year, data = herb, dist = "negbin", zero.dist = "binomial") Where p_eaten is the amount of a leaf eaten (from 0-100), state is the…
millie0725
  • 359
  • 2
  • 12
1
vote
0 answers

PSCL Returning NAs for zeroinfl negbin model

I am trying to run a Zero-Inflated Negative Binomial Count Model on some data containing the number of campaign visits by a politician by county. (Log Liklihood tests indicate Negative Binomial is correct, Vuong test suggests Zero-Inflated, though…
SPTS
  • 13
  • 2
1
vote
1 answer

bias-corrected percentile bootstrap

I am trying to run a bias-corrected percentile bootstrap for 3 different effect sizes and ran across some code from a predecessor. While this code functions, the run time takes FAR too long. It takes about 3 days to do each of the 3 different effect…
J Bacon
  • 27
  • 6
1
vote
0 answers

Anova table for pscl:zeroinfl

We're trying to model a count variable with excessive zeros using a zero-inflated poisson (as implemented in pscl package). Here is a (simplified) output showing both categorical and continuous explanatory variables: library(pscl) > m1 <- zeroinfl(y…
1
2