Skip to content
GLM Playground home

Assignment 3 · Question 3 · Generalised estimating equations

Children's wheeze, age and maternal smoking

537 children in Steubenville, Ohio were checked for wheeze every year from age 7 to 10 as part of an air-pollution study. Repeated answers from the same child are correlated, so the assignment interpreted a logistic GEE fit with an exchangeable working correlation.

The marginal model

For child ii at age code tt (age − 9), with πit=P(yit=1)\pi_{it} = P(y_{it} = 1):

logit⁡πit=−1.880−0.113 aget+0.265 smokei\begin{aligned}\operatorname{logit}\pi_{it} &= -1.880 - 0.113\,\text{age}_{t} \\ &\quad + 0.265\,\text{smoke}_i\end{aligned}
Var⁡(yit)=ϕ πit(1−πit),  ϕ^=0.9985\operatorname{Var}(y_{it}) = \phi\,\pi_{it}(1-\pi_{it}),\ \ \hat\phi = 0.9985
corr⁡(yit,yis)=α (t≠s),  α^=0.3543\operatorname{corr}(y_{it}, y_{is}) = \alpha \ (t \ne s),\ \ \hat\alpha = 0.3543
Z536=[1−211−11101111]Z_{536} = \begin{bmatrix} 1 & -2 & 1 \\ 1 & -1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 1 \end{bmatrix}

Design matrix for child 536, whose mother smoked (Q3b): intercept, age code, smoke.

Explore the fit

Wheeze rate by age
0%5%10%15%20%25%30%78910Age (years)Non-smoking mother, age 7: 56 of 350 children wheezed, 16.0% (95% CI 12.5% to 20.2%, Wilson)Non-smoking mother, age 8: 52 of 350 children wheezed, 14.9% (95% CI 11.5% to 19.0%, Wilson)Non-smoking mother, age 9: 50 of 350 children wheezed, 14.3% (95% CI 11.0% to 18.3%, Wilson)Non-smoking mother, age 10: 37 of 350 children wheezed, 10.6% (95% CI 7.8% to 14.2%, Wilson)Smoking mother, age 7: 31 of 187 children wheezed, 16.6% (95% CI 11.9% to 22.6%, Wilson)Smoking mother, age 8: 39 of 187 children wheezed, 20.9% (95% CI 15.6% to 27.2%, Wilson)Smoking mother, age 9: 35 of 187 children wheezed, 18.7% (95% CI 13.8% to 24.9%, Wilson)Smoking mother, age 10: 26 of 187 children wheezed, 13.9% (95% CI 9.7% to 19.6%, Wilson)
  • Mother non-smoker
  • Mother smoker

Hollow dots: observed rates with 95% Wilson intervals (350 children of non-smoking and 187 of smoking mothers, every child seen at each age). Lines and bands: GEE (exchangeable) fitted probabilities with pointwise 95% intervals from the robust covariance.

Why GEE: repeated measures are correlated

Each child is measured four times. The exchangeable working correlation assumes one common correlation α between any two visits; GEE estimates it as 0.3543 (scale φ = 0.9985).

Observed correlation

78910
71.000.350.310.33
80.351.000.440.33
90.310.441.000.38
100.330.330.381.00

Exchangeable working R(α)

78910
71.000.350.350.35
80.351.000.350.35
90.350.351.000.35
100.350.350.351.00

Same estimates, different uncertainty

(Intercept)

Naive GLM
−1.8837SE 0.0838 · p < 0.0001
GEE, independence (robust)
−1.8837SE 0.1142 · p < 0.0001
GEE, exchangeable (robust)
−1.8804SE 0.1139 · p < 0.0001

age

Naive GLM
−0.1134SE 0.0541 · p 0.0360
GEE, independence (robust)
−0.1134SE 0.0439 · p 0.0097
GEE, exchangeable (robust)
−0.1134SE 0.0439 · p 0.0097

smoke

Naive GLM
0.2721SE 0.1235 · p 0.0275
GEE, independence (robust)
0.2721SE 0.1780 · p 0.1263
GEE, exchangeable (robust)
0.2651SE 0.1777 · p 0.1359
0.60.811.52Odds ratio (log scale) with 95% CIAge (+1 year)Naive GLM: OR 0.893 (0.803, 0.993)GEE, independence (robust): OR 0.893 (0.819, 0.973)GEE, exchangeable (robust): OR 0.893 (0.819, 0.973)Mother smokesNaive GLM: OR 1.313 (1.031, 1.672)GEE, independence (robust): OR 1.313 (0.926, 1.861)GEE, exchangeable (robust): OR 1.304 (0.920, 1.847)
  • Naive GLM
  • GEE, independence (robust)
  • GEE, exchangeable (robust)

Ignoring clustering makes the between-child smoking effect look significant (naive p = 0.0275); the robust GEE standard error is about 44% larger (p = 0.1359). For the within-child age effect the robust error is smaller.

Odds-ratio calculator

Child A

Age
Mother

Child B

Age
Mother

Odds ratio, A vs B

1.164

95% CI (0.812, 1.668) · SE 0.2139

P(wheeze): A / B

15.1% / 13.2%

Population-averaged probabilities

Defaults reproduce Q3(d): a 10-year-old with a smoking mother versus a 9-year-old with a non-smoking mother. Robust (sandwich) standard errors throughout.

What the 2023 analysis found

(c) Each extra year of age multiplies the odds of wheezing by 0.8928 (approximate SE 0.0392 by the delta method; 95% CI (0.819, 0.973)): wheeze becomes slightly less common as children grow.

(d) A 10-year-old with a smoking mother versus a 9-year-old with a non-smoking mother: odds ratio 1.1638, 95% CI (0.812, 1.668). The write-up's 1.164 used coefficients rounded to three decimals.

Added in 2026

Model checks and an optional AI explanation

Does the working correlation matter?Independence, exchangeable and AR(1) structures with QIC, a bootstrap over children, and the child-specific GLMM for comparison.See the checks

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 (10 numbers, no data rows)
GEE coefficient (Intercept)
-1.88 · robust SE 0.1139, p = 3.08e-61
GEE coefficient age
-0.1134 · robust SE 0.04386, p = 0.00973
GEE coefficient smoke
0.2651 · robust SE 0.1777, p = 0.136
Odds ratio per extra year of age
0.8928 · 95% CI (0.8193, 0.9729)
Odds ratio, smoking vs non-smoking mother
1.304 · 95% CI (0.9201, 1.847)
Working correlation alpha
0.354
Naive GLM smoking SE (ignores clustering)
0.1235 · p = 0.0275
Smoking coefficient under independence working correlation
0.2721 · robust SE 0.178, QIC 1829.49
Smoking coefficient under exchangeable working correlation
0.2651 · robust SE 0.1777, QIC 1829.48
Smoking coefficient under ar1 working correlation
0.2345 · robust SE 0.1812, QIC 1830.26

Plus the model description, data source and: GEE coefficients are population-averaged (marginal) effects. Maternal smoking was observed, not assigned: 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": "Children's wheeze by age and maternal smoking (repeated yearly measurements)",
  "model": "Logistic GEE, exchangeable working correlation, robust (sandwich) standard errors",
  "data": "Ohio children's wheeze data (geepack::ohio), ages 7 to 10",
  "sample_size": "537 children, 2148 child-year observations",
  "quantities": [
    {
      "label": "GEE coefficient (Intercept)",
      "value": -1.88,
      "note": "robust SE 0.1139, p = 3.08e-61"
    },
    {
      "label": "GEE coefficient age",
      "value": -0.1134,
      "note": "robust SE 0.04386, p = 0.00973"
    },
    {
      "label": "GEE coefficient smoke",
      "value": 0.2651,
      "note": "robust SE 0.1777, p = 0.136"
    },
    {
      "label": "Odds ratio per extra year of age",
      "value": 0.8928,
      "note": "95% CI (0.8193, 0.9729)"
    },
    {
      "label": "Odds ratio, smoking vs non-smoking mother",
      "value": 1.304,
      "note": "95% CI (0.9201, 1.847)"
    },
    {
      "label": "Working correlation alpha",
      "value": 0.354
    },
    {
      "label": "Naive GLM smoking SE (ignores clustering)",
      "value": 0.1235,
      "note": "p = 0.0275"
    },
    {
      "label": "Smoking coefficient under independence working correlation",
      "value": 0.2721,
      "note": "robust SE 0.178, QIC 1829.49"
    },
    {
      "label": "Smoking coefficient under exchangeable working correlation",
      "value": 0.2651,
      "note": "robust SE 0.1777, QIC 1829.48"
    },
    {
      "label": "Smoking coefficient under ar1 working correlation",
      "value": 0.2345,
      "note": "robust SE 0.1812, QIC 1830.26"
    }
  ],
  "context": [
    "GEE coefficients are population-averaged (marginal) effects.",
    "Maternal smoking was observed, not assigned: associations, not causal effects.",
    "Original analysis: 2023 coursework, refitted in 2026."
  ]
}