Calculator Form
Example Data Table
| Label | Outcome | Predicted Probability | Weight | Weighted Deviance | Deviance Residual |
|---|---|---|---|---|---|
| A | 1 | 0.82 | 1 | 0.396902 | 0.630001 |
| B | 0 | 0.31 | 1.2 | 0.890553 | -0.943691 |
| C | 1 | 0.57 | 1 | 1.124238 | 1.060301 |
| D | 0 | 0.11 | 0.8 | 0.186454 | -0.431803 |
| E | 1 | 0.93 | 1.1 | 0.159656 | 0.399569 |
Formula Used
This calculator uses the binomial deviance residual for each observation in a binary response model.
For binary outcomes, the expression simplifies because y is either 0 or 1.
Large absolute residuals suggest observations that the model fits poorly.
How to Use This Calculator
- Choose single mode for one observation or batch mode for many rows.
- Enter the observed binary outcome as 0 or 1.
- Provide the fitted probability from your logistic or binomial model.
- Set the observation weight. Use 1 when no weighting applies.
- For single mode, define the probability range used for the Plotly graph.
- For batch mode, paste CSV rows using label, outcome, probability, and weight.
- Submit the form to display summary metrics above the calculator.
- Download CSV or PDF output for reporting or review.
Frequently Asked Questions
1. What is a deviance residual?
A deviance residual measures how much one observation contributes to model deviance. Its sign shows direction, and its magnitude shows how poorly the fitted probability matches the observed binary outcome.
2. When is a deviance residual considered large?
Analysts often review absolute residuals above 2, and investigate more strongly above 3. These are screening rules, not strict laws, because context and model structure also matter.
3. Why must the predicted probability stay between 0 and 1?
The formula uses logarithms of probability terms. If probability equals 0 or 1 exactly, those logarithms can become undefined or infinite for some outcomes, which breaks stable calculation.
4. What does the sign of the residual mean?
A positive sign means the observed outcome is above the fitted mean. A negative sign means the observed outcome is below the fitted mean for that binary observation.
5. Do weights change the result?
Yes. Larger weights increase the weighted deviance contribution and usually increase the residual magnitude. This matters when grouped data or weighted observations are part of the fitted model.
6. Can I use batch mode to review a whole model quickly?
Yes. Batch mode is useful for scanning many observations, summarizing overall residual behavior, and flagging rows whose absolute residuals exceed your selected review threshold.
7. How is this different from a Pearson residual?
Pearson residuals standardize the raw error using model variance. Deviance residuals instead connect directly to deviance, which often makes them more informative for generalized linear model diagnostics.
8. What should I do after finding a large residual?
Check data entry, confirm coding of the outcome, inspect influential observations, review missing predictors, and consider whether the model form is too simple. A large residual is a signal to investigate, not immediate proof of error.