← All posts

Conditional or Marginal? Two Questions, One Mixed Model

Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research Design
Conditional or Marginal? Two Questions, One Mixed Model
On this page

Abstract

One fitted mixed model can describe the same four measurements in two ways without contradicting itself. Conditional on the person's own offset, the four simulated skin-site readings are independent: variance 3.75, every off-diagonal cell zero. Marginally, with the offset hidden again, they carry variance 10.00, covariance 6.25 and correlation 0.625. This post writes both matrices out cell by cell, connects them with the laws of total mean, variance and covariance, and shows their difference is exactly the between-person variance in all sixteen cells. It also names the third state clinical practice usually occupies: a partly opened envelope, where one noisy reading informs you about the offset without revealing it. Readers learn which matrix their question requires, and why a within-person difference carries SE 0.43 against 0.50 for a site mean.

Infographic summary of conditional versus marginal interpretation in a linear mixed model
Visual summary

Post 3 of 8 — One Number Per Person: Linear Mixed Models from the Ground Up. Post 1 — The Shared Offset showed that a random intercept is one number per person, carried unchanged into every row that person contributes, and Post 2 — Compound Symmetry and the ICC turned that single shared number into a full 4×4 covariance matrix with 10.00 on the diagonal and 6.25 in every off-diagonal cell. This post writes out the other matrix — the one that holds once the person's own number is known — and shows why one fitted model can report both descriptions of the same four measurements without contradicting itself. The next post, V = ZGZ′ + R, compresses all of today's arithmetic into a single line.

Every number in this series comes from simulated teaching data — one core simulation, with clearly labelled variant simulations introduced in later posts. It is not an empirical finding, it describes no real cohort, and it must not be cited as evidence about skin physiology.

The output that appears to say two things at once

Here is the situation that sends people to a search engine. You fit the running model of this series — a simulated cross-sectional study of transepidermal water loss (TEWL, g·m⁻²·h⁻¹) measured at four standardised non-lesional sites (forearm, hand, shin, back) in 80 adults, 40 with moderate atopic dermatitis and 40 without atopic disease, giving 320 observations in a fully balanced design.

# Spec A — random intercept, pooled residual variance
library(nlme)
fitA <- lme(tewl ~ site * group + age + sex + phototype,
            random = ~ 1 | id, data = skin, method = "REML")

# equivalent in lme4
library(lme4)
fitA2 <- lmer(tewl ~ site * group + age + sex + phototype + (1 | id), data = skin)
* Stata equivalent of Spec A — reml is required, because mixed defaults to ML
mixed tewl i.site##i.group age i.sex i.phototype || id:, reml

The output then tells you two things that sound incompatible. First, the residuals of this model are independent with a single pooled variance of $\sigma^2 = 3.75$ — that is exactly what random = ~ 1 | id with no correlation structure assumes. Second, the same model implies an intraclass correlation of $\rho = 0.625$, so the four measurements from one participant are strongly correlated. Independent and correlated, from one fit, at the same time.

Nothing has gone wrong. The two statements describe the same four numbers under two different states of knowledge, and the whole of this post is the machinery for keeping them apart.

Two questions, and three states of knowledge

Before the hard part: think of a patient you have followed for years. With their chart open in front of you, their readings stop surprising you, because you already know the sort of baseline this person runs. For the next patient still sitting in the waiting room, whose chart you have never opened, those same readings remain tied to one another — whoever runs high tends to run high on all of them. This section is that difference, written carefully enough to survive being turned into a matrix.

Strip the notation away and the distinction is a clinical one. Two questions can be asked about the same simulated participant, and they are genuinely different questions.

The first is: "For this patient in front of me, whose own barrier offset I am treating as known, what do I expect at each of the four sites?" This is the conditional question, and it is answered by the model conditional on $b_i$ — on that person's offset itself, not on some indirect impression of it.

The second is: "For the next patient walking into the clinic, about whose barrier I know nothing at all, what do I expect?" Here the person's own offset is not merely unmeasured; it is unknown to you at the moment you make the statement. This is the marginal question, and it is answered after $b_i$ has been averaged over the population of persons.

One clarification belongs here rather than in a footnote, because the conditional matrix printed later in this post is exact only under the strict reading of the first question. Having seen one of the person's readings — the forearm value, say — is not the same as knowing $b_i$. A single measurement carries the offset and its own residual together, $Y_{i,\text{forearm}} = \mu_{\text{forearm},g} + b_i + e_{i,\text{forearm}}$, so it informs you about the offset without revealing it.

There are therefore three states of knowledge, not two: the envelope sealed (nothing known about this person), the envelope partly opened (one or more noisy readings in hand), and the envelope fully open ($b_i$ itself written on the card). The covariance that governs the middle state is the posterior predictive covariance. It is neither $3.75\,I_4$ nor the marginal matrix; it sits between them, and it tightens toward $3.75\,I_4$ as more of that person's sites are observed. This post works the two extremes, because those are the two matrices a fitted model reports. The middle state returns near the end — $\widehat{b}_{i}$ is precisely the attempt to move a partly opened envelope closer to an open one.

A mixed model answers both extremes. It does so because it was written as a two-stage statement: a within-person layer that holds $b_i$ fixed, and a between-person layer that describes how $b_i$ varies. Thus the same fitted object legitimately carries two covariance matrices, and reading the wrong one is the most common interpretive error in this entire literature.

The sealed envelope

Take the four simulated participants introduced in Post 1. The $b_i$ column is the card inside the envelope; the four site readings are what you actually observe.

idgroup$b_i$forearmhandshinback
S01control+2.514.120.111.417.0
S02control−3.09.710.98.310.4
S03AD+0.817.627.214.218.9
S04AD−2.016.920.612.717.3

In a real study that column does not exist — nobody hands you $b_i$. The simulation is generous enough to print it, which is precisely what makes it a teaching dataset: we can open the envelope, do the arithmetic, then seal it again and redo the same arithmetic. The two answers will differ, and the difference will be exactly $\tau^2$ in every cell of the matrix.

The envelope panel: the same measurements, twice Left, with each person's own offset subtracted, the residuals of S01, S02 and S03 straddle zero and change sign within a person. Right, with only the population mean subtracted, S01 sits above zero at all four sites and S02 below at all four, and the spread is wider. envelope OPEN — subtract μj,g + bi what is left is eij · Var 3.75 · Cov 0 envelope SEALED — subtract μj,g only what is left is bi + eij · Var 10.00 · Cov 6.25 +4 +2 0 −2 −4 +4 +2 0 −2 −4 deviation (g·m⁻²·h⁻¹) S01 S02 S03 S01 S02 S03 four sites per person, in order four sites per person, in order Identical measurements in both panels — only the number subtracted has changed. Sealed: S01 is above the mean at all four sites, S02 below at all four; S03 (bi = +0.8) shows mixed signs.
Illustration: the sealed-envelope device — opening the envelope reveals the conditional covariance matrix, which carries values only on its diagonal.

Opening the envelope: the conditional covariance matrix, worked

Before the hard part: a covariance matrix is nothing more exotic than a small table. Each cell on the diagonal answers "how much does this one measurement bounce around?", and each cell off the diagonal answers "when this measurement is above average, is that one usually above average too?". The next two sections build the same table twice from the same four readings — once with the person's chart open, once with it closed — filling in the cells by hand. If you can read a 4×4 table, you can read both matrices.

Work with S01, S02 and S03, and assume the envelope is open. The generating model is

\[ Y_{ij} = \mu_{j,g(i)} + b_i + e_{ij}, \qquad b_i \sim N(0,\ \tau^2 = 6.25), \qquad e_{ij} \sim N(0,\ \sigma^2 = 3.75), \qquad b_i \perp e_{ij}, \qquad e_{ij} \perp e_{ik}\ (j \neq k) \]

with population means $\mu_{j,g}$ of 12.0, 16.0, 10.0 and 14.0 in the control group and 18.0, 24.0, 13.0 and 19.0 in the AD group, at forearm, hand, shin and back respectively.

Once $b_i$ is known, the first two terms on the right-hand side are constants. The only random quantity left in the row is $e_{ij}$. Subtract the constants and you can read the residuals straight off the table:

idconditional mean $\mu_{j,g}+b_i$ (forearm / hand / shin / back)residual $e_{ij}$ (forearm / hand / shin / back)
S0114.5 / 18.5 / 12.5 / 16.5−0.4 / +1.6 / −1.1 / +0.5
S029.0 / 13.0 / 7.0 / 11.0+0.7 / −2.1 / +1.3 / −0.6
S0318.8 / 24.8 / 13.8 / 19.8−1.2 / +2.4 / +0.4 / −0.9

Look along each row of residuals rather than down the columns. Within S01 the signs run minus, plus, minus, plus; within S02, plus, minus, plus, minus; within S03, minus, plus, plus, minus. Knowing that S01's forearm residual was −0.4 tells you nothing whatsoever about the sign or size of the hand residual, because in this simulation the four $e_{ij}$ were drawn independently. That is what conditional independence means operationally.

The matrix therefore writes itself. With $b_i$ held fixed, $\operatorname{Var}(Y_{ij}\mid b_i)=\operatorname{Var}(e_{ij})=\sigma^2$ and $\operatorname{Cov}(Y_{ij},Y_{ik}\mid b_i)=\operatorname{Cov}(e_{ij},e_{ik})=0$ for $j \neq k$:

\[ \operatorname{Var}(Y_i \mid b_i) \;=\; \begin{pmatrix} 3.75 & 0 & 0 & 0\\ 0 & 3.75 & 0 & 0\\ 0 & 0 & 3.75 & 0\\ 0 & 0 & 0 & 3.75 \end{pmatrix} \;=\; 3.75\,I_4 \]

Every off-diagonal cell is zero, and the conditional correlation is zero for all six pairs. A person's four measurements, once you know that person's own offset — not merely their identity, and not merely one of their readings — carry no information about one another beyond what the site means already say.

Sealing it again: the marginal covariance matrix, worked

Before the hard part: this time, do the ward round without the charts. You still know what the average patient looks like at each site, so the site mean is the only thing you are allowed to subtract. Whatever is left over for each person still carries that person's own baseline, which is why the one who runs high runs high everywhere. That family resemblance between a person's own rows is precisely what a covariance measures.

Now cover the $b_i$ column with your hand and repeat the exercise. The only thing you may subtract is the population mean for that site and group, because that is all a person-blind analyst knows.

iddeviation from $\mu_{j,g}$ (forearm / hand / shin / back)
S01+2.1 / +4.1 / +1.4 / +3.0
S02−2.3 / −5.1 / −1.7 / −3.6
S03−0.4 / +3.2 / +1.2 / −0.1

The pattern that was invisible a moment ago is now unmissable. S01 sits above the control mean at all four sites and S02 sits below it at all four, because each of them is carrying an offset the analyst cannot see. Multiply any two deviations from the same person and the product is positive far more often than chance would allow — and a covariance is nothing more than the average of such products.

Two cautions before the algebra, because three participants prove nothing on their own. S03 shows mixed signs, since a $b_i$ of +0.8 is small relative to a residual SD of 1.94, and the covariance of 6.25 that follows is a property of the simulation's parameters rather than an estimate computed from these three rows. The rows illustrate the mechanism; the parameters supply the number.

Now the algebra, cell by cell. Substituting $Y_{ij} = \mu_{j,g} + b_i + e_{ij}$ and using the fact that $b_i$ and $e_{ij}$ were generated independently, the diagonal cells are

\[ \operatorname{Var}(Y_{ij}) = \operatorname{Var}(b_i) + \operatorname{Var}(e_{ij}) = \tau^2 + \sigma^2 = 6.25 + 3.75 = 10.00 \]

and each off-diagonal cell, for $j \neq k$, is

\[ \operatorname{Cov}(Y_{ij}, Y_{ik}) = \operatorname{Cov}(b_i + e_{ij},\, b_i + e_{ik}) = \underbrace{\operatorname{Var}(b_i)}_{6.25} + \underbrace{\operatorname{Cov}(b_i, e_{ik})}_{0} + \underbrace{\operatorname{Cov}(e_{ij}, b_i)}_{0} + \underbrace{\operatorname{Cov}(e_{ij}, e_{ik})}_{0} = 6.25 \]

Three of the four terms vanish by construction, so the entire off-diagonal is the variance of the shared number and nothing else. Assemble the sixteen cells and divide each by $\sqrt{10.00 \times 10.00}$ to get the correlations:

\[ \operatorname{Var}(Y_i) = \begin{pmatrix} 10.00 & 6.25 & 6.25 & 6.25\\ 6.25 & 10.00 & 6.25 & 6.25\\ 6.25 & 6.25 & 10.00 & 6.25\\ 6.25 & 6.25 & 6.25 & 10.00 \end{pmatrix}, \qquad \operatorname{Corr}(Y_i) = \begin{pmatrix} 1 & .625 & .625 & .625\\ .625 & 1 & .625 & .625\\ .625 & .625 & 1 & .625\\ .625 & .625 & .625 & 1 \end{pmatrix} \]

Put the two matrices side by side and the arithmetic of the whole post is visible in one glance: $3.75\,I_4$ on one side, $10.00$ on the diagonal and $6.25$ everywhere else on the other. Nothing was added to the data between the two pictures. The only thing that changed was whether the envelope was open.

Conditional and marginal covariance matrices, side by side Given b sub i the covariance matrix is 3.75 on the diagonal and zero everywhere else. Averaging over b sub i adds tau squared equal to 6.25 to all sixteen cells, giving 10.00 on the diagonal and 6.25 off it. conditional — envelope OPEN Var(Yi | bi) = 3.75 I4 marginal — envelope SEALED Var(Yi) = 6.25 J4 + 3.75 I4 3.75 0 0 0 0 3.75 0 0 0 0 3.75 0 0 0 0 3.75 10.00 6.25 6.25 6.25 6.25 10.00 6.25 6.25 6.25 6.25 10.00 6.25 6.25 6.25 6.25 10.00 integrate out bi + τ²J4 adds 6.25 to all sixteen cells Var 3.75 · Cov 0 · Corr 0 Var 10.00 · Cov 6.25 · Corr 0.625 site order forearm · hand · shin · back. Same data, same fitted model — only the state of knowledge differs.

What this means when you read papers: an ICC quoted in a methods section is a marginal quantity — it says how alike a person's own rows are before that person's identity is used, not how much correlation is left inside the model's residuals.

If you would rather watch this happen than read it, the explorer from Post 2 is embedded again below. Set $\tau^2 = 6.25$ and $\sigma^2 = 3.75$ with $k = 4$, then press the conditional | marginal toggle repeatedly and watch the off-diagonal cells appear and disappear while the diagonal moves between 3.75 and 10.00.

Three laws that connect the two matrices

Before the hard part: the three results below all perform the same simple move — take an answer that assumed you knew the patient, then average it over every patient you might have met instead. Two ordinary clinical sentences already make that move: "the average of each ward's average is the hospital average" (the mean does not shift), and "some of the variation happens within patients and some between patients" (the variance splits in two). The third result says the same thing about covariance. The algebra is those three sentences written in symbols.

The relationship between the two pictures is not a convention; it is three standard results applied in turn. Each one takes a conditional quantity, averages it over the distribution of $b_i$, and returns the marginal quantity.

The mean does not move. By the law of total expectation,

\[ E(Y_{ij}) = E_b\!\left[E(Y_{ij}\mid b_i)\right] = E_b\!\left[\mu_{j,g} + b_i\right] = \mu_{j,g} + 0 = \mu_{j,g} \]

because $b_i$ was defined to have mean zero. This is worth pausing on, because it is the reason mixed models feel harmless in the linear case: the random intercept moves the covariance and leaves the mean structure exactly where it was. The conditional and marginal fixed-effect coefficients are the same numbers on the same scale, so the site-by-group differences of +6.0, +8.0, +3.0 and +5.0 mean the same thing in both readings. That coincidence is a property of the identity link, not a general law, and Post 7 will collect on the promise by showing a binary outcome where the two coefficients genuinely differ [1].

The variance splits in two. By the law of total variance,

\[ \operatorname{Var}(Y_{ij}) = \underbrace{E\!\left[\operatorname{Var}(Y_{ij}\mid b_i)\right]}_{\text{average within-person variance} \;=\; \sigma^2 = 3.75} + \underbrace{\operatorname{Var}\!\left[E(Y_{ij}\mid b_i)\right]}_{\text{variance of the person means} \;=\; \tau^2 = 6.25} = 10.00 \]

The two terms have names worth saying out loud. The first is how far a single site sits from that person's own profile, averaged across persons. The second is how far the persons sit from one another. Total observed variability in this simulated dataset is the sum, and the ICC of 0.625 is simply the second term expressed as a fraction of the total.

What this means when you read papers: the "variance components" printed in a mixed-model table are exactly these two pieces — within-person and between-person — and the total variability a reader sees is their sum.

The law of total variance, applied to one measurement The marginal variance of 10.00 is the expected conditional variance, sigma squared equal to 3.75, plus the variance of the conditional mean, tau squared equal to 6.25. law of total variance Var(Yij) = 10.00 · marginal, envelope sealed + E[ Var(Yij | bi) ] σ² = 3.75 Var[ E(Yij | bi) ] τ² = 6.25 average within-person variance how far one site sits from that person's own profile variance of the person means how far the persons sit from one another ρ = 6.25 / 10.00 = 0.625 — the between-person term as a fraction of the total

The covariance is the leftover that is not there. By the law of total covariance, for $j \neq k$,

\[ \operatorname{Cov}(Y_{ij},Y_{ik}) = \underbrace{E\!\left[\operatorname{Cov}(Y_{ij},Y_{ik}\mid b_i)\right]}_{=\,0} + \underbrace{\operatorname{Cov}\!\left[E(Y_{ij}\mid b_i),\,E(Y_{ik}\mid b_i)\right]}_{=\,\tau^2\,=\,6.25} = 6.25 \]

Read it as a sentence: nothing is left over once the person is known, plus everything that comes from two measurements riding on the same person. The first term being zero is the conditional independence assumption; the second term being $\tau^2$ is the shared offset. Marginal dependence is therefore not an extra assumption bolted onto the model — it is the arithmetic consequence of the two assumptions already made.

The same fact can be written as a statement about probability densities rather than moments:

\[ p(Y_{i1},Y_{i2}) = \int p(Y_{i1}\mid b)\,p(Y_{i2}\mid b)\,p(b)\,db \;\neq\; p(Y_{i1})\,p(Y_{i2}) \]

Inside the integral the two densities multiply, which is conditional independence. Averaging that product over the distribution of $b$ destroys the factorisation, so the joint density on the left does not equal the product of the two marginal densities on the right. No integral needs to be evaluated here; the point is only that mixing independent things over an unknown shared quantity produces dependent things.

A proof you can do without any algebra

If the integral feels like sleight of hand, here is the same phenomenon in numbers small enough to check on paper. This illustration is not part of the running example and its numbers are chosen purely for arithmetic convenience.

Imagine a jar of coins. Half of them land heads with probability 0.8, the other half with probability 0.2, and you cannot tell the two types apart by looking. Draw one coin and toss it twice. Within a coin the two tosses are plainly independent — not because a coin has no memory, but because once the coin type is fixed the two tosses are draws from one and the same Bernoulli distribution, exactly as the four $e_{ij}$ are once $b_i$ is fixed.

Now compute the two probabilities that matter. Marginally, a toss lands heads with probability $0.5 \times 0.8 + 0.5 \times 0.2 = 0.5$, so the product of the two marginals is $0.5 \times 0.5 = 0.25$. The joint probability of two heads, however, is $0.5 \times 0.8^2 + 0.5 \times 0.2^2 = 0.5(0.64) + 0.5(0.04) = 0.34$, which exceeds 0.25. The covariance is $0.34 - 0.25 = 0.09$, and since each toss has variance 0.25 the correlation is $0.09/0.25 = 0.36$.

Two tosses of one coin are independent, and two tosses of an unidentified coin from this jar are correlated. Both statements are exactly true. The coin type is the sealed envelope, and $b_i$ plays the same role in the TEWL example that the coin type plays here.

One parent, four children

There is a graphical way to say the same thing that many readers find quicker. Draw $b_i$ as a single node with four arrows running down to the four site measurements. Two measurements from the same person have a common parent, so an association flows between them along the open path through $b_i$. Condition on $b_i$ — open the envelope — and the path closes, leaving the two measurements unassociated.

One warning, in the same paragraph rather than in a footnote, because this is where the analogy is routinely abused. The graph above is a device for reasoning about dependence structure, and $b_i$ is a latent statistical quantity, not a measured biological cause. Nothing in this post licenses a claim that some physiological factor causes leakier skin at all four sites, and the simulated data could not support such a claim even if it had been collected in a real clinic.

Illustration: a shared parent node with one path left open as association and one path closed by conditioning on the parent.

What the predicted offset is for — and what it is not for

Before the hard part: every clinician already shrinks estimates without calling it that. A single odd potassium in a patient who has never been abnormal is not taken at face value; you weigh it against what you know about that patient and about patients in general. The software does exactly this when it predicts a person's offset, and the only question left is how hard it pulls.

Software will happily hand you $\widehat{b}_{i}$, the predicted random effect, often called a BLUP. It is worth being precise about what that object is.

$\widehat{b}_{i}$ is not an estimated parameter in the sense that $\tau^2$ is. It is a prediction of an unobserved random quantity, computed as a compromise between what this person's own data suggest and what the population distribution says is plausible. The prediction is therefore shrunk toward zero relative to the person's raw average deviation, by a factor of $\tau^2 / (\tau^2 + \sigma^2/k)$ — a person with few measurements or a large residual variance is pulled harder toward the population mean than a person with many precise measurements.

The quantity that decides how hard the pull is deserves to be named correctly, because it is routinely misattributed. It is not $\tau^2$ against $\sigma^2$, a ratio of only 1.67 in this simulation. It is $\tau^2$ against $\sigma^2/k$, because the person's own evidence is an average of $k$ readings rather than a single one: $6.25 / (6.25 + 3.75/4) = 6.25/7.1875 = 0.87$, so the predicted offsets are pulled back by roughly 13% here. Had the design measured one site per person instead of four, the same variance components would have given $6.25/10.00 = 0.625$ and a pull of 37.5%. Thus the modest shrinkage in this simulated design is bought mainly by repeated measurement, not by the size of $\tau^2$ relative to $\sigma^2$.

Three uses are legitimate and one is not. First, $\widehat{b}_{i}$ is useful diagnostically, since a normal quantile plot of the predicted offsets is one of the standard checks on the random-effects distribution. Second, it is what you need for subject-specific prediction — the conditional question asked in the middle state named at the start of this post, about a person whose envelope you have only partly opened. Third, it makes the shrinkage idea concrete for teaching. What $\widehat{b}_{i}$ is not is a person-level outcome for a second analysis: treating the predicted offsets as if they were observed data and regressing them on covariates ignores their prediction uncertainty and their shrinkage, and could easily produce attenuated associations with standard errors that are far too small.

Why the model reports 0.43 where you expected 0.50

Before the hard part: this section explains why comparing a patient with themselves beats comparing two different patients. Take two sites from the same person, and whatever made that person run high sits on both sides of the subtraction and cancels. Compare a patient in one group with a patient in another, and nothing cancels — both personal baselines are still sitting in the answer. The arithmetic below is that sentence, and it is why the within-person difference ends up with the smallest standard error of the three.

The most persuasive consequence of all this arrives in the standard-error column, and it is the fact that Post 1 promised and Post 8 will defend in front of a professor.

Two pieces of housekeeping first, because these three numbers travel further than any other in the series. The closed forms below are plug-in values, computed from the generating variance components for the balanced cell-means model without covariates. The code at the top of this post additionally carries age, sex and phototype, and adjusting for person-constant covariates moves the between-person figures a little — by how much depends on how those covariates happen to be distributed in the sample. The within-person figure stays exactly where it is, since a person-constant covariate cancels in a within-person difference for the same reason $b_i$ does. A fitted model, moreover, prints estimated variance components rather than the generating ones, so your own output will differ in the second or third decimal place. Neither point disturbs what follows, which is a comparison of structure rather than of digits.

Under Spec A with $n = 40$ participants per group and a balanced design, the standard error of one estimated site mean within one group is

\[ \operatorname{SE}(\widehat{\mu}_{j}) = \sqrt{\frac{\tau^2+\sigma^2}{n}} = \sqrt{\frac{10.00}{40}} = 0.50 \]

That expression contains the marginal variance, 10.00, because a site mean is an average over persons whose offsets are unknown to the estimator. Two site means estimated from the same 40 participants are themselves correlated, with covariance $\tau^2/n = 0.15625$, for exactly the reason established above.

Now take the within-person contrast forearm − back inside one group. Its variance is the sum of the two variances minus twice their covariance:

\[ \operatorname{Var}(\widehat{\mu}_{\text{forearm}} - \widehat{\mu}_{\text{back}}) = 0.25 + 0.25 - 2(0.15625) = 0.1875, \qquad \operatorname{SE} = \sqrt{0.1875} = 0.43 \]

The same 0.1875 arrives directly from the conditional side, since $b_i$ cancels when the same person is differenced from themselves and the contrast is left with residual variability only: $2\sigma^2/n = 7.50/40 = 0.1875$. The two routes agree because they are the same calculation.

Set that 0.43 against the between-person contrast at a single site — AD minus control — which carries $\sqrt{2(\tau^2+\sigma^2)/n} = 0.71$. The within-person comparison is the more precise of the two, despite being estimated from the same 320 rows. The reason is not that one contrast lives in the conditional world and the other in the marginal one; it is that the within-person difference loads on $b_i$ with weight zero, so its conditional and marginal variances are the same number and the shared offset never enters the arithmetic from either direction. The group contrast enjoys no such cancellation, since a different set of 40 offsets sits on each side of it. Thus a design that measures four sites in each person buys precision for within-person questions that no amount of arithmetic can buy for between-person ones.

What this means when you read papers: when a results table shows a smaller standard error for a within-person comparison than for either of the group means it sits beside, that is the expected pattern rather than a typographical error.

What this post does not license

Four over-readings are easy to fall into here, and the first is the one I see most often.

First, conditional independence is an assumption of this model, not a discovered property of skin. Spec A was simulated with independent residuals, so of course the conditional matrix is diagonal; in a real dataset, adjacent measurements might share a residual dependence that no person-level offset can absorb, and only diagnostics could tell you.

Second, the equality of the conditional and marginal mean structures is a feature of the linear model with an identity link. It does not generalise, and assuming that it does is precisely the error that Post 7 exists to correct.

Third, a marginal correlation of 0.625 is not a reliability coefficient, even though the arithmetic that produced it is the same arithmetic that produces a reliability ICC. Here it is a nuisance-structure parameter describing how rows cluster within persons.

Fourth, none of this says that a conditional model is better than a marginal one, or the reverse. The two answer different questions, and the choice belongs to the research question rather than to the software.

What to do in your own analysis

First, write your research question on paper before you read any output, and decide explicitly whether it is a statement about a person or about the population — the answer determines which of the two matrices you should be quoting.

Second, when you report an ICC or a variance partition, say plainly that it is a marginal quantity computed from the estimated variance components, and give $\widehat{\tau}^{2}$ and $\widehat{\sigma}^{2}$ alongside it so a reader can reconstruct the ratio.

Third, when you report a within-person contrast whose standard error is smaller than that of the individual means, consider adding one sentence explaining that the shared person effect cancels in the difference; reviewers may otherwise read the smaller number as an error.

Fourth, treat the conditional independence of the residuals as a checkable assumption rather than a fixed truth. Residual-versus-fitted plots by unit, and residual patterns within persons, may indicate structure that the random intercept has not absorbed — which is the door that Posts 5 and 6 walk through.

Fifth, if you extract $\widehat{b}_{i}$ for any purpose beyond diagnostics or subject-specific prediction, state what you are doing with it and why its shrinkage and prediction uncertainty do not invalidate the downstream claim.

Key takeaways

Next in the series

Post 4 replaces all of today's hand arithmetic with one equation, $V_i = Z_i G Z_i' + R_i$, and shows that every mixed model you will ever fit changes exactly one of those two terms: V = ZGZ′ + R: The One Equation Behind Every Mixed Model.

Reference

  1. Zeger SL, Liang KY, Albert PS. Models for longitudinal data: a generalized estimating equation approach. Biometrics. 1988;44(4):1049–1060.
0
Message for International and Thai ReadersUnderstanding My Medical Context in ThailandRead more →Message for International and Thai ReadersUnderstanding My Broader Content Beyond MedicineRead more →

Comments

No comments yet. Be the first to share your thoughts.

Sign in to comment