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
1
vote
1 answer

Recreating Electoral Targeting Package

I'm really into politics and elections and I'm just getting into learning R and I would like to recreate the process laid out in this blog with new data from a local county. I've been able to get through most of the process in the blog reliably with…
Matt
  • 11
  • 4
1
vote
1 answer

Mixed effects model with zero inflated data - Error message using zeroinfl() from 'pscl' package

I am having issues with the function zeroinfl() from the 'pscl' package. Here is an overview of my situations: I am trying to find out if the non-native stem density in a plot is influenced by the focal species at that plot. I am using a mixed…
Maria
  • 39
  • 1
  • 10
1
vote
1 answer

ideal() in R package pscl produces error

I would like to use the ideal() function in the pscl package in R. When I run the example provided in the help file, i.e., data(s109) n <- dim(s109$legis.data)[1] x0 <- rep(0,n) x0[s109$legis.data$party=="D"] <- -1 x0[s109$legis.data$party=="R"] <-…
Dan
  • 57
  • 4
0
votes
0 answers

Hurdle model: In sqrt(diag(object$vcov)) : NaNs produced with no data for some levels

Good afternoon, I am trying to run a hurdle model with two dependent variables: probability of disease persistence (0 or 1; the 'hurdle') and disease prevalence rate given there was disease persistence. My response variable is number of infected…
Annette
  • 15
  • 4
0
votes
1 answer

How to handle zero-inflated (semi-)continuous data in R?

I would like to model / fit Value on explanatory variables Type and Material (Value ~ Material + Type). Having a look at the sample test data provided here, one could see that Material X has all zero Values except for one, which makes the…
SteveMcManaman
  • 391
  • 1
  • 17
0
votes
1 answer

Extracting z values from hurdle model output, 'pscl' package in R

I am using the hurdle() function from the pscl package to run negative binomial hurdle models in R. I would like to extract only the list of z values from the model output and assign those values to a vector. But I cannot figure out how to do…
W. Arlidge
  • 11
  • 2
0
votes
0 answers

glmmadmb no longer supported in lsmeans. Alternative packages?

My data is zero inflated so I'm running a zero-inflated model using glmmamdb: Model3z <- glmmadmb(Count3 ~ Light3 + (1|Site3), zeroInflation = T, family= "poisson", data = dframe3) However, when I try and do pairwise comparisons of the different…
Help
  • 101
0
votes
0 answers

How to run zero inflated poisson in R if zeroinfl function cannot be found?

I am using R version 3.6.0 and I am following this guide in order to run a zero-inflated poisson regression on cholera data: https://stats.idre.ucla.edu/r/dae/zip/ I have installed the pscl package as instructed, but when I run my code, an error…
Zookie
  • 1
  • 2
0
votes
1 answer

How to obtain consistently sign direction using rollcall and ideal from pscl package?

I'm using functions ideal and rollcall from pscl package but the same voters receive alternatively negative sign values or positive sign values depending (at list) on the ordering of the dataset. As I'm calculating this for several periods, I need…
panchtox
  • 634
  • 7
  • 16
0
votes
1 answer

pscl::predict.hurdle probabilities do not sum to 1

I'm using the predict.hurdle function from the pscl package to estimate the probabilities of observing 0, 1, 2, ..., N events in a data set. Using the example in ?predict.hurdle: data("bioChemists", package = "pscl") fm_hp1 <- hurdle(art ~ ., data…
Jeff Keller
  • 771
  • 1
  • 7
  • 15
1
2