EconStatsCraft rigorous, plain-spoken econometrics
Econometrics that explains itself.
Regression, panel data, time series and the whole battery of tests. Every result is followed by a verdict you can defend.
Load a dataset to see it here.
EconStatsCraft › Poisson / Negative binomial
For outcomes that are counts (0, 1, 2, …). Fits Poisson and negative binomial side by side and tests for over-dispersion, which decides which one you should report.
A count cannot be negative and is often mostly small numbers with a long right tail. Modelling log E[y|x] rather than E[y|x] guarantees positive predictions and makes coefficients multiplicative - which is usually the natural economic statement anyway ("15% more visits", not "0.4 more visits").
The dependent variable is a count. Using OLS on counts gives negative predictions and wrong standard errors.
Poisson assumes P(y=k\mid x)=e^{-\lambda}\lambda^k/k! with \lambda=\exp(x'\beta), so the log-likelihood is \sum_i\left[y_i x_i'\beta-\exp(x_i'\beta)-\log y_i!\right], globally concave. The negative binomial adds a gamma-distributed multiplicative error to \lambda, producing \operatorname{Var}(y\mid x)=\lambda+\alpha\lambda^2 - a variance that grows faster than the mean, which is what real count data almost always show.
E[y\mid \mathbf{x}]=\exp(\mathbf{x}^{\prime}\boldsymbol{\beta}),\qquad P(y=k)=\frac{e^{-\lambda}\lambda^{k}}{k!}
Doctor visits for 2,000 people: mean 1.9410, variance 8.2805, so variance/mean = 4.2661 and a third of the sample reports no visits at all. Poisson puts β̂ on a chronic condition at 1.1275, an incidence rate ratio of 3.0880 - roughly three times as many visits, holding age and insurance fixed. The over-dispersion shows up exactly where theory says it will: classical standard errors are between 1.6 and 1.8 times too small across the four coefficients, so the robust column is not optional here. The formal test rejects equidispersion at 9.96 with p < 0.0001, and the negative binomial estimates a dispersion parameter of 0.4638 that is 12.7 standard errors from zero, beating Poisson on a likelihood-ratio test of 571.42. The coefficients themselves barely move - 1.1275 to 1.1398 on chronic - which is the usual pattern and the reason this matters: over-dispersion is a problem for the standard errors, not for the point estimates, so a Poisson fit with robust errors and a negative binomial will agree about the effect and disagree about how sure you should be.
| If you see this | It means | Do this |
|---|---|---|
| Variance/mean much above 1 | Over-dispersion | Negative binomial, or Poisson with robust standard errors |
| Far more zeros than predicted | Two processes: whether any event occurs, then how many | Zero-inflated or hurdle model |
| Exposure varies across units | Counts are not comparable | Add log(exposure) as an offset with coefficient fixed at 1 |
| α significant in the negative binomial | Poisson was inadequate | Report the negative binomial |
| Predictions far above observed maxima | A regressor with an extreme value in exp() | Check for outliers; exp() amplifies them brutally |
If the outcome is a proportion rather than a count, use a fractional response model; if it is a duration, use survival analysis.
Multiple regression (OLS) · Logit / Probit · Tobit (censored) · Truncated regression · Multinomial logit · Ordered logit / probit · Quantile regression
Line chart · Area chart · Bar chart · Stacked bar · Scatter plot · Bubble chart · Histogram · Box plot · Pie chart · Heat map · Rebased to 100 · Lorenz curve and Gini
World map · Bivariate map · Flow map · India - state map · India - district map
Descriptive statistics · Summary by group · Two-way table · Classical statistical tests
Multiple regression (OLS) · Logit / Probit · Tobit (censored) · Truncated regression · Multinomial logit · Ordered logit / probit · Quantile regression · Poisson / Negative binomial
Time-varying coefficients (Kalman) · Unit root tests · Correlogram (ACF / PACF) · ARIMA / SARIMA · Rolling-origin cross-validation · Theta method · Unobserved components · STL forecasting · Forecast combination · Markov regime switching · Change frequency (resample) · ARCH / GARCH volatility · Decompose & filter · Spectral analysis · Exponential smoothing · Forecast accuracy
Yield curve (Nelson–Siegel / Svensson) · Dynamic factor model · Dynamic regression (ARIMAX) · Structural VAR · VAR · Granger causality · Cointegration · VECM · ARDL & bounds test
Panel regression · Panel cointegration tests · Heterogeneous panel: Mean Group & PMG · Gravity model of trade · Dynamic panel GMM · Panel diagnostics · Panel unit-root tests
Principal components (PCA) · Factor analysis · Cluster analysis
Conjoint analysis · MaxDiff (best–worst scaling) · TURF - reach of a product line · Price sensitivity (Van Westendorp) · Market basket analysis · Perceptual map · Scale reliability (Cronbach’s alpha) · Key driver analysis
Spatial autocorrelation · Spatial regression · Heckman selection · Instrumental variables (2SLS) · Difference-in-differences · Staggered difference-in-differences · Regression discontinuity · Matching & weighting · Oaxaca–Blinder decomposition
Black–Scholes option pricing · Bond price, duration & convexity · Merton distance to default · EMI / home loan planner · CAPM / beta estimation · Multi-factor model · Portfolio optimization · Value at Risk & Expected Shortfall · Performance & drawdown · Time value of money & NPV/IRR · Equity valuation (DDM, FCF, residual income) · Cost of capital (WACC) · Binomial option pricing · Option strategies (payoff & profit) · Forwards, futures & swaps · Credit risk & Basel capital · Extreme value theory (tail risk)
Life table · Life annuity · Life insurance pricing · Chain ladder reserving · Buhlmann credibility · Survival analysis · Mortality graduation · Aggregate loss model · Ruin probability · Multi-state Markov model · Loss severity fitting
Monte Carlo experiment · F-test, Wald & Chow · Structural breaks & stability
Regression vs machine learning · Ridge / Lasso / Elastic Net · Random forest · Gradient boosting
EconStatsCraft rigorous, plain-spoken econometrics
Regression, panel data, time series and the whole battery of tests. Every result is followed by a verdict you can defend.
Load a dataset to see it here.
Pick the example closest to your question. You get a spreadsheet with the right columns and a few rows showing the expected format - replace the numbers with your own, then paste or upload it back.
Copy the header row from the table above (or from the downloaded template), put your own rows underneath, and paste the whole thing here. It is checked against the layout before anything is imported.
Or click a row in the preview below.
For a units or notes row.
Search every source at once. World Bank indicators need countries and years; everything else loads in one click.
Loading the catalogue…
The engine stays loaded, so this is quick - and it leaves your open tab and panel layout alone.
⌘/Ctrl+Enter runs the current analysis. ⌘/Ctrl+P exports the session as a PDF. Esc closes this.
In the Notebook: Enter starts a new block and
Shift+Enter a new line inside one; Backspace at the start
joins back into the paragraph above; / on an empty line inserts anything.
⌘/Ctrl+B, I, E, H and
M apply bold, italic, code, highlight and maths.
#, ##, -, 1., > and
``` at the start of a line convert it.
Sign in to run unlimited analyses.
Scroll to pan · Esc to close