There are 190 pairwise contrasts that appear in a summary() or confint(). If I use summary() or confint() I can manually located the selected contrast in the console. Instead, I would like to find code to extract the selected contrast.
This is the code I have tried:
mN3em = emmeans(mN3, specs = 'region') # calculate estimated region means
mN3tuk = contrast(mN3em, method = 'pairwise') # perform tukey's for pairwise mult. comparisons
summary(mN3tuk)
summary(mN3tuk, infer = TRUE)$contrasts$"853 - 902"
mN3em = emmeans(mN3, specs = 'region') # calculate estimated region means
mN3tuk = contrast(mN3em, method = 'pairwise') # perform tukey's pairwise multiple comparisons
confint(mN3tuk) #check confidence interval
confint(mN3tuk)$estimate['region1573 - region1575']
When using the codes to attempt isolation of select pair, they return
[1] NA
It sounds like you want just a few contrasts, but you have created a quagmire by generating all pairwise comparisons. There are other possibilities, for example
contrast(mN3em, "consec")
just compares each mean with the next one. Or instead of"consec"
or"pairwise"
, you can give alist
of the contrast coefficients you want, e.g.,