Why Treatment-Specific Clustering Needs Its Own Model
Some trials create clusters in one arm but not the other. For example, participants assigned to a group-based intervention may meet in therapy groups, while control participants receive materials individually. Outcomes from participants in the same intervention group can be associated because they share a group context. Control participants have no corresponding group membership. A model that gives every participant a group effect, or gives no participant a group effect, does not represent that membership pattern.
The central modelling task is to attach a random effect only to observations that actually share a cluster. This is not merely a coding convenience: the random-effects terms determine which pairs of observations can be dependent. The earlier material on covariance matrices from membership structure provides the general principle; here the membership depends on treatment arm.
Model and Assumptions
Let \(Y_i\) be a response for participant \(i\), and let \(T_i=1\) denote assignment to the clustered treatment arm and \(T_i=0\) denote control. Let \(g(i)\) identify the treatment group containing participant \(i\) when \(T_i=1\). There is no corresponding \(g(i)\) for a control participant. For a binary response, one suitable model is
Here \(\boldsymbol{x}_i\) is a vector of covariates, \(\boldsymbol{\beta}\) their fixed-effect coefficients, and \(u_j\) the random intercept for treatment group \(j\). For a control participant, the product \(T_i u_{g(i)}\) is defined as zero; no control group label or random effect is required. The inverse-logit function converts the linear predictor to a probability.
The model assumes that, conditional on the relevant random effects and covariates, responses are independent and have the stated Bernoulli distribution. It also assumes that the treatment-group effects are independent draws from a normal distribution with mean zero and variance \(\tau^2\), and that the chosen fixed-effects and link specifications are adequate. The random effect describes residual similarity among treated participants in the same group; it does not assert that group membership was randomized or that the treatment caused any observed association.
Worked Model Specification
Worked Example: Assigning Membership in a Small Trial
Hypothetical data. Eight participants enter a trial. Four receive a group intervention: participants A and B meet in group 1, while C and D meet in group 2. Four control participants, E through H, receive materials individually. Let \(T_i=1\) for A through D and \(T_i=0\) for E through H.
For A and B, the random-effects contribution is \(u_1\); for C and D, it is \(u_2\). For E through H, it is zero. Thus, with no covariates for simplicity, the eight linear predictors are
This specification matches the membership: A and B share a treatment group effect, as do C and D, while no treatment-group effect is assigned to controls. Giving E and F a shared control effect simply because they appear next to one another in a data file would invent a cluster that the design does not contain. Conversely, dropping \(u_1\) and \(u_2\) would treat the intervention-group outcomes as conditionally independent even when their group context induces residual association.
Deriving the Dependence Pattern
The random part of participant \(i\)'s linear predictor is \(T_i u_{g(i)}\). Suppose two treated participants \(i\) and \(k\) belong to the same group \(j\). Their random contributions are both \(u_j\), so their covariance on the linear-predictor scale is \(\operatorname{Var}(u_j)=\tau^2\). If they belong to different groups, the random effects are independent and that covariance is zero. A control has no such contribution, so its covariance with any participant arising from this random effect is zero.
These statements follow directly from covariance rules. For participants sharing group \(j\), the random-effect covariance is
For different groups \(j\ne \ell\), independence gives \(\operatorname{Cov}(u_j,u_\ell)=0\); if either participant is a control, its multiplier \(T\) is zero. In compact form, the contribution is \(\tau^2\) only when both observations are treated and share a group.
This is a covariance statement about the random component of the linear predictor, not a claim that the covariance of the binary outcomes equals \(\tau^2\). The outcome-scale dependence is induced by integrating over the random effects and the nonlinear inverse-logit link.
Worked Example: Calculating Linear-Predictor Covariances
Continue the hypothetical trial above and suppose \(\tau=0.6\), so \(\tau^2=0.6^2=0.36\). For participants A and B, who share group 1, the covariance of their random linear-predictor contributions is
A and C are both treated but belong to different groups. Since \(u_1\) and \(u_2\) are independent, their random-effect covariance is \(0\). E is a control, so its random contribution is exactly zero; the covariance contributed by this term between E and A is also \(0\). The resulting pattern is therefore \(0.36\) for treated pairs in the same group and \(0\) for other pairs, on the linear-predictor scale.
Interpreting the Treatment Contrast
The conditional interpretation makes the treatment-specific term especially important. Hold covariates fixed, and compare a treated participant in group \(j\) with a control participant. Their linear predictors differ by
Thus the group-specific conditional odds ratio is \(\exp(\beta_1+u_j)\). The fixed coefficient \(\beta_1\) alone is the fixed-effect component of this conditional contrast, not the entire treated-versus-control contrast for a participant in a particular group. Nor is \(\exp(\beta_1)\), in general, the marginal odds ratio after averaging over the distribution of \(u_j\): averaging probabilities under a nonlinear link does not generally preserve the same odds contrast.
Worked Example: A Group-Specific Conditional Contrast
Suppose a hypothetical fitted model for a binary outcome has \(\beta_0=-1.0\), \(\beta_1=0.8\), and an estimated random effect \(u_j=0.3\) for one treatment group. Take the covariates to be equal in the two participants being compared, or omit them for this calculation.
The control log-odds are \(-1.0\), giving probability \(\operatorname{logit}^{-1}(-1.0)=1/(1+e^1)\approx0.2689\). The treated participant in group \(j\) has log-odds \(-1.0+0.8+0.3=0.1\), giving probability \(\operatorname{logit}^{-1}(0.1)=1/(1+e^{-0.1})\approx0.5250\).
The conditional log-odds contrast is \(0.8+0.3=1.1\), and the corresponding conditional odds ratio is \(\exp(1.1)\approx3.004\). The value \(\exp(0.8)\approx2.226\) represents only the fixed-effect component on the odds-ratio scale; it is not the group-specific contrast in this example. These are conditional model-based comparisons, not evidence by themselves of a causal treatment effect.
Choosing the Structure and Checking Its Fit
A partially nested random intercept is appropriate when the substantive design supports the following structure: treated participants share a group-level source of variation, controls do not share that source, and different treatment groups are independent after accounting for modeled covariates and effects. If controls actually share a therapist, clinic, classroom, or other relevant unit, that membership must be represented rather than omitted. If both arms have clusters, but of different kinds, the model needs terms matching each membership pattern rather than a single one-arm term.
Useful checks begin with the design, not a significance test. Verify that each treated participant maps to exactly one intended group and that controls have no fabricated group labels. Tabulate group sizes and inspect whether they are highly unequal or whether only a very small number of treatment groups are available. After fitting, examine convergence warnings, estimates of \(\tau^2\) near zero or implausibly large, and whether residual patterns or group-level summaries suggest dependence not captured by the model. These checks can flag problems; none proves that the assumed random-effects distribution or conditional independence is correct.
A near-zero estimate of \(\tau^2\) may indicate little detectable between-group variation, but it can also reflect limited information, especially when there are few groups. A very small number of groups makes the estimated distribution of group effects difficult to assess. If treatment is assigned at the group level, rather than to individuals within groups, the treatment contrast is supported by the number of independently assigned units, not by the raw number of participants alone.
| Approach | What it assumes about dependence | Main concern in this setting |
|---|---|---|
| Partially nested GLMM | Only treated participants sharing a group have the specified group random effect. | Requires enough groups and a defensible random-effects distribution. |
| Ordinary GLM with no group term | Responses are conditionally independent given fixed effects. | Can understate uncertainty if treated-group dependence is present. |
| Random intercept for every participant or arm member | Assigns shared effects according to the labels and membership actually encoded. | A common group effect for controls invents dependence when they do not share groups. |
The ordinary GLM is a reasonable alternative only when the treated-group dependence is absent or negligible for the intended analysis, or when a different design-based method adequately handles it. A universal group random intercept is not automatically safer: it is wrong if it imposes shared control membership that the study did not have. The partially nested model is also limited. It does not repair confounding, poor treatment allocation, omitted covariates, or a mismatch between the assumed random-intercept structure and the actual sources of dependence.
Common Mistake
Wrong reasoning: “The treatment coefficient is \(\beta_1\), so the treated-versus-control log-odds contrast is \(\beta_1\), even for someone in a particular intervention group.” This ignores that treatment status changes both the fixed treatment term and the random-effect term. Correction: at equal covariate values, the conditional contrast for a treated participant in group \(j\) versus a control is \(\beta_1+u_j\). The coefficient \(\beta_1\) is its fixed-effect component. Also avoid assigning controls arbitrary group labels merely to satisfy software syntax; the resulting random effect would alter the model rather than simply organize the data.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- In a partially nested binary-outcome model, what random-effect contribution does a control participant receive?
- Two treated participants share a group, and the group random-intercept variance is \(0.25\). What is the covariance of their random linear-predictor contributions?
- If \(\beta_1=0.5\) and the treated participant's group effect is \(u_j=-0.2\), what is the conditional log-odds contrast and conditional odds ratio versus a control at the same covariate values?
- Why is it generally incorrect to interpret \(\exp(\beta_1)\) as the marginal odds ratio after averaging over group effects?
- Name one design feature that would require reconsidering the one-arm-only random-effect structure.
Solutions. (1) Zero: \(T_i=0\), so \(T_i u_{g(i)}=0\), and no control group label is needed. (2) The covariance is the group-effect variance, \(0.25\), because both contributions are the same random intercept. (3) The contrast is \(0.5+(-0.2)=0.3\); the conditional odds ratio is \(\exp(0.3)\approx1.350\). (4) The inverse-logit is nonlinear, so averaging probabilities over \(u_j\) does not generally yield the same odds contrast as exponentiating the fixed coefficient. (5) For example, if controls share a therapist or clinic that induces dependence, their shared membership may need a corresponding random effect; the original structure would omit that source of clustering.