I want to perform an ANOVA test on a mixed linear model.
I have variable response "CK" measured in 2 independant conditions: -2 groups of horses (independant variable : Groupe: Groupe 1 and Groupe 2 : between) -at 2 time points for each subject (independant variable : Temps: T0 and T4, within subject: repeated measures)
I want to perform a two way anova (on Groupe and Time) with post-hocs tests. I built a mixed linear model :
model <- lme(**CK~Temps*Groupe, random=~1|Cheval**,data=data, na.action=na.omit)
and perfomed an ANOVA test on the model
anova(modelCK, type = "marginal")
summary(modelCK)
From this; I only have a significant effect of Time. Now I want to do the post-hocs test to know where are the significant differences.
My question is; I tried few options to get the Post-hoc tests and got different results. I am confused and don't know what to keep.
***I started using emmeans:
emmeans(modelCK, pairwise~Temps, adjust = "bonferroni")
emmeans(modelCK, pairwise~Groupe, adjust = "bonferroni")
emmeans(modelCK, list(pairwise~ Groupe | Temps),adjust = "bonferroni")
emmeans(modelCK, list(pairwise~ Temps| Groupe),adjust = "bonferroni")
I found a significant difference at T4 between Group 1 and Group 2 I found a significant difference for Group 1 (only, not Group2) between T0 and T4.
***Then I used lsmeans
summary( lsmeans( model, pairwise ~ Groupe*Temps), infer=TRUE)
Here I don't find the difference at T4 between Group 1 and Group 2 But I found a difference for Group 2 between T0 and T4, on top of the one for Group 1.
***Then I used combination of one-way Anova with posthoc t-test
For the between-subject factor (Group):
one.way <- data %>%
group_by(Temps) %>%
anova_test(dv = CK, wid = Cheval, between = Groupe) %>%
get_anova_table() %>%
adjust_pvalue(method = "bonferroni")
pwc <- data %>% group_by(Temps) %>% pairwise_t_test(CK ~ Groupe, p.adjust.method = "bonferroni") pwc
There is no significant difference at T4 between the groups.
And for the within subject factor (Time):
one.way2 <- data %>% group_by(Groupe) %>% anova_test(dv = CK, wid = Cheval, within = Temps) %>% get_anova_table() %>% adjust_pvalue(method = "bonferroni")
pwc2 <- data %>%
group_by(Groupe) %>%
pairwise_t_test(CK ~ Temps, paired = TRUE, p.adjust.method = "bonferroni") %>%
select(-df, -statistic, -p) pwc2
Here I found difference for Groupe 1 and Groupe 2 on values between T0 and T4.
Why there is so many differences on results depending on the function used? Are my codes appropriate?
Thank you in advance,
Regards,
Édit :
I want to investigate if the CK parameter increased significantly with time (Temps) and if the increase is different depending the Group (Groupe). Actually just to compare the 4 conditions presented on that boxplot
Temps
or forTemps | Groups
or forTemps*Groups
depends on what you want to know. $\endgroup$