0
$\begingroup$

I have a repeated measures dataset that I am attempting to analyze using linear mixed effects regression. I would like to compare the effects of different products (A and B) on a dependent variable (y) for a number of different individuals randomly selected from a population. I measured y across three timepoints and on two different days. The data is structured like

Product Day ID Timepoint y
A 1 1 1 24
A 1 1 2 29
A 1 1 3 50
A 2 1 1 45
A 2 1 2 90
A 2 1 3 18
B 1 1 51 29

and so on and so forth with repeated measure for each individual at each of the three different timepoints on both test days. (This is dummy data, not the real dataset).

I would like to understand if there is any change in y across the three timepoints and if that is different between days and products (i.e, are the slopes or intercepts different between A and B on day 1 or between A and A on days 1 and 2, etc.).

I am analyzing this using lme4 in R. My current model is:

lmer(y ~ 1 + (Timepoint * Product * Day) + (1 | ID))

I am still very new to lme4 and am trying to wade through the implications, am I even remotely close to trying to answer my questions? Would something like

lmer(y ~ 1 + (Timepoint * Product + Day + Day:Product:Timepoint) + (1 | ID))

dropping the Day:Product term be more appropriate because it seems meaningless to me. Or would I have to nest (1 | Day/ID) because there might be some interactions between the day and the random effect?

Any guidance here would be much appreciated! I have a copy of Pinheiro and Bates I am working through but the repeated measures across both Timepoint and Day is what keeps tripping me up.

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.