Linear Mixed Models with Endogenous Covariates: Modeling Sequential Treatment Effects with Application to a Mobile Health Study

Tianchen Qian, Predrag Klasnja, Susan A. Murphy

Abstract

Mobile health (mHealth) is a rapidly developing field in which behavioral treatments are delivered to individuals via wearables or smartphones to facilitate health-related behavior change. Micro-randomized trials (MRT) are an experimental design for developing mobile health interventions. In an MRT, treatments are randomized numerous times for each individual over the course of the trial. Along with assessing treatment effects, behavioral scientists aim to understand between-person heterogeneity in the treatment effect. A natural approach is the familiar linear mixed model (LMM). However, directly applying LMMs is problematic because potential moderators of the treatment effect are frequently endogenous—that is, they may depend on prior treatment. This paper discusses model interpretation and biases that arise in the absence of additional assumptions when endogenous covariates are included in an LMM. We provide an additional assumption that, if true, allows scientists to use standard software to fit LMMs with endogenous covariates and provide person-specific predictions of effects. As an illustration, we assess the effect of activity suggestions in the HeartSteps MRT and analyze between-person treatment effect heterogeneity.

Introduction

In mobile health research, Micro-randomized trials (MRTs) have emerged as a powerful tool for delivering "nudges"—such as notifications to encourage physical activity—at hundreds of decision points throughout a participant's daily life. A primary goal for researchers is to understand not just if a treatment works on average, but why it works for some individuals and not others. This between-person heterogeneity is traditionally modeled using Linear Mixed Models (LMMs), which utilize random effects to capture individual differences.

However, mHealth data presents a unique challenge: endogeneity. In these settings, the "context" or covariates (e.g., a user's current step count or location) are often influenced by previous treatments. If a nudge at 10:00 AM successfully encourages a user to walk, their step count at 12:00 PM will be higher. This feedback loop violates the standard assumptions of LMMs, which were originally designed for settings where covariates are fixed or exogenous.

The Challenge of Endogenous Covariates

When covariates depend on prior treatment or outcomes, the mathematical foundation of the LMM shifts. Specifically, the fixed-effect coefficients lose their "marginal" interpretation—the average effect across the entire population. Simply applying standard software to this data without accounting for these feedback loops can lead to biased and misleading estimates.

This paper addresses this gap by bridging complex causal inference theory with the practical needs of behavioral scientists. The authors demonstrate that while the population-level meaning is obscured by endogeneity, the "conditional" meaning—the effect for a specific individual given their random effect—remains intact under certain conditions.

The Conditional Independence Assumption

To justify the use of standard statistical tools in the presence of endogeneity, the authors introduce a Conditional Independence Assumption. This assumption posits that the current covariate ($X_{it}$) must be independent of the individual's unobserved traits (random effects $b_i$), given the observed history of treatments and outcomes.

In practical terms, this means that any way a person’s unique characteristics influence their context must be captured within the data already collected. If this assumption holds, the authors prove that the complex joint likelihood of the sequential data can be factorized. This factorization provides a theoretical "green light" for researchers to use standard Maximum Likelihood Estimation (MLE) or Restricted Maximum Likelihood (REML) packages, such as lme4 in R, to estimate person-specific treatment effects.

Simulation and Empirical Validation

Simulation Studies

The authors tested their theory using three generative models (GMs):

  1. GM 1 & 2: These models satisfied the conditional independence assumption. In these cases, the LMM accurately estimated treatment effects with minimal bias.
  2. GM 3: This model intentionally violated the assumption by making the covariate depend directly on unobserved random effects. Here, the LMM produced significant bias that did not diminish even as the sample size increased, highlighting the sensitivity of the model to unobserved confounding.

The HeartSteps MRT

The methodology was applied to the HeartSteps study, a 6-week MRT involving 37 sedentary adults. The trial delivered contextually tailored activity suggestions five times daily, resulting in a dataset of 7,540 time points. The analysis focused on 30-minute step counts following a nudge, while accounting for covariates like location and prior activity.

Key findings included:

  • Initial Efficacy and Habituation: Activity suggestions were effective at the start of the study, but the effect significantly decayed over time ($\hat{\beta}_1 = -0.017$ per day). Exit interviews confirmed that users found the suggestions "boring" after several weeks.
  • Contextual Factors: Interestingly, the user's location (home/work vs. elsewhere) did not significantly moderate the response to nudges.
  • Heterogeneity: The study found surprisingly little between-person variation in how the treatment effect evolved, suggesting a relatively uniform habituation process across the small cohort.

Discussion and Future Directions

While LMMs provide a familiar and accessible framework for modeling individual differences, they are "mechanistic" models that assume the linear structure is the ground truth. They offer person-specific predictions that more robust causal methods, like Weighted Centered Least Squares (WCLS), cannot. However, LMMs remain sensitive to unobserved factors; if a covariate changes due to an unrecorded event (e.g., a sudden illness), the model's estimates may become biased.

Future research aims to develop estimation methods that provide "coherent" parameters—estimates that remain valid and interpretable at both the individual and population levels simultaneously, even in the complex, feedback-heavy environment of mobile health interventions.

Summary updated

Abstract

Mobile health is a rapidly developing field in which behavioral treatments are delivered to individuals via wearables or smartphones to facilitate health-related behavior change. Micro-randomized trials (MRT) are an experimental design for developing mobile health interventions. In an MRT the treatments are randomized numerous times for each individual over course of the trial. Along with assessing treatment effects, behavioral scientists aim to understand between-person heterogeneity in the treatment effect. A natural approach is the familiar linear mixed model. However, directly applying linear mixed models is problematic because potential moderators of the treatment effect are frequently endogenous-that is, may depend on prior treatment. We discuss model interpretation and biases that arise in the absence of additional assumptions when endogenous covariates are included in a linear mixed model. In particular, when there are endogenous covariates, the coefficients no longer have the customary marginal interpretation. However, these coefficients still have a conditional-on-the-random-effect interpretation. We provide an additional assumption that, if true, allows scientists to use standard software to fit linear mixed model with endogenous covariates, and person-specific predictions of effects can be provided. As an illustration, we assess the effect of activity suggestion in the HeartSteps MRT and analyze the between-person treatment effect heterogeneity.
BibTeX
@inproceedings{qian2020linear,
  author = {Tianchen Qian and Predrag Klasnja and Susan A. Murphy},
  title = {{Linear Mixed Models with Endogenous Covariates: Modeling Sequential Treatment Effects with Application to a Mobile Health Study}},
  booktitle = {Statistical},
  year = {2020},
  doi = {10.1214/19-sts720},
}
Figure