I have a question regarding the output from a discrete-time survival model that I have previously asked questions about [here][1].
The code looks the following (see link further up for more info):
mod<-glm(Mating_time ~ Round + A*B,data=dat, family=binomial(link="cloglog"))
Anova(mod)
> Anova(mod)
Analysis of Deviance Table (Type II tests)
Response: as.factor(Mating_time)
LR Chisq Df Pr(>Chisq)
Round 35.094 8 2.571e-05 ***
A 3.749 2 0.15343
B 9.024 2 0.01097 *
A : B 10.424 4 0.03385 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
multcomp::cld(emmeans(Mating_time, ~A|B), Letters = letters, reversed = T) # Post-Hoc test
> multcomp::cld(emmeans(Mating_time, ~A|B), Letters = letters, reversed = T) # Post-Hoc test
B = Metabolite:
A emmean SE df asymp.LCL asymp.UCL .group
Normal -1.87 0.218 Inf -2.29 -1.44 a
Metabolite -1.98 0.192 Inf -2.35 -1.60 a
Low -1.99 0.217 Inf -2.42 -1.57 a
B = Normal:
A emmean SE df asymp.LCL asymp.UCL .group
Low -1.49 0.213 Inf -1.91 -1.08 a
Normal -2.35 0.249 Inf -2.84 -1.86 b
Metabolite -2.59 0.264 Inf -3.10 -2.07 b
B = Low:
A emmean SE df asymp.LCL asymp.UCL .group
Normal -2.26 0.230 Inf -2.71 -1.81 a
Low -2.55 0.265 Inf -3.07 -2.03 a
Metabolite -2.62 0.236 Inf -3.09 -2.16 a
Results are averaged over the levels of: Round
Results are given on the cloglog (not the response) scale.
Confidence level used: 0.95
Note: contrasts are still on the cloglog scale
Results are given on the as.factor (not the response) scale.
P value adjustment: tukey method for comparing a family of 3 estimates
significance level used: alpha = 0.05
NOTE: If two or more means share the same grouping symbol,
then we cannot show them to be different.
But we also did not show them to be the same.
I know that ANOVA and post-hoc tests such as Tukey's test can give different output since they are different tests that answers different questions. However, the output I get is somewhat confusing to me. I do see significance of B and A : B interaction (also round but that's less important to what I'm actually interested in, I'm interested in how A and B and their interaction influences mating_time). Due to the way we structured our research question, we do pairwise comparisons by B (three comparisons for the three groups formed). However, the output I get from the ANOVA says that there's significance for B and the interaction A : B. However, when I do the post-hoc test I would suspect all comparisons being the same because of this. Although I see differences in the "B normal" group, this I would expect to be the case if A on ANOVA showed significance. I can't wrap my head around how this could be the case if just B and A : B interaction showed significance.
EDIT:
When I try to run type 1 SS anova (either with anova() command or aov()) on the model I run into the following error that I can't find no correction for online.
> test<-aov(mod)
Warning messages:
1: In model.response(mf, "numeric") :
using type = "numeric" with a factor response will be ignored
2: In Ops.factor(y, z$residuals) : ‘-’ not meaningful for factors
> summary(test)
Error in levels(x)[x] : only 0's may be mixed with negative subscripts
Works with Anova type II and III though. Any thoughts?
aov()
is a function for fitting a model. I think you meantanova()
orcar::Anova()
$\endgroup$