Q41. Random slopes and changed conclusions
[5 marks]
The researcher changes the model to:
glmer(
infection ~ treatment * weeks + (weeks | patientID),
family = binomial
)
The estimated interaction coefficient is now -0.070, with standard error 0.055 and p-value 0.203.
(a) Write down the revised linear predictor and the joint distribution of its patient-specific random effects.
(b) Explain what additional variation this model allows compared with Question 39.
(c) Explain how the interaction can be significant in the first model and nonsignificant in the second, even though its estimated coefficient changes only slightly.
(d) Does the second result establish that the treatment groups have identical time trends? Justify your answer.
Definitions. Let i index patients and j visits, with infection indicator Y_{ij}, week t_{ij}, and treatment code G_i=0 for A or 1 for B. The random-effects vector is \mathbf b_i=(b_{0i},b_{1i})^\top: intercept and time slope. N_2(\mathbf0,\Sigma) uses covariance matrix \Sigma, whose entries are variances \tau_0^2,\tau_1^2 and covariance \tau_{01}. The conditional probability is p_{ij} and its logit is \eta_{ij}.
(a) Revised model. With \mathbf b_i=(b_{0i},b_{1i})^\top, the conditional predictor becomes \boxed{
\eta_{ij}
=\beta_0+\beta_GG_i+\beta_Tt_{ij}+\beta_{GT}G_it_{ij}
+b_{0i}+b_{1i}t_{ij}.
} Conditional on \mathbf b_i and the covariates, the responses are independent with Y_{ij}\mid\mathbf b_i,G_i,t_{ij}
\sim\operatorname{Bernoulli}(p_{ij}),
\qquad p_{ij}=\frac{e^{\eta_{ij}}}{1+e^{\eta_{ij}}}. The random effects have a joint distribution \boxed{
\begin{pmatrix}b_{0i}\\b_{1i}\end{pmatrix}
\overset{\mathrm{iid}}{\sim}
N_2\!\left[
\begin{pmatrix}0\\0\end{pmatrix},
\begin{pmatrix}
\tau_0^2&\tau_{01}\\
\tau_{01}&\tau_1^2
\end{pmatrix}
\right].
} The covariance matrix must be positive semidefinite. Random-effect pairs are independent across patients and are assumed independent of the covariates. The term (weeks | patientID) includes a random intercept, a random time slope, and an estimated covariance between them.1
(b) Additional variation. The random-intercept model permits different patient baselines but a common within-treatment time slope. The random-slope model also allows individual patients to change at different rates: \text{patient $i$'s time slope} =\beta_T+\beta_{GT}G_i+b_{1i}. The covariance \tau_{01} allows a patient’s baseline departure and time-slope departure to be associated. It is not required to be zero.
(c) Why can significance change when the estimate barely changes? The Wald test compares the estimate with its standard error, not with zero alone. In the random-intercept model, z_{\mathrm{RI}}=\frac{-0.080}{0.030}\approx-2.67, \qquad p\approx0.0077. In the random-intercept-and-slope model, z_{\mathrm{RIS}}=\frac{-0.070}{0.055}\approx-1.27, \qquad p\approx0.203. The estimated interaction changes only slightly, but its standard error increases from 0.030 to 0.055. Allowing patient-specific time trends changes the model for within-patient dependence and, in this fit, produces greater uncertainty about the between-treatment difference in time slopes.
This is not a universal rule that adding random slopes must increase every standard error. Nor does the change in p-value alone establish which random-effects structure is adequate.
(d) Does the second result establish identical time trends? No. Since 0.203>0.05, we do not reject H_0:\beta_{GT}=0 in the second model. This means insufficient evidence of a difference, not evidence that the difference is exactly zero. For example, an approximate 95\% Wald confidence interval is \widehat\beta_{GT}\pm1.96\operatorname{SE}(\widehat\beta_{GT}) =-0.070\pm1.96(0.055), or \boxed{(-0.1778,\;0.0378).} It includes zero but also includes nonzero differences in log-odds slopes. Showing practical equivalence would require a specified equivalence margin and suitable evidence, not merely a nonsignificant test.
Even equal fixed slopes on the log-odds scale would not imply identical probability curves when treatment intercepts differ, and individual patients can still have different slopes through b_{1i}.
Key result. Statistical significance depends on uncertainty as well as effect size. Failure to reject equality is not proof of equality.
Footnotes
See the
lme4formula documentation: a single-bar random-effects term allows correlated random-effect coefficients.↩︎