# [R-sig-ME] question regarding time as a continuous factor in a linear mixed effects model

Daniel Lüdecke d@|uedecke @end|ng |rom uke@de
Fri Feb 26 17:25:24 CET 2021

```Dear Laura,
you could use a package like "effects" or "emmeans" to compute estimated
marginal means and compare the values for time = 1 and time = 4, or you
could even use pairwise comparisons, like:

library(emmeans)
mdl.outcome <- lmer(outcome ~ time*Group + (1 | PID), data = dta)
emm <- emmeans(mdl.outcome, c("time", "group"), at = list(time = c(1, 4)))
emm
pairs(emm)

Best
Daniel

-----Ursprüngliche Nachricht-----
Von: R-sig-mixed-models <r-sig-mixed-models-bounces using r-project.org> Im
Auftrag von Laura Coco
Gesendet: Donnerstag, 25. Februar 2021 18:36
An: r-sig-mixed-models using r-project.org
Betreff: [R-sig-ME] question regarding time as a continuous factor in a
linear mixed effects model

Hello,

I am interested in investigating the main effects of group, time, and group
by time interaction on survey outcomes using linear mixed effects models.
Time is considered as continuous (number of days since baseline), but isn't
it also categorical, since I want to compare Session 1 vs Session 4 (for
example)? How is that handled in the model? As of now, time (days since
baseline) is being treated as one unit, rather than four separate sessions.

Here is an example of my code: mdl.outcome <- lmer(outcome ~ time*Group +
(1 | PID), data = dta)

Thank you!!

[[alternative HTML version deleted]]

_______________________________________________
R-sig-mixed-models using r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models

--

_____________________________________________________________________

Universitätsklinikum Hamburg-Eppendorf; Körperschaft des öffentlichen Rechts; Gerichtsstand: Hamburg | www.uke.de
Vorstandsmitglieder: Prof. Dr. Burkhard Göke (Vorsitzender), Joachim Prölß, Prof. Dr. Blanche Schwappach-Pignataro, Marya Verdel
_____________________________________________________________________

SAVE PAPER - THINK BEFORE PRINTING

```