-
-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Description
I would like to use the modelbasedpackage for an introductory statistics class. To show post-hoc tests, I am using the estimate_contrasts() function.
When I keep the default setting, i.e. no p-value adjustment and run the following test:
library(palmerpenguins)
library(modelbased)
m_spec <- lm(body_mass_g ~ species, data = penguins)
estimate_contrasts(m_spec)
I get:
We selected `contrast=c("species")`.
Marginal Contrasts Analysis
Level1 | Level2 | Difference | SE | 95% CI | t(330) | p
---------------------------------------------------------------------------------
Chinstrap | Adelie | 26.92 | 67.65 | [-106.16, 160.01] | 0.40 | 0.691
Gentoo | Adelie | 1386.27 | 56.91 | [1274.32, 1498.22] | 24.36 | < .001
Gentoo | Chinstrap | 1359.35 | 70.05 | [1221.55, 1497.15] | 19.41 | < .001
Variable predicted: body_mass_g
Predictors contrasted: species
p-values are uncorrected.
When I use Tukey adjustments:
estimate_contrasts(m_spec, p_adjust = "tukey")
I get:
We selected `contrast=c("species")`.
Marginal Contrasts Analysis
Level1 | Level2 | Difference | SE | 95% CI | t(330) | p
---------------------------------------------------------------------------------
Chinstrap | Adelie | 26.92 | 67.65 | [-106.16, 160.01] | 0.40 | < .001
Gentoo | Adelie | 1386.27 | 56.91 | [1274.32, 1498.22] | 24.36 | 0.691
Gentoo | Chinstrap | 1359.35 | 70.05 | [1221.55, 1497.15] | 19.41 | < .001
Variable predicted: body_mass_g
Predictors contrasted: species
p-value adjustment method: Tukey
Why are the results so different? Why are the p-values exactly the same, but for different comparisons? How can a t-value of 0.40 (Chinstrap vs. Adelie with Tukey adjustment) lead to a p-value of < .001?
packageVersion("modelbased")
[1] ‘0.13.1’
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels