Assignment 2 · Question 1 · Binomial GLM
Beetle mortality and insecticide dose
Eight batches of about sixty beetles were exposed to different concentrations of an insecticide and the deaths counted. The assignment asked for a logistic dose–response model: estimates, intervals, the dose that kills half the beetles, goodness-of-fit checks and whether a curved model does better.
The model
With beetles killed out of at log-dosage , the straight-line model (model.0) and its quadratic extension (model.1) are
Response
Straight line · model.0
Quadratic · model.1
Explore the fit
Everything below is refitted in your browser by iteratively reweighted least squares, the same algorithm R's glm() uses.
Linear predictor
- Observed proportion killed (95% Wilson CI)
- Fitted probability
- 95% pointwise interval
- LD50 with delta-method 95% CI
P(killed) at dosage 1.800
72.7%
95% CI 66.7% to 77.9% · η = 0.978
LD50 — dose that kills half
1.7712
95% CI (1.7636, 1.7788) (delta method)
Odds multiplier for +0.1 dose
× 29.77
95% CI (16.85, 52.58)
Residual deviance
13.633
on 6 df · AIC 43.83 · 4 IRLS iterations
Dots: empirical logits with the ½ correction. Line: fitted linear predictor η with its 95% band.
Straight line: residuals swing negative in the middle doses and positive at the ends — systematic curvature.
Coefficients (model.0)
| Term | Estimate | Std. error | z | p-value |
|---|---|---|---|---|
| (Intercept) | −60.1033 | 5.1642 | −11.64 | 2.6 × 10⁻³¹ *** |
| Dosage | 33.9342 | 2.9029 | 11.69 | 1.4 × 10⁻³¹ *** |
Goodness of fit (Q1g) and the quadratic test (Q1i)
| Model | Deviance | p | Pearson X² | p |
|---|---|---|---|---|
| Straight line (6 df) | 13.633 | 0.0340 | 12.113 | 0.0595 |
| Quadratic (5 df) | 5.107 | 0.4030 | 4.986 | 0.4176 |
| Term added | Df | Deviance | Resid. Df | Resid. Dev | Pr(>Chi) |
|---|---|---|---|---|---|
| NULL | 7 | 284.202 | |||
| Dosage | 1 | 270.569 | 6 | 13.633 | 8.5 × 10⁻⁶¹ *** |
| I(Dosage^2) | 1 | 8.526 | 5 | 5.107 | 0.0035 ** |
Adding Dosage² lowers the deviance by 8.526 on 1 df (p = 0.0035), so the quadratic logistic model fits significantly better than the straight line.
Edit the data and refit
Change any count and press Refit; the interactive panels above are refitted by IRLS in your browser. The 2023 findings further down this page always describe the original data.
What the 2023 analysis found
- (a) Linearity. Empirical logits rise almost linearly with dose, so a logistic model is a reasonable start.
- (b–c) Estimates. , (SE 2.903); 95% Wald interval for the slope (28.245, 39.624).
- (d) LD50. Solving gives a lethal dose of 1.7712. The delta-method interval (1.7636, 1.7788) is an addition for this site.
- (e) Odds ratio. Each +0.1 in dosage multiplies the odds of death by 29.77, 95% CI (16.85, 52.58).
- (f) Dosage 1.8. , so ; transforming the interval for η gives (0.6671, 0.7793).
- (g) Fit. Residual deviance 13.633 on 6 df (p = 0.0340) rejects adequacy at 5%, while Pearson's X² = 12.113 (p = 0.0595) does not — a borderline fit.
- (h–i) Curvature. Deviance residuals show a systematic pattern; adding a quadratic term reduces the deviance by 8.526 on 1 df (p = 0.0035), a significant improvement.
Added in 2026
Model checks and an optional AI explanation
Explain this output with AI
Optional · your own keySends only the numeric summary below to the AI provider you choose, from your browser. The figures on this page are the reference; the AI only paraphrases them and can be wrong. How AI is used
The summary describes the original 2023 counts. If you edit the counts in the lab above, the explanation still describes the original data, not your edited fit.
What would be sent (12 numbers, no data rows)
- Intercept b0
- -60.1 · SE 5.164
- Slope b1 (per unit log-dosage)
- 33.93 · SE 2.903
- Slope 95% Wald CI
- (28.24, 39.62)
- Slope 95% profile-likelihood CI
- (28.54, 39.96)
- LD50 (dosage killing half)
- 1.7712 · delta-method 95% CI (1.7636, 1.7788)
- LD50 95% profile-likelihood CI
- (1.7634, 1.7787)
- Odds ratio for +0.1 dosage
- 29.77 · 95% CI (16.85, 52.58)
- Residual deviance
- 13.63 · on 6 df, p = 0.034
- Pearson X2
- 12.11 · on 6 df, p = 0.0595
- Pearson dispersion estimate (X2/df)
- 2.02
- Quadratic term: deviance drop
- 8.526 · on 1 df, LR test p = 0.0035
- Quadratic term: quasi-binomial F test p-value
- 0.0329
Plus the model description, data source and: Dose was set by the experimenter (a designed experiment). Batches are treated as independent binomial samples. Original analysis: 2023 coursework, refitted in 2026.
Exact request text (system prompt and message)
Sent verbatim with the model id, a response schema and your key (in a request header, never in the text).
System prompt
You explain the output of a statistical model to a reader who knows basic statistics. The output comes from a student's 2023 coursework, refitted for a portfolio site. Rules: - Use only the numbers and facts in the JSON summary you are given. Do not invent numbers, studies, data or context. - Quote numbers exactly as they appear in the summary (you may round them, but never compute new quantities). - Report uncertainty where the summary gives it (confidence intervals, standard errors, p-values) and do not treat p > 0.05 as proof of no effect. - Do not make causal claims unless the summary's context says the design supports them. - If something a reader would want is not in the summary, say so in "caveats" instead of guessing. - Plain English, Australian spelling, no marketing tone. Keep it short: a summary of two or three sentences and two to five points. - List every number you quote in "numbers_used", written exactly as in your text. Return only the JSON object described by the schema.
Message
Explain this model output.
Summary (JSON):
{
"title": "Beetle mortality and insecticide dose",
"model": "Binomial GLM with logit link: logit(P(killed)) = b0 + b1 * dosage (straight line)",
"data": "Bliss (1935): 8 batches of beetles exposed to carbon disulphide at log-dosages 1.69 to 1.88",
"sample_size": "481 beetles in 8 dose groups",
"quantities": [
{
"label": "Intercept b0",
"value": -60.1,
"note": "SE 5.164"
},
{
"label": "Slope b1 (per unit log-dosage)",
"value": 33.93,
"note": "SE 2.903"
},
{
"label": "Slope 95% Wald CI",
"value": "(28.24, 39.62)"
},
{
"label": "Slope 95% profile-likelihood CI",
"value": "(28.54, 39.96)"
},
{
"label": "LD50 (dosage killing half)",
"value": 1.7712,
"note": "delta-method 95% CI (1.7636, 1.7788)"
},
{
"label": "LD50 95% profile-likelihood CI",
"value": "(1.7634, 1.7787)"
},
{
"label": "Odds ratio for +0.1 dosage",
"value": 29.77,
"note": "95% CI (16.85, 52.58)"
},
{
"label": "Residual deviance",
"value": 13.63,
"note": "on 6 df, p = 0.034"
},
{
"label": "Pearson X2",
"value": 12.11,
"note": "on 6 df, p = 0.0595"
},
{
"label": "Pearson dispersion estimate (X2/df)",
"value": 2.02
},
{
"label": "Quadratic term: deviance drop",
"value": 8.526,
"note": "on 1 df, LR test p = 0.0035"
},
{
"label": "Quadratic term: quasi-binomial F test p-value",
"value": 0.0329
}
],
"context": [
"Dose was set by the experimenter (a designed experiment).",
"Batches are treated as independent binomial samples.",
"Original analysis: 2023 coursework, refitted in 2026."
]
}