I'm lost in Crossover design-repeated measurements and mixed modelling I am searching for days now, in what I think is a repeated measurements crossover design but I think I got mixed up reading up on it and I'm now going in circles so I was wondering if anyone could point me in the right direction.

*

*I was also wondering whether I should use interactions in my model and what the 1|subject means in a linear mixed model.

*I think that I need to include interactions for the sequence groups with the treatment received and an interaction for the days (?).

*I am worrying that in the end I include too many components to my model.

*I am also confused as to whether I should convert my factors to numeric variables.

I have a design which gives two treatments A and B in an uneven amount of patients. Each patient was given both treatments twice.
The patients were split in two groups with a different sequence of treatments (this was given as a text) administered and the outcome is numeric.
It looks like this:




Patient
Treatment
Phase
Group
Day
Outcome




1
A
1
1
1
38


1
B
1
1
2
8


1
A
2
1
3
29


1
B
2
1
4
5


2
B
1
2
1
28


2
A
1
2
2
41


2
B
2
2
3
33


2
A
2
2
4
45


3
A
1
1
1
68


3
B
1
1
2
8


3
A
2
1
3
69


3
B
2
1
4
4




I'm interested in seeing if there is a difference in the Outcome from the Treatments and what is this difference. Also a directions in the assumptions needed would be appreciated. Finally, an idea on how to plot the differences?
I am using R  (preferred) and from what I understand  lme4 has the required commands but have access to SPSS (24).
Thanks a lot!


I was also wondering whether I should use interactions in my model and what the 1|subject means in a linear mixed model.

We fit an interaction between two variables when we expect the "effect" of one variable on the outcome to differ, depending on the value of the other.
1|subject means that we are fitting random intercepts for subjects. This is typically done when we have repeated measures or some other kind of clustering within subjects.

I am also confused as to whether I should convert my factors to numeric variables.


I think that I need to include interactions for the sequence groups with the treatment received and an interaction for the days (?).

Again, if we expect the "effect" of one variable on the outcome to differ, depending on the value of the other, then we fit an interaction.

I am worrying that in the end I include too many components to my model.

You don't say how many observations in total and how many subjects, but based on the information given, this does not seem to be a concern.

I am also confused as to whether I should convert my factors to numeric variables.


*

*Patient: this will be used for random intercepts, so should remain a factor

*Phase and Group: these seems to be both binary, so it won't make any difference

*Treatment: this is a grouping variable so should remain a factor

In R, you could start with this model:
lmer(Outcome ~ Treatment + Phase + Group + Day  + (1|Patient), data = mydata)

but of course you should also add interactons, if these are of interest.
