Calculator Inputs
Enter known log-likelihood values, or paste outcome and probability lists. When lists are supplied, the page derives both deviances automatically.
Example Data Table
This example reflects a small binary outcome model. You can load it directly into the calculator.
| Observation | Observed Outcome | Predicted Probability |
|---|---|---|
| 1 | 1 | 0.82 |
| 2 | 0 | 0.28 |
| 3 | 1 | 0.74 |
| 4 | 1 | 0.63 |
| 5 | 0 | 0.35 |
| 6 | 0 | 0.18 |
| 7 | 1 | 0.79 |
| 8 | 0 | 0.41 |
| 9 | 1 | 0.67 |
| 10 | 0 | 0.22 |
Formula Used
Null deviance measures fit for the intercept-only model.
D₀ = -2 × log(L₀)
Residual deviance measures fit for the fitted model.
D₁ = -2 × log(L₁)
Improvement shows how much deviance the fitted model removes.
ΔD = D₀ - D₁
This ratio summarizes relative fit improvement.
R² = 1 - (D₁ / D₀)
These criteria balance model fit and complexity.
AIC = 2k - 2log(L₁)BIC = ln(n)k - 2log(L₁)
For binary outcomes, each observation gets a signed contribution.
rᵢ = sign(yᵢ - pᵢ) × √[2 × {yᵢ ln(yᵢ/pᵢ) + (1-yᵢ) ln((1-yᵢ)/(1-pᵢ))}]
How to Use This Calculator
- Enter total model parameters, including the intercept term.
- Use sample size and both log-likelihood values when software already reports them.
- Alternatively, paste binary outcomes and fitted probabilities to derive deviances automatically.
- Press Calculate Deviance to place results above this form.
- Review null deviance, residual deviance, improvement, pseudo R², AIC, and BIC.
- Inspect the Plotly graph to compare deviance magnitudes quickly.
- When lists are used, study deviance residuals for unusually poor observations.
- Download a CSV or PDF report for documentation and sharing.
Frequently Asked Questions
1) What does null deviance represent?
Null deviance measures how well an intercept-only model fits the observed outcomes. It acts as the baseline fit. Lower values mean better fit, although it ignores all predictor effects.
2) What does residual deviance represent?
Residual deviance measures fit after predictors are added. It uses the fitted model likelihood. A much smaller residual deviance usually suggests the model explains meaningful structure in the data.
3) Why is a lower deviance better?
Deviance is based on negative two times the log-likelihood. Better fitting models have larger likelihoods. That makes their deviance smaller, which signals reduced unexplained variation.
4) What does the improvement value mean?
Improvement equals null deviance minus residual deviance. It shows how much deviance the fitted model removes. Larger positive values usually indicate stronger explanatory contribution from the predictors.
5) How is the p-value used here?
The calculator uses a chi-square style likelihood ratio test. Degrees of freedom equal added parameters beyond the intercept. A small p-value suggests the fitted model improves baseline fit meaningfully.
6) When should I paste observed outcomes and probabilities?
Paste lists when you want the page to derive log-likelihoods, deviances, and deviance residuals directly. This is useful when software does not already show null and fitted likelihood values.
7) What does a large deviance residual indicate?
A large absolute deviance residual means one observation is poorly explained by the fitted probability. It may reflect an outlier, a missing predictor, or a model form issue.
8) Can I compare different models with this page?
Yes, but compare models fit on the same dataset and response coding. Lower residual deviance, AIC, or BIC can support selection. The likelihood ratio improvement is helpful for nested model comparisons.