Q36. A binomial model with a smooth effect
[4 marks]
The same patients are analysed using:
gam(disease ~ group + s(cholesterol), family = binomial)
The output includes:
| Parametric term | Estimate | Standard error | p-value |
|---|---|---|---|
group |
-0.10 | 0.50 | 0.841 |
| Smooth term | edf | p-value |
|---|---|---|
s(cholesterol) |
3.6 | 0.002 |
(a) Write down explicitly the model statement.
(b) Give an interpretation of edf = 3.6.
(c) On what scale does the fitted smooth s(\text{cholesterol}) contribute to the model?
Definitions. Let Y_i indicate disease, g_i\in\{0,1\} code groups A and B, and c_i denote cholesterol. Write p_i=\mathbb P(Y_i=1\mid g_i,c_i) and \operatorname{logit}(p)=\log\{p/(1-p)\}. The smooth s(c) is a fitted function; its effective degrees of freedom (edf) measure flexibility after penalisation. The response assumptions remain independent Bernoulli observations conditional on the fixed covariates.
(a) Model statement. Using the notation above, Y_i\mid g_i,c_i\overset{\mathrm{ind}}{\sim}
\operatorname{Bernoulli}(p_i), \boxed{
\log\left(\frac{p_i}{1-p_i}\right)
=\beta_0+\beta_Gg_i+s(c_i).
} Here s is a smooth function estimated from the data, with a penalty controlling its complexity. A centring constraint such as \sum_{i=1}^n s(c_i)=0 separates the smooth from the intercept: without a constraint, a constant could be added to s and subtracted from \beta_0 without changing the predictor. This is the usual constraint for an ordinary smooth in mgcv.1
(b) Interpretation of \mathrm{edf}=3.6. The effective degrees of freedom describe the complexity of the fitted smooth after penalisation. For this ordinary smooth, an edf near 1 corresponds to an approximately linear effect; 3.6 indicates that the fit uses additional flexibility to represent curvature on the link scale.
It does not mean a polynomial of degree 3.6, 3.6 knots, or 3.6 ordinary regression coefficients. Nor is edf by itself a formal test of nonlinearity.
(c) Scale of the smooth. The smooth contributes additively on the log-odds scale, not the probability scale. To obtain a disease probability, first form the whole predictor and then apply the inverse link: \eta_i=\beta_0+\beta_Gg_i+s(c_i), \qquad p_i=\frac{e^{\eta_i}}{1+e^{\eta_i}}. Thus s(c_i) alone is neither a probability nor a probability difference.
Key result. A smooth changes the shape of a covariate’s contribution; it does not remove the response distribution or the link function from the model.