Tutorials › Statistical Genetics › Worked LMM Analysis of a Related Cohort

Linear Mixed Models in Genetics · Tutorial 516 of 989

Worked LMM Analysis of a Related Cohort

Learn how to specify and report a related-cohort linear mixed-model analysis, including its variance components, candidate-variant effect, and model checks.

Intermediate 10 min read

What You'll Learn

  • Specify a genomic random-effect covariance model for related participants
  • Interpret the covariance implied by the genomic relationship matrix
  • Report REML variance-component estimates in phenotype units
  • Test and interpret a candidate-variant fixed effect with a Wald test
  • Describe diagnostic checks and limitations of the fitted model

From Related Samples to an Analysis Plan

When a quantitative phenotype is measured in a related cohort, participants’ outcomes are not generally independent: relatives may resemble one another because they share genetic background. A linear mixed model represents this dependence through a covariance matrix built from genomic relationships. The same model can include a candidate variant as a fixed effect, so its estimated association is adjusted for the modeled relatedness and other covariates.

A complete analysis requires more than a coefficient and a p-value. The analyst must state the mean model, explain the covariance model and its assumptions, report the variance-component estimates, and check whether the fitted model is an adequate description of the data. The examples below use explicitly hypothetical data and model output.

Definition: In a genomic linear mixed model, \(\boldsymbol{y}\) is the vector of quantitative phenotypes, \(X\) is the fixed-effect design matrix, \(\boldsymbol{\beta}\) is the vector of fixed-effect coefficients, and \(\boldsymbol{u}\) is a random polygenic effect. A common model is
$$ \boldsymbol{y}=X\boldsymbol{\beta}+\boldsymbol{u}+\boldsymbol{\varepsilon},\qquad \boldsymbol{u}\sim N(\boldsymbol{0},\sigma_g^2K),\qquad \boldsymbol{\varepsilon}\sim N(\boldsymbol{0},\sigma_e^2I). $$
Here \(K\) is a specified genomic relationship matrix, \(I\) is the identity matrix, \(\sigma_g^2\) is the polygenic variance parameter, and \(\sigma_e^2\) is the residual variance parameter. The model assumes that \(\boldsymbol{u}\) and \(\boldsymbol{\varepsilon}\) are independent, and that both have mean zero. Conditional on the fixed-effect mean, the phenotype vector is multivariate normal with covariance \(V=\sigma_g^2K+\sigma_e^2I\).

What the Covariance Model Says

The mean model \(X\boldsymbol{\beta}\) describes systematic differences in expected phenotype associated with the included fixed effects. It commonly includes an intercept, relevant measured covariates, and—in a candidate-variant analysis—the candidate genotype dosage. The random effect represents a shared polygenic contribution whose covariance across participants is specified by \(K\). The residual term represents remaining variation under the model.

For participants \(i\) and \(j\), the model implies

$$ \operatorname{Cov}(y_i,y_j)=\sigma_g^2K_{ij}+\sigma_e^2 I_{ij}. $$

Thus, an off-diagonal entry \(K_{ij}\) contributes modeled covariance between two different participants. The diagonal of \(K\) also matters: when \(K_{ii}=1\), the modeled variance of participant \(i\)'s phenotype around its fixed-effect mean is \(\sigma_g^2+\sigma_e^2\). The interpretation of the two variance parameters depends on the scale and construction of \(K\); their values should therefore be reported together with how that matrix was formed.

A standard analysis assumes that the fixed-effect mean is adequately specified, \(K\) is appropriate for the analyzed participants and is positive semidefinite, and the residuals have the stated common variance and independence structure. Normality supports the usual likelihood-based estimation and approximate Wald inference. These are modeling assumptions, not facts guaranteed by fitting software. In a candidate-variant analysis, the variant’s dosage is included as a fixed effect; a leave-one-chromosome-out relationship matrix is one common way to reduce overlap between the candidate’s chromosome and the polygenic covariance model.

Worked Example: Translating Relatedness Into Covariance

Suppose a hypothetical cohort has 240 participants and a phenotype measured in millimetres. For illustration, consider three participants whose diagonal entries in \(K\) are 1.0. Two are relatives with \(K_{12}=0.50\); the third has \(K_{13}=K_{23}=0.02\) with the first two. Suppose the fitted covariance parameters are \(\sigma_g^2=0.42\) and \(\sigma_e^2=0.58\), both in square millimetres.

For participant 1, the variance around the fixed-effect mean is \(0.42(1.0)+0.58=1.00\) square millimetres. For the related pair, their covariance is \(0.42(0.50)+0.58(0)=0.210\) square millimetres. For participants 1 and 3, it is \(0.42(0.02)+0.58(0)=0.0084\) square millimetres.

The covariance is larger for the more related pair because their \(K\) entry is larger. This calculation does not say that the observed outcomes must differ by a particular amount; it describes the covariance the model assigns before observing those outcomes.

Estimating the Variance Components

In practice, the variance parameters are estimated from the phenotype data and the specified \(K\), typically by restricted maximum likelihood (REML). REML accounts for the estimation of fixed effects when estimating covariance parameters. Estimates are constrained to be nonnegative because they represent variances. An estimate at zero is a boundary estimate, not evidence that the corresponding source of variation is known to be absent.

The fitted covariance matrix is obtained by substituting the estimates into \(V=\sigma_g^2K+\sigma_e^2I\). Inference about fixed effects then uses this estimated covariance structure. Variance estimates are in squared phenotype units; their standard errors, when reported, are also in squared phenotype units. The estimates describe this model fit and should not be interpreted beyond the assumptions and scale used to construct \(K\).

Worked Example: Reporting REML Variance Estimates

Suppose REML applied to a hypothetical 240-person cohort returns \(\hat{\sigma}_g^2=0.42\) square millimetres (standard error \(0.09\)) and \(\hat{\sigma}_e^2=0.58\) square millimetres (standard error \(0.11\)). Assume the relationship matrix is scaled so its diagonal entries are 1.0. The fitted covariance is

$$ \widehat V=0.42K+0.58I. $$

For a participant with \(K_{ii}=1\), the fitted marginal variance is \(0.42(1)+0.58=1.00\) square millimetres. For a pair with \(K_{ij}=0.50\), the fitted covariance is \(0.42(0.50)=0.210\) square millimetres, because \(I_{ij}=0\) for distinct participants.

A suitable report is: “REML estimated the polygenic variance parameter as \(0.42\) square millimetres (SE \(0.09\)) and the residual variance parameter as \(0.58\) square millimetres (SE \(0.11\)); the fitted model used a relationship matrix with diagonal entries scaled to 1.” These are model-specific variance estimates. Their sum of 1.00 is the fitted diagonal variance under the stated scaling, not a general claim that the observed sample variance must equal 1.

Testing a Candidate Genetic Effect

Let \(G_i\) denote participant \(i\)'s dosage of the candidate allele, coded 0, 1, or 2. The candidate-variant model includes \(G\) as a column of \(X\), alongside the intercept and other prespecified covariates. Its coefficient \(\beta_G\) is the expected phenotype difference associated with a one-allele increase in dosage, conditional on the included covariates and the mixed-model covariance structure. It is an association estimate, not by itself a causal effect.

A Wald test evaluates \(H_0:\beta_G=0\) against \(H_a:\beta_G\ne0\). If the fitted coefficient is \(\hat{\beta}_G\) and its estimated standard error is \(SE(\hat{\beta}_G)\), the Wald statistic is their ratio. With a large-sample normal reference distribution, the two-sided p-value is the probability under a standard normal distribution of a statistic at least as extreme in absolute value. The normal approximation, correct mean and covariance specifications, and sufficiently reliable variance estimates matter to the calibration of this test.

$$ z=\frac{\hat{\beta}_G}{SE(\hat{\beta}_G)},\qquad p=2\Phi(-|z|). $$

A confidence interval using the same normal approximation is \(\hat{\beta}_G\pm1.96SE(\hat{\beta}_G)\) for a 95% interval. It describes values compatible with the data and model under the procedure’s repeated-sampling coverage properties; it is not a probability statement about a fixed parameter being inside this particular interval.

Worked Example: Wald Test for a Candidate Variant

In a hypothetical related cohort, suppose the fitted candidate-variant coefficient is \(0.380\) millimetres per allele, with standard error \(0.160\) millimetres per allele. The model includes prespecified covariates and a genomic random effect. Test \(H_0:\beta_G=0\) against a two-sided alternative using the large-sample Wald approximation.

The statistic is \(z=0.380/0.160=2.375\). The two-sided p-value is \(2\Phi(-|2.375|)=0.01755\). At significance level \(\alpha=0.05\), this p-value is below 0.05, so the data provide evidence against a zero candidate-variant coefficient under the fitted model. The p-value is not the probability that the null hypothesis is true.

The corresponding 95% Wald interval is \(0.380\pm1.96(0.160)=0.380\pm0.3136\), or \((0.0664,0.6936)\) millimetres per allele. In context, the interval gives a range of candidate-allele association effects compatible with the data and model under the normal-approximation procedure. It does not establish that changing the allele would cause this phenotype difference.

Checks, Reporting, and Limitations

A fitted model should be examined before its association result is treated as dependable. The checks should be chosen to probe the assumptions and the data features relevant to the analysis, rather than to produce a single pass-or-fail label. For example, residual plots can reveal trends in residual spread or mean, and a normal quantile plot can reveal marked departures from the assumed residual distribution. Because participants are related, it is also useful to examine whether residual similarity remains patterned by genomic relatedness after fitting the model. Calibration checks across null or control variants can help reveal systematic test-statistic inflation, though they do not identify every possible source of misspecification.

Model checks do not prove that the covariance structure is correct. Potential limitations include a poorly specified fixed-effect mean, population structure not adequately represented by covariates or \(K\), an unsuitable relationship matrix, heterogeneity in residual variance, influential observations, and genotype or phenotype measurement error. If the candidate variant contributes to the relationship matrix, its signal may partly enter the random effect; a leave-one-chromosome-out matrix can reduce this concern. The choice of matrix and covariates should be stated transparently.

1
Define the analysis.
State the phenotype, participants, candidate dosage coding, covariates, and construction of \(K\).
2
Fit the covariance model.
Estimate the variance parameters using REML and report estimates, uncertainty, and the scale of \(K\).
3
Evaluate the candidate effect.
Report its per-allele coefficient, standard error, test, p-value, and interval, identifying the reference approximation.
4
Assess adequacy and qualify conclusions.
Summarize relevant diagnostics and limitations; interpret the result as a model-adjusted association.

A useful justification for the covariance formula follows directly from the model. Since the fixed effects are treated as nonrandom, they contribute no covariance. Independence of \(\boldsymbol{u}\) and \(\boldsymbol{\varepsilon}\) makes their cross-covariance zero. Therefore,

$$ \operatorname{Cov}(\boldsymbol{y}) =\operatorname{Cov}(\boldsymbol{u}+\boldsymbol{\varepsilon}) =\operatorname{Cov}(\boldsymbol{u})+\operatorname{Cov}(\boldsymbol{\varepsilon}) =\sigma_g^2K+\sigma_e^2I. $$

This identity explains why the same genomic matrix enters the covariance between participants and the marginal variance for each participant: the diagonal and off-diagonal entries encode different parts of the same covariance structure.

Common Mistake

  • Wrong reasoning: “The candidate-variant p-value is small, so the variant causes the phenotype, and the model has accounted for all relatedness.”
  • Correction: The test evaluates association conditional on the specified fixed effects and covariance model. A small p-value does not prove causality or guarantee that \(K\), the covariates, or residual assumptions are adequate. Report the estimate and uncertainty, state the model, and describe diagnostics and limitations.
Key takeaway: A related-cohort LMM analysis connects three pieces: a fixed-effect mean, a genomic covariance model, and a model-based test of the candidate coefficient. Interpret the test together with variance estimates, checks, and the assumptions that make its inference meaningful.

Check Your Understanding

Use the model and reporting principles above to answer these questions.

  1. If two distinct participants have \(K_{ij}=0.40\), what is their modeled covariance when \(\sigma_g^2=0.50\) and residual errors are independent?
  2. What does a candidate-variant coefficient of \(-0.12\) phenotype units per allele mean, conditional on the covariates and covariance model?
  3. Why should the scaling of \(K\) be reported alongside variance-component estimates?
  4. What does a two-sided Wald p-value of 0.01755 say, and what does it not say?
  5. Name one diagnostic that could reveal a problem with the fitted model and one limitation that such a diagnostic cannot rule out.
Clinical Biostats