Tutorials › Generalized Linear Mixed Models (GLMM) › Conditional And Marginal Estimands In Clustered Data

GLMM Versus GEE · Tutorial 113 of 698

Conditional And Marginal Estimands In Clustered Data

Learn to distinguish a mean conditional on a cluster effect from a mean standardized over a specified distribution of cluster effects.

Intermediate 12 min read

What You'll Learn

  • Define conditional and marginal estimands for a response in a cluster.
  • Distinguish fixing a cluster effect from averaging over its distribution.
  • Use the correct conditional distribution of cluster effects when covariates and effects may be associated.
  • Recognize how cluster-size weighting changes the target population.
  • Compare the estimands without treating either as universally preferable.
  • Identify assumptions and diagnostic questions relevant to the chosen target.

Why the Target Population Matters

Observations within a cluster—such as repeated measurements from one person or outcomes from patients at one clinic—may share features that make their responses related. A model can describe a response mean while holding a cluster effect fixed, or it can describe a mean after averaging over a distribution of cluster effects. These are different estimands: they answer different questions about the population, even when they arise from the same model.

The distinction is not merely technical. A mean for units in clusters with a particular latent effect is not automatically the mean for a randomly selected unit in a broader population of clusters. The latter depends on which distribution of cluster effects is used for averaging, and sometimes on how covariates and cluster sizes relate to those effects.

Definitions: Conditioning and Averaging

Let \(Y_{ij}\) be the response for unit \(i\) in cluster \(j\), \(X_{ij}\) its covariate value, and \(b_j\) a cluster effect. Write the model-based conditional mean as

$$ m(x,b)=E(Y_{ij}\mid X_{ij}=x,b_j=b). $$

The mean \(m(x,b)\) describes responses at covariate value \(x\) among units whose cluster effect is fixed at \(b\). It is a conditional mean, not an average over cluster effects. A conditional contrast between covariate values \(x_1\) and \(x_0\), at a specified \(b\), is \(m(x_1,b)-m(x_0,b)\) for a response measured on an additive scale.

Definition: A conditional estimand specifies a response feature, such as a mean or contrast, conditional on a stated cluster effect \(b\) (as well as any stated covariates). A marginal estimand averages a conditional response feature over a specified distribution of cluster effects. At fixed \(x\), a marginal mean standardized to a target distribution \(F_b\) is $$ \mu_{F_b}(x)=\int m(x,b)\,dF_b(b). $$ The distribution \(F_b\) is part of the estimand: it identifies the cluster-effect population over which the mean is averaged.

If \(b_j\) is discrete, the integral is a weighted sum; if it is continuous, it is an expectation under \(F_b\). The standardized mean \(\mu_{F_b}(x)\) refers to the mean response at \(x\) after averaging the conditional mean across the target distribution of effects. A marginal contrast can be defined by comparing two such standardized means using the same target distribution:

$$ \Delta_{F_b}(x_1,x_0) =\mu_{F_b}(x_1)-\mu_{F_b}(x_0) =\int\{m(x_1,b)-m(x_0,b)\}\,dF_b(b). $$

Using the same \(F_b\) for both covariate values makes this a comparison standardized to one cluster-effect population. If the two means are instead averaged over different distributions, their difference combines a covariate contrast with a change in the target cluster population.

When Does Averaging Give the Observed Population Mean?

The law of iterated expectation gives the mean conditional on \(X_{ij}=x\) by averaging over the distribution of cluster effects among units with that covariate value:

$$ E(Y_{ij}\mid X_{ij}=x) =E\{E(Y_{ij}\mid X_{ij}=x,b_j)\mid X_{ij}=x\} =\int m(x,b)\,dF_{b\mid X=x}(b). $$

Here \(F_{b\mid X=x}\) is the conditional distribution of the cluster effect given \(X_{ij}=x\). This identity does not in general use the unconditional distribution \(F_b\). The standardized mean \(\mu_{F_b}(x)\) equals \(E(Y_{ij}\mid X_{ij}=x)\) if, for example, \(b_j\) is independent of \(X_{ij}\), so that \(F_{b\mid X=x}=F_b\). It also equals that conditional mean if the two distributions happen to give the same average of \(m(x,b)\), even if the distributions themselves differ. Without such a condition, the standardized mean remains a valid target, but it should not be described as the observed conditional mean.

This distinction is especially important when covariates are measured within clusters or when cluster-level characteristics are associated with both covariates and outcomes. A model may define a chosen standardization over \(F_b\); the choice alone does not establish that this is the distribution of effects among units with a particular \(X\).

Worked Example: Standardizing an Identity-Link Mean

Suppose a hypothetical model for a continuous response measured in points has conditional mean \(m(x,b)=10+2x+b\). For a target population of clusters, suppose \(b\) has mean 0. Compare the conditional means at \(x=0\) and \(x=1\), and then calculate the means standardized over that target population.

Conditional means. At fixed effect \(b\), the model gives \(m(0,b)=10+b\) and \(m(1,b)=12+b\). The conditional contrast is

$$ m(1,b)-m(0,b)=(12+b)-(10+b)=2\text{ points}. $$

This contrast is the same at every \(b\) in this particular model.

Marginal means. Averaging over the target effect distribution uses \(E(b)=0\):

$$ \mu_{F_b}(0)=E(10+b)=10+0=10,\qquad \mu_{F_b}(1)=E(12+b)=12+0=12. $$

The standardized contrast is \(12-10=2\) points. This calculation requires only the specified target distribution and the stated model mean. To call these standardized means the observed means conditional on \(X=x\), one would additionally need \(F_{b\mid X=x}\) to yield the same averages; independence of \(b\) and \(X\) is a sufficient condition.

Worked Example: Covariate-Dependent Cluster Effects

Use the same hypothetical mean \(m(x,b)=10+2x+b\), but suppose the conditional effect distribution has mean \(-1\) among units with \(X=0\) and mean \(1\) among units with \(X=1\). Calculate the observed conditional means and compare them with standardization to a target distribution having mean effect 0.

By iterated expectation, the mean among units with \(X=0\) is \(10+2(0)+E(b\mid X=0)=10-1=9\) points. Among units with \(X=1\), it is \(10+2(1)+E(b\mid X=1)=10+2+1=13\) points. The observed conditional-mean contrast is \(13-9=4\) points.

For standardization to the common target distribution with mean effect 0, the means are \(10\) points at \(x=0\) and \(12\) points at \(x=1\), as in the previous calculation; the standardized contrast is 2 points. The difference between 4 and 2 does not contradict the model. The first contrast compares groups whose conditional effect distributions have different means, while the second compares covariate values after standardizing both to the same target distribution.

Thus, averaging over the unconditional target \(F_b\) without qualification would not recover either conditional mean in this example. The relevant distribution for the observed mean at each covariate value is \(F_{b\mid X=x}\).

Nonlinear Means Make the Distinction Visible

Even when the effect distribution is the same at each covariate value, averaging a nonlinear conditional mean can produce a marginal mean that is not the conditional mean evaluated at an average effect. The following hypothetical binary-response calculation illustrates the point without changing the estimand definitions.

Worked Example: Averaging a Nonlinear Binary Mean

Suppose a binary response has conditional probability \(m(x,b)=1/\{1+\exp[-(-1+x+b)]\}\). Let the target distribution put probability \(0.5\) on each of \(b=-1\) and \(b=1\), and suppose this same distribution is used at both covariate values. Calculate standardized probabilities at \(x=0\) and \(x=1\).

At \(x=0,b=-1\), the linear predictor is \(-2\), giving probability \(1/(1+e^2)\approx0.1192\). At \(x=0,b=1\), it is \(0\), giving probability \(0.5000\). Therefore,

$$ \mu_{F_b}(0)=0.5(0.1192)+0.5(0.5000)=0.3096. $$

At \(x=1,b=-1\), the predictor is \(-1\), giving probability \(1/(1+e)\approx0.2689\). At \(x=1,b=1\), it is \(1\), giving probability \(1/(1+e^{-1})\approx0.7311\). Thus,

$$ \mu_{F_b}(1)=0.5(0.2689)+0.5(0.7311)=0.5000. $$

These are the standardized probabilities under the stated two-point distribution. In particular, averaging the probabilities is not the same operation as replacing \(b\) by its mean, which is 0, and evaluating the conditional probability there. At \(x=0,b=0\), that conditional probability is \(1/(1+e)\approx0.2689\), not \(0.3096\). The marginal mean is defined by averaging the conditional means, not by substituting the average effect into a nonlinear formula.

Which Clusters Are Being Averaged?

A distribution over clusters and a distribution over individuals need not be the same. Suppose a target consists of clusters with different sizes. Selecting one cluster uniformly gives each cluster the same weight; selecting one individual uniformly gives larger clusters more weight. If cluster size relates to the cluster effect, these sampling schemes can produce different marginal means.

Worked Example: A Typical Cluster Versus a Typical Individual

Consider a hypothetical finite population of two clusters. Cluster A contains one unit and has \(b=0\); cluster B contains nine units and has \(b=2\). Suppose every unit has the same covariate value and conditional mean \(m(b)=5+b\) responses. Calculate the mean for an equally weighted cluster target and for a uniformly selected individual.

The cluster means are 5 and 7 responses. For a target that first selects one of the two clusters with equal probability, the average is \(\{5+7\}/2=6\) responses. For a target that selects one of the ten individuals uniformly, the average weights the cluster means by their sizes:

$$ \frac{1(5)+9(7)}{1+9} =\frac{68}{10} =6.8\text{ responses}. $$

The two answers are correct for their respective targets. They differ because the individual-level target gives the nine-unit cluster more weight, and that cluster has the larger mean in this example. A report of a “population average” should therefore specify whether the target is a typical cluster or a typical individual when cluster sizes are unequal and relevant to the averaging.

Assumptions, Checks, and Comparisons

The definitions themselves require a clearly specified response, covariate value, conditioning set, and target distribution. Connecting a model-based calculation to a population quantity requires more. The conditional mean model must be appropriate for the intended response and covariates; the distribution used for averaging must represent the intended target; and any claim that a standardized mean equals \(E(Y_{ij}\mid X_{ij}=x)\) must be justified by the relevant relationship between \(b_j\) and \(X_{ij}\). If cluster sizes affect selection into the target, the weights must also match the target population.

A conditional model, such as the conditional mean component of a GLMM, describes responses given the cluster effects. A marginal model, as commonly used in GEE, directly specifies a population-averaged mean. These are alternative ways to formulate a mean model, but their estimands are not automatically identical. A GLMM can also produce a marginal mean by integrating its conditional mean over a specified effect distribution. Neither label by itself determines whether the target is a typical cluster, a typical individual, or a covariate-conditional population.

Before interpreting a fitted analysis, check whether its stated target matches the scientific question. Useful questions include:

  • Is the question about units in clusters with a specified effect, or about an average over a population of clusters?
  • Is the effect distribution the target distribution, or is the goal the observed mean among units with \(X=x\), which uses \(F_{b\mid X=x}\)?
  • Are clusters or individuals weighted equally, and do unequal cluster sizes alter the intended population?
  • For a nonlinear conditional mean, has the mean itself been averaged, rather than the effect substituted by its average?

Diagnostics cannot prove that an unobserved random-effect distribution is correct. Still, patterns in cluster sizes, measured cluster characteristics, covariate distributions across clusters, and observed cluster-level outcome summaries can reveal a mismatch between modeling assumptions and the intended target. Sensitivity analyses over plausible target distributions or weights can show how much conclusions depend on those choices. These checks do not replace a precise estimand statement.

Common Mistakes and Limitations

  • Using the unconditional effect distribution automatically. The reasoning “average over \(F_b\) to obtain \(E(Y\mid X=x)\)” is incomplete. The correction is to average over \(F_{b\mid X=x}\), unless independence or another condition justifies using \(F_b\).
  • Calling a fixed-effect mean a population average. \(m(x,b)\) describes a conditional mean at a specified effect. It is not averaged over clusters until an effect distribution and averaging operation are supplied.
  • Replacing an average of means by a mean at an average effect. For nonlinear \(m(x,b)\), generally \(E\{m(x,b)\}\ne m\{x,E(b)\}\). Compute the average of the conditional means under the target distribution.
  • Leaving the unit of averaging implicit. Equal cluster weights and equal individual weights can define different targets when cluster sizes vary.

These distinctions clarify what a model-based mean represents; they do not, on their own, make an associational estimand causal. A causal interpretation requires additional design and identification assumptions. Also, an estimand can be clearly defined even if the available data or model cannot estimate it reliably. Defining the target and assessing whether it is supported are separate tasks.

Key takeaway: A conditional mean fixes the cluster effect; a marginal mean averages conditional means over a specified effect distribution. To identify an observed mean conditional on a covariate, average over the effect distribution conditional on that covariate—or justify why another target distribution gives the same result.

Check Your Understanding

Answer each question by identifying the target and showing the relevant averaging step. Solutions follow the questions.

  1. Suppose \(m(x,b)=4+x+2b\), and the target distribution for \(b\) has mean 1. What are the standardized means at \(x=0\) and \(x=2\)?
  2. If \(F_{b\mid X=0}\) and \(F_b\) differ, which distribution gives \(E(Y\mid X=0)\)?
  3. A binary conditional mean is \(m(b)\), with equal target probability on effects giving conditional probabilities 0.2 and 0.8. What is the standardized probability, and why is evaluating at the average effect not generally a substitute?
  4. Two clusters have sizes 2 and 8, with means 3 and 5 responses. Find the equally weighted cluster mean and the uniformly sampled individual mean.

Solutions. (1) Since \(E(b)=1\), \(\mu_{F_b}(0)=4+0+2(1)=6\), and \(\mu_{F_b}(2)=4+2+2(1)=8\). Both are responses on the model’s scale. (2) The observed conditional mean is \(\int m(0,b)\,dF_{b\mid X=0}(b)\), by iterated expectation; \(F_b\) can replace it only with a suitable equality condition, such as independence of \(b\) and \(X\). (3) The standardized probability is \(0.5(0.2)+0.5(0.8)=0.5\). For a nonlinear mean, the average of the two probabilities need not equal the probability evaluated at the average effect. (4) The equally weighted cluster mean is \((3+5)/2=4\) responses. The individual-weighted mean is \(\{2(3)+8(5)\}/10=46/10=4.6\) responses; it is larger because more individuals belong to the cluster with mean 5.

Clinical Biostats