Dears,
Let's assume, that I have a study like this:
- longitudinal, 3 time points, T1, T2, T3. Let's assume T1 is post-intervention.
- 2 interventions, A and B
- 2 categorical covariates: Cov1 (2 levels: Cov1.1, Cov1.2) and Cov2 (2 levels: Cov2.1, Cov2.2) The covariates DO NOT interact with each other.
I want the interaction between Time and Intervention and the covariates to study the impact of the covariates on the intervention at each time point:
- Whether there are differences between interventions at each time point
- Whether these differences at all time points are affected by the baseline values of Cov1 and Cov2 (the baseline covariates may have different impact on subsequent time points, but itself they don't change over time).
I thought about something like:
Response ~ Intervention * Time * Cov1 + Intervention * Time * Cov2
I also saw somewhere also this shortcut: Response ~ (Intervention * Time) * (Cov1 + Cov2)
Or maybe it should be Response ~ Intervention * Time + Intervention * Time * Cov1... ?
or Response ~~ Intervention * Time + Intervention : Time : Cov1 + Cov1 + Intervention : Time : Cov2 + Cov2 ?
This is exploratory analysis I will be doing with GEE followed by the analysis of contrasts (in R: emmeans). My data are complete.
My output should look like (using emmeans):
Strata: Time T1:
Cov1.1-TrtA vs. Cov1.1-TrtB
Cov1.2-TrtA vs. Cov1.2-TrtB
Cov2.1-TrtA vs. Cov2.1-TrtB
Cov2.2-TrtA vs. Cov2.2-TrtB
PS: later the pairs for each covariate Cov1 (and Cov2) will be compared to see if in overall Cov1 (and Cov2) affects the effect TrtA vs. TrtB), I mean: [Cov1.1-TrtA vs. Cov1.1-TrtB] vs. [Cov1.2-TrtA vs. Cov1.2-TrtB ] and same for Cov2.
Strata: Time T2:
Cov1.1-TrtA vs. Cov1.1-TrtB
Cov1.2-TrtA vs. Cov1.2-TrtB
Cov2.1-TrtA vs. Cov2.1-TrtB
Cov2.2-TrtA vs. Cov2.2-TrtB
Strata: Time T3:
Cov1.1-TrtA vs. Cov1.1-TrtB
Cov1.2-TrtA vs. Cov1.2-TrtB
Cov2.1-TrtA vs. Cov2.1-TrtB
Cov2.2-TrtA vs. Cov2.2-TrtB
You know my goals, now I need your advice of which formula best reflects my needs. I cannot provide the data, it's just about general idea. I used R syntax, because it's easiest for me to understand the syntax. But if you use any other software, SAS, SPSS, you can provide your own. I need the general idea on how to set up the interactions properly.
EDIT: I just checked, that Response ~ Intervention*Time*(Cov1 + Cov2) gives me sensible model coefficients and it's equivalent to Response ~ Intervention + Time + Intervention:Time + Cov1 + Cov1:Time + Cov1:Intervention + Cov1:Time:Intervention + (same for Cov2)
The second options with Response ~ Intervention*Time + Cov1 + Intervention:Time:Cov1 + Cov2 + Intervention:Time:Cov2 gives me weird coefficients, I missed certain higher-level interactions.
Time T1before or after the intervention? Please provide that information by editing the question, as comments are easy to overlook and can be deleted. – EdM Mar 29 '23 at 21:54