Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6374407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:29:03+00:00 2026-05-25T01:29:03+00:00

I have a vector of count data that is strongly over dispersed and zero

  • 0

I have a vector of count data that is strongly over dispersed and zero inflated.

The vector looks like this:

i.vec=c(0,63,1,4,1,44,2,2,1,0,1,0,0,0,0,1,0,0,3,0,0,2,0,0,0,0,0,2,0,0,0,0,
0,0,0,0,0,0,0,0,6,1,11,1,1,0,0,0,2)
m=mean(i.vec)
# 3.040816
sig=sd(i.vec)
# 10.86078

I would like to fit a distribution to this, which I strongly suspect will be a zero inflated poisson (ZIP). But I need to perform a significance test to demonstrate that a ZIP distribution fits the data.

If I had a normal distribution, I could do a chi square goodness of fit test using the function goodfit() in the package vcd, but I don’t know of any tests that I can perform for zero inflated data.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:29:04+00:00Added an answer on May 25, 2026 at 1:29 am

    Here is one approach

    # LOAD LIBRARIES
    library(fitdistrplus)    # fits distributions using maximum likelihood
    library(gamlss)          # defines pdf, cdf of ZIP
    
    
    # FIT DISTRIBUTION (mu = mean of poisson, sigma = P(X = 0)
    fit_zip = fitdist(i.vec, 'ZIP', start = list(mu = 2, sigma = 0.5))
    
    # VISUALIZE TEST AND COMPUTE GOODNESS OF FIT    
    plot(fit_zip)
    gofstat(fit_zip, print.test = T)
    

    Based on this, it does not look like ZIP is a good fit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data set that looks like this: 000 100 200 300 010
I have the following data that looks like this for example: 34 foo 34
I have a class, with a function which returns a count, like this: class
I have a vector of beans that holds information I want to display in
I have a vector of pointers to objects. I'd like to remove objects from
I have a vector of pointers. I would like to call a function for
I have a Vector that holds a number of objects. My code uses a
I have a vector<set<char> > data structure (transactions database) and I want to know
I fit a count model to a vector of actual data and would now
Suppose I have the following two data structures: std::vector<int> all_items; std::set<int> bad_items; The all_items

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.