Questions tagged [negative-binomial-distribution]

A discrete, univariate distribution modelling the number of ${\rm Bernoulli}(p)$ trial successes until a specified number of failures occur.

Filter by
Sorted by
Tagged with
1 vote
1 answer
33 views

Weird definition of negative binomial distribution

In a paper I am reading, they define the negative binomial as the following: random variable $X$ has a negative binomial distribution with parameters $p \in (0,1),k \in \mathbb{N}$ if $$\mathbb{P}[X=t]...
  • 379
0 votes
0 answers
6 views

Is "dispersion" parament in Design_gsnb same to "dispersion" parament in rnbinom?

I want to generate a group of NB outcomes and find I can use 2 functions, but run into a question, whether "dispersion" parament in Design_gsnb is same to "dispersion" parament in ...
3 votes
1 answer
43 views

Is there an R or python package to calculate wasserstein metric between negative binomial distributions?

As the title says I am looking for an R or python package which can calculate wasserstein distance (aka earthmovers distance between) two lists (vectors) of sampled values from a negative binomial ...
0 votes
0 answers
9 views

Detective work: Why dropping few rows makes R/glm.nb break down

I'm fitting a negative binomial glm to this dataset of 102 records (R code to reproduce below): ...
  • 3,245
1 vote
1 answer
34 views

How to use poisson to predict incidence rates per 100,000?

I am trying to make predictions with a poission model to get the predicted incidence rate per 100,000 of some event. My problem is that when I compare the predicted incidence to the incidence ...
1 vote
0 answers
31 views

How to statistically test correlation and coincidence between two negative binomially distributed sets of counts?

I am working with novel Next Generation Sequencing (NGS) method which reports DNA breaks with perfect single nucleotide-resolution and strand-specificity. The outcome of the technique is that the ...
  • 11
1 vote
1 answer
14 views

Zero inflated negative binomial regression interpretation of categorical variable stata

I am using a zero-inflated negative binomial regression model for my data analysis, where the dependent variable is the number of retweets. I have three categorical variables called ...
0 votes
1 answer
30 views

Negative binomial or Poisson

Using MASS::glm.nb (R) I am having problems of convergence with certain dataset, and it seems theta goes very high, resulting in NaNs "In sqrt(1/i)" during the fit. I am trying to understand ...
  • 5
1 vote
0 answers
34 views

negative binomial regression and a coding scheme for non-linear data

I have a count variable nlongfix of number of long eye fixations on stimulus during a trial, which I'm modeling with a difficulty (of the task) variable ...
0 votes
0 answers
53 views

R | Issues with panel FE model for count data (Poisson vs Negative Binomial)

I am currently writing my master thesis in the field of labour economics. To answer my research question, I am using a panel dataset covering 129 countries from 1994 to 2017 (i.e., over 24 years). The ...
0 votes
1 answer
52 views

Understanding the loss funcion in DeepAR

The loss function looks like below, where N is the number of time series. ignore N for now and say N = 1. T is length of prediction horizon. During training $t_0$ starts from encoder time step 0 all ...
1 vote
0 answers
26 views

How to interpret coefficents when you have an offset?

I'm measuring counts of birds as a function of the time (in months) across three parks (NP), as well as the presence of carcasses and season. I'm trying to find out whether the population is ...
  • 93
0 votes
0 answers
20 views

High frequency zero-inflated negative binomial model with Hauck-Donner effect

I have high-frequency (daily) data with overdispersion and a high amount of zeros. I know that a zero-inflated negative binomial is my best option for a model. I am using the library ...
  • 1
0 votes
0 answers
24 views

Fixed-effects regression with variable number of binary responses but only one success

I believe my problem requires the use of generalized estimating equations but there are a couple of characteristics of the data that make me question the suitability. The following data is ...
1 vote
1 answer
42 views

Interpreting a Negative Binomial Regression

I've produced a negative binomial regression where the dependent variable is the number of AIDS-related laws passed by each of the US's fifty states in 1989, with the independent variable of ...
1 vote
2 answers
45 views

Confidence interval for the difference of two negative binomial rates

I have a model with a negative binomial distribution using the glm.nb function from R: ...
2 votes
1 answer
71 views

understanding coefficients in negative binomial regression (glm.nb)

Hi CrossValidated Community, I have a very simple question about the interpretation of coefficients produced by fitting a negative binomial to some toy data. I generate the toy data by sampling from a ...
0 votes
1 answer
31 views

Learning a stochastic pattern in a count TS using DeepAR [duplicate]

I am trying to the learn the following pattern of count time series of vehicle demand every hour. The count time series is generated from a negative binomial distribution with parameters n = 9 and p =...
0 votes
0 answers
58 views

Interpretation of ZINB when ziformula = ~1 in glmmTMB

I estimated a ZINB model with the probability of producing a structural zero as equal for all observations with ziformula = ~1. For context: I want to know what predicts the number of cigarettes ...
  • 13
1 vote
1 answer
66 views

Negative Binomial - pvalues for log vs pvalues for response scale?

I am performing a negative binomial regression, with post-hoc tests using emmeans. I was wondering if I should perform & report the p-values done using the log ...
1 vote
0 answers
37 views

PCA, stepAIC, and negative binomial regression

I have some output data (around 800 data points) that very nicely fits a negative binomial distribution. I checked using fitdistr() in R and it is a very good fit. Given this, my plan was to use ...
1 vote
2 answers
110 views

Quantile-Quantile Plot for Negative Binomial Distribution

I am performing regression analysis in R on count data which are negative binomial distributed. I would like to use a quantile-quantile plot as a tool to diagnose the fit of my models, but I am ...
  • 11
0 votes
0 answers
65 views

How to specify the formula for a GLM Negative Binomial model in R

I'm looking for some feedback on my approach to predicting a count variable in my dataset. I'm unsure as to whether my approach is sound. My dataset is stored here if anyone is interested. Since my ...
  • 549
0 votes
0 answers
18 views

Back Transformed Truncated Negative Binomial Model Results Less Than One

I'm using a truncated negative binomial model to describe my count data where all values are >=1. I have attempted to back-transform my model results using emmeans. However, all of my back ...
0 votes
1 answer
38 views

Negative binomial not capturing overdispersion in glm model

Following this example, I am fitting a glm model with rstanarm to count data that look like this: The simple specification below runs just fine: ...
  • 11
0 votes
0 answers
53 views

H2O Deviance - Negative Binomial

I'm hoping to get some clarifications on the deviance calculation of negative binomial. From H2O documentation, the deviance formula for negative binomial regression is expressed as: $$D=2\sum_{i=1}^{...
  • 1
1 vote
1 answer
37 views

Correct variable/data use for day of week predictors [duplicate]

Currently trying to model count data using ticket counts for each day of week as the dependent variable (y) and the corresponding day of the week integrated using OHE for 78 days. Assuming Poisson ...
  • 31
1 vote
1 answer
34 views

Steps for improving NegBinom regression model

I am currently working with pandas and scikit-learn for Poisson Regression (now turned negbinom to address Overdispersion) to model count data of y (ticket count) with each day of the week serving as ...
  • 31
2 votes
1 answer
111 views

Dispersion parameter in negative binomial

I simulate data from a Gamma-Poisson model in R as follows. The mean and variance of the negative binomial distributed counts are $a b=10$ and $a b (1+b)=60$. ...
  • 2,245
0 votes
0 answers
14 views

Seasonal variation and long-term trend in Zero-Inflated Poisson / Negative Binomial (ZIP / ZINB)

I am new to time series analysis and I have read a few papers on zero-inflated poisson/negative binomial (ZIP/ZINB) model. I encountered these phrases: "control seasonal variation and long-term ...
  • 11
1 vote
1 answer
100 views

Zero-truncated negative binomial model in glmmTMB predictions

I have a dataset of counts of a vocalisation per hour. I am interested in fitting a model to see if the count of the vocalisations of a given category per hour is effected by noise. My response ...
  • 11
0 votes
0 answers
97 views

choice between zero inflated poisson and zero inflated negative binomial

For count data with excessive number of zeros, there are two choices of models, zero inflated poisson and zero inflated negative binomial. Q1: How does one make appropriate choice between the two from ...
  • 1,179
0 votes
0 answers
26 views

Zero Inflated Negative Binomial: model equation and GLM equation

I've fitted a Zero-inflated negative Binomial (with an offset) to a count variable where there is overdispersion and a large frequency of 0's. I've done this with the ...
  • 3
0 votes
0 answers
18 views

Why does the negative binomial produce multiple threshold parameters in Stata but not in lme4?

Stata produces estimates for the thresholds of a negative binomial regression, as demonstrated here. However, the same does not happen with lme4 in ...
0 votes
1 answer
61 views

Expected value and model expression for Zero Inflated Negative Binomial

I've been working around Zero Inflated models. The data that I have, however, shows overdispersion so I am using a Zero Infalted Negative Binomial to model counts considering exposure. The end goal ...
  • 3
0 votes
0 answers
33 views

Negative binomial fixed-effect

I have a dataset of tweets, and I want to find the relation between the tweet features (like the number of stop-words, numbers of a specific word appearing in a tweet) and the number of likes. To this ...
1 vote
1 answer
27 views

Negative Binomial Coefficient Interpretation?

I've fitted a negative binomial model with language (Tamil and French) as the IV and number of prolongations (count) as DV and number of words in each language as an offset (random effect). The ...
-1 votes
0 answers
178 views

Na/Nan/Inf Error in R While Running a Negative Binomial Model

After running this negative binomial model: ...
0 votes
1 answer
101 views

Negative Binomial Regression Not Running in R [closed]

I’m having some issues with event count analysis in R, and I welcome any help I can get. I’ll walk through my issue as (to me) it seems rather bizarre. It starts off when I try to run a negative ...
0 votes
0 answers
17 views

How to do generalized estimating equations with zero inflated poisson regression in R?

I did not find a package to do zero inflated Poisson/negative binomial regression with generalized estimating equations. Is there such a package available? How to do generalized estimating equations ...
  • 1,179
0 votes
0 answers
32 views

Calculating a non-contractual CLV with dataset aggregated on yearly basis in R

I am looking for a way to predict the individual customer lifetime value (CLV) in a dataset that contains data over three years, aggregated on a yearly basis. I have the number of purchases and the ...
  • 21
0 votes
0 answers
44 views

negative binomial glm: issues with model diagnostics when using offset term

I'm trying to model count data using a negative binomial glm with an offset in R and am having some issues with getting the model to fit properly when I use an offset term. Here is a reproducible ...
  • 1
1 vote
0 answers
116 views

Very different results between R and SAS for negative binomial model

I am getting very different results for a negative binomial model between R and SAS. Can you please suggest as to why is this happening? I am not able to add a csv file used as the data. R script: <...
  • 33
0 votes
0 answers
21 views

Regression with a Count DV and Repeated Measures

I am investigating whether the likelihood of a Twitter account posting spam ("spam") is related to the age group of the user operating the account ("age_group": 1 to 4) and the ...
1 vote
0 answers
14 views

Substraction of predicted values: taking in to account prediction intervals

I'm trying to make a prediction of the number of annual flu hospitalizations. In order to do so I'm trying to subtract the predicted number of hospitalizations when there is no flu from the predicted ...
2 votes
1 answer
77 views

How to derive the determinant of the variance of a negative multinomial distribution?

The probability mass function of the negative multinomial distribution is: \begin{align*} \mathbb{P}(\boldsymbol{\rm{X}}=\boldsymbol{\rm{x}}|\mathbf{p})=\frac{\Gamma\left(x_0+\sum_{i=1}^{m}x_{i}\right)...
  • 31
1 vote
1 answer
116 views

Why marginal effect and average marginal effects are the same for NB regression?

Using the margins() function from the margins R package, I fitted a negative binomial model (...
  • 207
1 vote
0 answers
64 views

Time series analysis with non-stationary count data (Poisson/Negative binomial models)

I am trying to model the relationship between real-world events and specific features present in tweets related to these events. Whereas my dependent variable (events) is a count variable and its time ...
0 votes
0 answers
21 views

Repeatability estimation of negative binomial distribution

I want to find the repeatability of variable "id" with random factor "D". My variable B follows negative binomial distribution. Where repeatability r = among-groups variance ...
0 votes
0 answers
19 views

mean of negative bionomial distribution

Is the mean of a negative binomial distribution for rate can be calculated as the arithmetic mean of the observed rate? I know it is true for count data, but not sure if it is the same for rate (count/...
  • 1

1
2 3 4 5
18