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

In mobile health (mHealth) research, Micro-Randomized Trials (MRTs) are increasingly used to deliver personalized behavioral interventions. While Linear Mixed Models (LMMs) are a standard tool for analyzing treatment effect heterogeneity, their application is complicated by endogenous covariates—variables that are influenced by prior treatments. This paper establishes a framework for using LMMs in the presence of endogeneity, demonstrating that under a specific "conditional independence" assumption, standard software can provide valid person-specific predictions. We apply this method to the HeartSteps MRT to explore how time and location moderate the effects of activity suggestions.

Introduction

Mobile health (mHealth) technologies allow for the delivery of real-time interventions via smartphones and wearables. A critical component in developing these interventions is the Micro-Randomized Trial (MRT), where treatments are randomized multiple times for each participant. Beyond assessing the average treatment effect, researchers are often interested in understanding between-person heterogeneity: why do some individuals respond more strongly to certain "push" interventions than others?

Linear Mixed Models (LMMs) are the conventional choice for modeling such heterogeneity through random effects. However, mHealth data frequently involves endogenous covariates—moderators that are themselves affected by previous treatments or outcomes. For instance, a user’s recent step count might moderate the effect of a new activity suggestion, but that step count was likely influenced by suggestions sent earlier in the day. This paper addresses the theoretical and practical implications of using LMMs in these complex, sequential settings.

The Problem of Endogeneity in LMMs

Standard LMM theory assumes that covariates are "exogenous," or independent of the model's error terms. In longitudinal mHealth studies, this assumption is routinely violated. When covariates are endogenous, the traditional "marginal" interpretation of LMM coefficients—representing the average effect across the population—is lost. This leads to biased estimates if researchers attempt to interpret the results as they would in a standard clinical trial.

Methodology and Theoretical Framework

The authors propose a path forward by shifting the focus from population-average effects to person-specific predictions.

1. Re-interpreting Coefficients

The study clarifies that while endogeneity biases marginal effects, the "conditional" interpretation remains valid. This means the coefficients correctly describe the treatment effect for a specific individual, given their unique random effect. In mHealth, where personalization is the ultimate goal, this conditional interpretation is often more valuable than the population average.

2. The Conditional Independence Assumption

The core of the proposed framework is the Conditional Independence Assumption. This assumption posits that the current covariate is independent of an individual’s random effects, provided the model accounts for the observed history of treatments and outcomes. Essentially, if the researcher includes enough historical data (e.g., past activity levels, weather, and previous responses), that history "soaks up" the correlation between the current state and the individual's underlying traits.

3. Software Compatibility

A significant practical contribution of this work is the proof that if the conditional independence assumption holds, the joint likelihood of the data can be factored. This factorization ensures that the part of the model containing the treatment effect parameters is identical to a standard LMM likelihood. Consequently, researchers can use standard, high-performance software like the lme4 package in R to fit these models without needing custom-coded algorithms.

Experimental Evaluation

The framework was tested using both simulated data and a real-world mHealth dataset.

Simulation Studies

The authors used three Generative Models (GMs) to evaluate the approach:

  • GMs 1 & 2: These models satisfied the conditional independence assumption. The results showed negligible bias, and 95% confidence intervals maintained their nominal coverage.
  • GM 3: This model intentionally violated the assumption. In this case, the coverage probability dropped significantly (as low as 35%), highlighting the importance of the assumption for valid inference.

The HeartSteps MRT

The method was applied to the HeartSteps study, a 6-week MRT involving 37 sedentary adults. The trial randomized activity suggestions five times daily. Key findings included:

  • Habituation: The effectiveness of activity suggestions was highest at the start of the study but declined significantly over time, suggesting users became habituated to the notifications within 2 to 4 weeks.
  • Location and Context: Interestingly, the user’s location (home, work, or elsewhere) did not significantly moderate the treatment effect.
  • Heterogeneity: While there was significant variation in baseline activity levels, the variation in how individuals responded to the treatment (random slopes) was relatively low.

Discussion and Limitations

The use of LMMs with endogenous covariates offers a powerful tool for person-specific modeling in mHealth, but it is not without limitations. The validity of the model rests on the Conditional Independence Assumption, which is a "domain call" rather than a mathematical certainty. Researchers must ensure that the collected history is comprehensive enough to account for individual differences. Furthermore, the current framework assumes linear relationships; extending this to non-linear models (GLMMs) for binary or count data remains a subject for future research.

Conclusion

By providing a rigorous justification for using LMMs with endogenous covariates, this work enables mHealth researchers to leverage familiar statistical tools to gain deeper insights into treatment effect heterogeneity. While it requires a shift in how results are interpreted, the ability to generate valid, person-specific predictions is a significant step forward in the development of adaptive, personalized 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