[R-sig-ME] lmer()/glmer() data formatting question

Hedyeh Ahmadi hedyeh@h @end|ng |rom u@c@edu
Fri Apr 30 20:51:20 CEST 2021

Hi All,
I am having a basic question about data formatting for lmer()/glmer() that I think I know the answer, but I would appreciate it if you could confirm my understanding.

In the lmer() world, we have either time-varying or time-invariant predictors. When we format the data, we need to have it in long format. In long data format we have the following:

  *   Time-varying predictors will change for each time point (i.e. each row).
  *   Time-invariant predictors will stay the same for all time points.

My question: If I want to adjust for a baseline predictor then the format for this variable should be the same as time-invariant predictor (i.e. same value for all time points) - is that correct?

Thank you in advance for your time!


Hedyeh Ahmadi, Ph.D.
Applied Statistician
Keck School of Medicine
Department of Preventive Medicine
University of Southern California

Postdoctoral Scholar
Institute for Interdisciplinary Salivary Bioscience Research (IISBR)
University of California, Irvine


	[[alternative HTML version deleted]]

More information about the R-sig-mixed-models mailing list