Skip to content
GLM Playground home

Assignment 2 · Question 3 · Log-linear models

Race and the death penalty: a three-way table

Radelet's 1981 study classified 326 defendants in Florida homicide cases by their race, the victim's race, and whether they were sentenced to death. The assignment tested four independence hypotheses with Poisson log-linear models, then re-tested those it could with logistic regression.

Log-linear models

Each cell count is Poisson with a log-mean built from main effects and the associations allowed by the hypothesis. For example, conditional independence of D and P given V, written [VD][VP], is

log⁡μdvp=λ+λdD+λvV+λpP+λdvDV+λvpVP,ydvp∼Poisson⁡(μdvp)\begin{aligned} \log \mu_{dvp} &= \lambda + \lambda^{D}_{d} + \lambda^{V}_{v} + \lambda^{P}_{p} \\ &\quad + \lambda^{DV}_{dv} + \lambda^{VP}_{vp}, \\ y_{dvp} &\sim \operatorname{Poisson}(\mu_{dvp}) \end{aligned}

Test the hypotheses

Hypothesis (log-linear model)

H₀: Given the victim's race, the sentence is independent of the defendant's race. Not rejected — the model fits.

Observed counts and fitted values

Large number: observed. Small: fitted under [VD][VP]. Shading: Pearson residual (teal = more than expected, terracotta = fewer).

White victim
DefendantDeath penaltyNo death penalty
White19fit 21.2132fit 129.8
Black11fit 8.852fit 54.2
Black victim
DefendantDeath penaltyNo death penalty
White0fit 0.59fit 8.5
Black6fit 5.597fit 97.5

Equivalent logistic regression (Q3b)

Treating the death penalty as the response for each defendant × victim group:

Proportion ~ Victim_Race

Log-linear G²
1.8819
Logistic deviance
1.8819

Same deviance and degrees of freedom (2): the logistic model is the log-linear model conditioned on the [DV] margin.

Analysis of deviance for [VD][VP]

Terms added sequentially, as in anova(model.11, test = "Chi").

Term addedDfDevianceResid. DfResid. DevPr(>Chi)
NULL7395.915
Victim_Race132.4566363.4591.2 × 10⁻⁸ ***
Defendant_Race10.1105363.3490.7396
Penalty1225.4194137.9295.9 × 10⁻⁵¹ ***
Victim_Race:Defendant_Race1129.79838.1324.5 × 10⁻³⁰ ***
Victim_Race:Penalty16.25021.8820.0124 *

What the 2023 analysis found

Comparing each model's residual deviance with a χ² distribution on its residual degrees of freedom:

  • [D][V][P]All three factors are mutually independent. G² = 137.93 on 4 df, p = 7.8 × 10⁻²⁹ — rejected.
  • [DV][P]The sentence is independent of both the defendant's and the victim's race. G² = 8.13 on 3 df, p = 0.0434 — rejected.
  • [DV][DP]Given the defendant's race, the sentence is independent of the victim's race. G² = 7.91 on 2 df, p = 0.0192 — rejected.
  • [VD][VP]Given the victim's race, the sentence is independent of the defendant's race. G² = 1.88 on 2 df, p = 0.3903 — not rejected.
Death-sentence rate by defendant's race
0%10%20%30%All victimsWhite defendants, all victims: 19 of 160 sentenced to death, 11.9% (95% CI 7.7% to 17.8%, Wilson)11.9% · 19/160Black defendants, all victims: 17 of 166 sentenced to death, 10.2% (95% CI 6.5% to 15.8%, Wilson)10.2% · 17/166White victimWhite defendants, white victim: 19 of 151 sentenced to death, 12.6% (95% CI 8.2% to 18.8%, Wilson)12.6% · 19/151Black defendants, white victim: 11 of 63 sentenced to death, 17.5% (95% CI 10.0% to 28.6%, Wilson)17.5% · 11/63Black victimWhite defendants, black victim: 0 of 9 sentenced to death, 0.0% (95% CI 0.0% to 29.9%, Wilson)0.0% · 0/9Black defendants, black victim: 6 of 103 sentenced to death, 5.8% (95% CI 2.7% to 12.1%, Wilson)5.8% · 6/103Share of defendants sentenced to death
  • White defendants
  • Black defendants

Labels: rate · sentenced/defendants. Whiskers: 95% Wilson intervals; the widest is for the nine white defendants with black victims, none of whom was sentenced to death.

Data: Radelet (1981), American Sociological Review 46, 918-927.

Added in 2026

An optional AI explanation

Explain this output with AI

Optional · your own key

Sends 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

What would be sent (4 numbers, no data rows)
Model [D][V][P] (All three factors are mutually independent.): residual deviance (G2)
137.9 · on 4 df, goodness-of-fit p = 7.83e-29
Model [DV][P] (The sentence is independent of both the defendant's and the victim's race.): residual deviance (G2)
8.132 · on 3 df, goodness-of-fit p = 0.0434
Model [DV][DP] (Given the defendant's race, the sentence is independent of the victim's race.): residual deviance (G2)
7.91 · on 2 df, goodness-of-fit p = 0.0192
Model [VD][VP] (Given the victim's race, the sentence is independent of the defendant's race.): residual deviance (G2)
1.882 · on 2 df, goodness-of-fit p = 0.39

Plus the model description, data source and: Goodness-of-fit p-values test each model against the saturated model; a small p-value means the model does not fit. Observational data: associations, not causal effects. 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": "Defendant's race, victim's race and the death penalty (2 x 2 x 2 table)",
  "model": "Poisson log-linear models for the cell counts; D = defendant's race, V = victim's race, P = death penalty",
  "data": "Radelet (1981): homicide cases in 20 Florida counties, 1976-77",
  "sample_size": "326 defendants",
  "quantities": [
    {
      "label": "Model [D][V][P] (All three factors are mutually independent.): residual deviance (G2)",
      "value": 137.9,
      "note": "on 4 df, goodness-of-fit p = 7.83e-29"
    },
    {
      "label": "Model [DV][P] (The sentence is independent of both the defendant's and the victim's race.): residual deviance (G2)",
      "value": 8.132,
      "note": "on 3 df, goodness-of-fit p = 0.0434"
    },
    {
      "label": "Model [DV][DP] (Given the defendant's race, the sentence is independent of the victim's race.): residual deviance (G2)",
      "value": 7.91,
      "note": "on 2 df, goodness-of-fit p = 0.0192"
    },
    {
      "label": "Model [VD][VP] (Given the victim's race, the sentence is independent of the defendant's race.): residual deviance (G2)",
      "value": 1.882,
      "note": "on 2 df, goodness-of-fit p = 0.39"
    }
  ],
  "context": [
    "Goodness-of-fit p-values test each model against the saturated model; a small p-value means the model does not fit.",
    "Observational data: associations, not causal effects.",
    "Original analysis: 2023 coursework, refitted in 2026."
  ]
}