Q37. Testing and simplifying an additive model
[5 marks]
Using the output in Question 36:
(a) Test whether there is evidence of a group difference after accounting for cholesterol. State the null hypothesis and your conclusion.
(b) A student writes:
“The smooth-term p-value is 0.002, so we have formally rejected a linear relationship between cholesterol and log-odds.”
Assess this argument. State what the displayed smooth-term test addresses.
(c) Propose a simpler model that removes the group term while retaining the smooth cholesterol effect. Write the R command needed to fit it.
Definitions. In the fitted logit GAM, \beta_G is the adjusted group coefficient and s(c) is the cholesterol smooth. A Wald statistic is an estimate minus its null value, divided by its standard error. \Phi denotes the standard Normal CDF. Use the supplied approximate model-based tests at the 5% level; the smooth-term test addresses the whole smooth, not specifically its nonlinear component.
(a) Test of the group effect. The hypotheses are H_0:\beta_G=0, \qquad H_1:\beta_G\ne0. The approximate Wald statistic is z=\frac{\widehat\beta_G}{\operatorname{SE}(\widehat\beta_G)} =\frac{-0.10}{0.50}=-0.20. Using a standard normal reference distribution under H_0, p=2\mathbb{P}(Z\ge |z|) =2\{1-\Phi(0.20)\}\approx0.841, \qquad Z\sim N(0,1). Since 0.841>0.05, do not reject H_0. Conclusion: There is insufficient evidence of a group difference after accounting for the smooth cholesterol effect. This does not establish that the group effect is exactly zero.
(b) Does the smooth-term p-value test nonlinearity? No. The displayed smooth-term test addresses \boxed{H_0:s(c)\equiv0,} that is, no cholesterol contribution after accounting for the other terms. Since 0.002<0.05, it provides evidence against that null. A nonzero straight-line effect also violates this null, so rejecting it does not establish nonlinearity. Testing nonlinearity requires an appropriately calibrated test of departures from a linear effect. The reported smooth p-values are approximate.1
(c) Simpler model. Remove the group term while retaining the smooth: Y_i\mid c_i\overset{\mathrm{ind}}{\sim}\operatorname{Bernoulli}(p_i), \qquad \log\left(\frac{p_i}{1-p_i}\right)=\beta_0+s(c_i). An R command is
fit.simple <- mgcv::gam(
disease ~ s(cholesterol),
family = binomial
)
This is the requested parsimonious model; the nonsignificant test does not prove that it is the unique correct model.
Footnotes
See the
mgcvdocumentation forsummary.gamfor the smooth-term null hypotheses, effective degrees of freedom, and limitations of the approximate p-values.↩︎