I'm trying to apply regression on my data and I would like to be sure to do it correctly. My dependent variable (DV) is the position of the subject (numeric value). My independent variables (IV) are :
- The group in which the subject is (2 groups, a subject is in one or the other)
- The type of stimulus (2 different types, each subject is confronted with each stimulus so it is a "within" variable)
- The time of the measure (each subject got measured 3 times for each stimulus, so 6 times in total) I'm interested in each principal effect and the triple interaction (not the doubles).
If I'm correct, I have 1 between-subject IV (the group) and 2 within-subject crossed IV (stim and time). My dataframe counts 6 columns:
- The NS column gives the number of the subject.
- The Pos column which gives the subject's position
- The Group column
- The Stim column (the type of stimulus).
- The Time column (the moment of measurement; coded -0.5, 0 and 0.5)
Here is the code I ran in R :
RegAlc <- lmer(Pos ~ Group + Time + Stim + Group:Time:Task + (Time*Stim|NS), data = d) summary(RegAlc)
The code works but I would like to be sure that this is the correct way to analyze these data.
Thank you very much!