Tutorials › Regression Analysis (Undergraduate) › Adjusting for Randomization Strata

Regression in Randomized Studies · Tutorial 904 of 991

Adjusting for Randomization Strata

See how regression accounts for a trial’s randomization strata and how its treatment coefficient combines the within-stratum treatment comparisons.

Intermediate 9 min read

What You'll Learn

  • Write a regression model with indicators for randomization strata
  • Identify the reference stratum and interpret its coefficients
  • Calculate the common adjusted treatment contrast from stratum-specific means
  • Explain the assumptions behind the adjusted contrast
  • Compare a stratum-adjusted estimate with a raw difference in means
  • Recognize why stratum indicators do not make randomized participants into clusters

Why Account for Randomization Strata?

A trial may divide participants into strata, such as age groups or baseline-risk categories, and randomize treatment separately within each stratum. This helps ensure that each treatment arm includes participants from the planned strata. The analysis can reflect that design by including stratum indicators in a regression model.

The purpose is not to change the assigned-treatment comparison into a comparison between different kinds of participants. Instead, the model compares treatment and control within the same randomization strata, then combines those comparisons under a common treatment-effect assumption. This can account for differences in outcome levels across strata and may improve precision when those differences are substantial.

Definition: A randomization stratum is a pre-treatment category within which treatment assignment is randomized separately. A regression model with stratum indicators includes a separate intercept shift for each stratum, while estimating one common treatment contrast across them.

The Stratum-Adjusted Regression Model

Let \(Y_i\) be the outcome for participant \(i\), and let \(T_i\) indicate assigned treatment: \(T_i=1\) for treatment and \(T_i=0\) for control. Suppose there are \(K\) strata. Choose one as the reference stratum, and define an indicator for each of the other \(K-1\) strata. The additive model is

$$ Y_i=\beta_0+\tau T_i+\sum_{j=2}^{K}\gamma_j I(S_i=j)+\varepsilon_i. $$

Here \(S_i\) denotes participant \(i\)'s stratum, and \(I(S_i=j)\) equals 1 when that participant is in stratum \(j\), and 0 otherwise. The reference stratum is indexed by 1. The model’s treatment coefficient is \(\tau\); its stratum coefficients \(\gamma_j\) describe outcome-level differences from the reference stratum.

Model interpretation: Under this additive model, the predicted treatment-versus-control difference is \(\tau\) in every stratum. The stratum indicators allow average outcome levels to differ across strata, but the model assumes one common treatment contrast.

For that interpretation to be meaningful, each stratum used in the analysis must contain participants assigned to both arms. Otherwise, a treatment-versus-control comparison within that stratum is not available from the trial data. The model also relies on the chosen additive form: it does not represent different treatment contrasts in different strata.

The design and analysis units matter. If participants were individually randomized within strata, each participant remains an observational unit; a stratum indicator does not by itself mean that participants within a stratum are a dependent cluster. For the usual regression analysis, outcomes should be independent across participants, and the conditional mean should be adequately represented by the model. Conventional OLS standard errors additionally rely on a constant residual variance; other standard error methods may be appropriate when that condition is not reasonable.

Worked Example: Reading a Model With Three Strata

Suppose a hypothetical trial groups participants by baseline risk: low, moderate, and high. Low risk is the reference stratum. A fitted model for a symptom score is

$$ \widehat{Y}_i=18.0-3.2T_i+4.5I(S_i=\text{moderate})+9.0I(S_i=\text{high}). $$

For a low-risk control participant, both stratum indicators are 0 and \(T_i=0\), so the predicted score is \(18.0\). For a low-risk treatment participant, the prediction is \(18.0-3.2=14.8\). The treatment-minus-control contrast in the reference stratum is therefore \(-3.2\) points.

For moderate-risk participants, the predicted control score is \(18.0+4.5=22.5\), and the predicted treatment score is \(18.0-3.2+4.5=19.3\). Their contrast is also \(19.3-22.5=-3.2\) points. The high-risk predictions are \(27.0\) for control and \(23.8\) for treatment, again a difference of \(-3.2\) points.

Thus, under this model, assignment to treatment is associated with a predicted symptom score 3.2 points lower than assignment to control at the same risk stratum. The \(-3.2\) is a common adjusted contrast, not a separate estimate for each stratum. The coefficients \(4.5\) and \(9.0\) describe differences in predicted score from the low-risk stratum among controls; they are not treatment effects.

How the Model Combines Within-Stratum Comparisons

The treatment coefficient can be understood directly from the treatment and control means in each stratum. Write \(n_{1s}\) and \(n_{0s}\) for the numbers assigned to treatment and control in stratum \(s\), and let \(\bar{Y}_{1s}\) and \(\bar{Y}_{0s}\) be their sample outcome means. The observed within-stratum difference is

$$ d_s=\bar{Y}_{1s}-\bar{Y}_{0s}. $$

When ordinary least squares fits the model with stratum indicators and one common treatment contrast, its treatment coefficient is a weighted average of these differences:

$$ \hat{\tau}= \frac{\sum_{s=1}^{K}w_s d_s}{\sum_{s=1}^{K}w_s}, \qquad w_s=\frac{n_{1s}n_{0s}}{n_{1s}+n_{0s}}. $$

A stratum contributes more weight when it provides more information from both arms. A stratum with very few participants in one arm receives less weight than one with substantial numbers in both arms. These weights come from the regression calculation; they are not necessarily the proportions of all trial participants in each stratum.

Why the Weighted-Average Formula Holds

For a fixed proposed treatment contrast \(\tau\), the fitted value in stratum \(s\) is \(\alpha_s+\tau T_i\), where \(\alpha_s\) is that stratum’s intercept. Minimizing squared residuals within the stratum gives

$$ \hat{\alpha}_s(\tau)= \frac{n_{0s}\bar{Y}_{0s}+n_{1s}(\bar{Y}_{1s}-\tau)} {n_{0s}+n_{1s}}. $$

After fitting this intercept, the portion of the residual sum of squares that depends on \(\tau\) is \(w_s(d_s-\tau)^2\), where \(w_s=n_{1s}n_{0s}/(n_{1s}+n_{0s})\). Summing across strata, the fitted treatment contrast minimizes

$$ Q(\tau)=\sum_s w_s(d_s-\tau)^2. $$

Differentiate and set the derivative to zero:

$$ \frac{dQ}{d\tau}=-2\sum_s w_s(d_s-\tau)=0 \quad\Longrightarrow\quad \hat{\tau}=\frac{\sum_s w_s d_s}{\sum_s w_s}. $$

The second derivative is \(2\sum_s w_s>0\) when both arms are represented in at least one stratum, so this solution minimizes \(Q(\tau)\). This establishes the formula for the treatment coefficient in the additive model.

Worked Example: Calculating the Adjusted Contrast

Consider a hypothetical trial with low-, moderate-, and high-risk strata. The table gives the number of participants and the mean outcome in each treatment arm. The outcome is a score for which higher values are better.

StratumControl \(n_{0s}\)Control meanTreatment \(n_{1s}\)Treatment mean
Low risk410414
Moderate risk620322
High risk230531

First calculate each within-stratum difference: \(d_{\text{low}}=14-10=4\), \(d_{\text{moderate}}=22-20=2\), and \(d_{\text{high}}=31-30=1\) score point.

Next calculate each weight:

$$ w_{\text{low}}=\frac{4(4)}{4+4}=2,\qquad w_{\text{moderate}}=\frac{3(6)}{3+6}=2,\qquad w_{\text{high}}=\frac{5(2)}{5+2}=\frac{10}{7}\approx1.429. $$

Therefore the adjusted treatment contrast is

$$ \hat{\tau}= \frac{2(4)+2(2)+(10/7)(1)} {2+2+10/7} =\frac{13.429}{5.429} \approx2.474\text{ score points}. $$

Under the common-contrast model, the fitted treatment arm’s mean score is about 2.474 points higher than the fitted control arm’s mean at the same stratum. This is an adjusted estimate, not a claim that every stratum-specific sample difference equals 2.474; the observed differences here are 4, 2, and 1 points.

Why the Raw Difference Can Mislead

The raw difference in overall treatment and control means combines two features: the within-stratum treatment comparisons and the proportions of each arm drawn from each stratum. If outcome levels differ greatly across strata and the arms happen to have different stratum compositions, the raw comparison can be very different from the within-stratum comparisons. Adjustment separates the treatment contrast from those composition differences.

Worked Example: A Raw Difference With the Opposite Sign

In a second hypothetical trial, there are two risk strata. The outcome is again a score for which higher is better. Within each stratum, the treatment mean is 2 points higher than the control mean.

StratumControl countControl meanTreatment countTreatment mean
Low risk210812
High risk830232

The overall control mean is

$$ \bar{Y}_0=\frac{2(10)+8(30)}{2+8} =\frac{260}{10}=26. $$

The overall treatment mean is

$$ \bar{Y}_1=\frac{8(12)+2(32)}{8+2} =\frac{160}{10}=16. $$

Thus the raw difference is \(\bar{Y}_1-\bar{Y}_0=16-26=-10\) points, even though the treatment mean is 2 points higher within each stratum. The treatment arm contains more low-risk participants, while the control arm contains more high-risk participants.

The adjusted regression contrast is \(2\) points. To verify it, each stratum has weight \(8(2)/(8+2)=1.6\), and each within-stratum difference is \(2\). Hence

$$ \hat{\tau}=\frac{1.6(2)+1.6(2)}{1.6+1.6}=2\text{ points}. $$

This example illustrates why a stratum-adjusted comparison can be informative. It does not establish that adjustment always changes the estimate or that a particular result is causal on its own; interpretation also depends on the trial design, the assigned-treatment comparison, and the model assumptions.

Interpretation and Common Pitfalls

The treatment coefficient answers a specific model-based question: what is the estimated treatment-minus-control contrast after accounting for the included strata, under the assumption of a common contrast? Its units are the units of the outcome. A negative estimate indicates a lower predicted outcome under treatment; whether that is beneficial depends on what higher and lower outcome values mean.

  • Dropping the design strata without thought. A raw difference can reflect differences in stratum composition as well as within-stratum treatment comparisons. Including the randomization strata makes the adjustment explicit.
  • Interpreting a stratum coefficient as a treatment effect. A stratum coefficient compares that stratum’s outcome level with the reference stratum, holding assignment fixed. The treatment coefficient is the treatment-versus-control contrast.
  • Assuming the adjusted coefficient is a simple average of stratum differences. In this OLS model the differences receive weights \(n_{1s}n_{0s}/(n_{1s}+n_{0s})\), so the weights depend on the arm counts within each stratum.
  • Claiming the estimate is different in every stratum. The additive model specifies one common contrast. It does not estimate a distinct treatment contrast for each stratum.
  • Calling strata clusters. Strata are categories used in the randomization and represented by indicators. They do not automatically create dependence among participants within the same category.
Key takeaway: Add indicators for the randomization strata to compare treatment and control within those strata. In the common-contrast OLS model, the treatment coefficient is a weighted average of within-stratum differences, with weights determined by the number assigned to each arm in each stratum.

Check Your Understanding

Try these questions before reviewing the examples.

  1. In a model with low-risk participants as the reference stratum, what does the coefficient of the high-risk indicator describe?
  2. Why must a stratum contain participants in both treatment arms to provide a within-stratum treatment comparison?
  3. A stratum has 12 treatment participants and 8 control participants. Calculate its weight \(w_s\).
  4. Does a stratum indicator imply that participants in that stratum form a dependent cluster? Explain.
  5. What common treatment-effect assumption is made by a regression model with stratum indicators but no treatment-by-stratum terms?
  6. Why might the raw difference in overall means disagree with the stratum-adjusted contrast?