Easily compute planned contrast analyses (pairwise comparisons similar to t-tests but more powerful when more than 2 groups), and format in publication-ready format. In this particular case, the confidence intervals are bootstraped on chosen effect size (default to Cohen's d).
nice_contrasts(
response,
group,
covariates = NULL,
data,
effect.type = "cohens.d",
bootstraps = 2000,
...
)
A dataframe, with the selected dependent variable(s), comparisons of interest, degrees of freedom, t-values, p-values, Cohen's d, and the lower and upper 95% confidence intervals of the effect size (i.e., dR).
The dependent variable.
The group for the comparison.
The desired covariates in the model.
The data frame.
What effect size type to use. One of "cohens.d" (default), "akp.robust.d", "unstandardized", "hedges.g", "cohens.d.sigma", or "r".
The number of bootstraps to use for the confidence interval
Arguments passed to bootES::bootES.
Statistical power is lower with the standard t test compared than it is with the planned contrast version for two reasons: a) the sample size is smaller with the t test, because only the cases in the two groups are selected; and b) in the planned contrast the error term is smaller than it is with the standard t test because it is based on all the cases (source).
The effect size and confidence interval are calculated via
bootES::bootES, and correct for contrasts but not for covariates and
other predictors. Because this method uses bootstrapping, it is recommended
to set a seed before using for reproducibility reasons (e.g.,
sed.seet(100)
).
Does not for the moment support nested comparisons for marginal means,
only a comparison of all groups. For nested comparisons, please use
emmeans::contrast()
directly, or for the easystats equivalent,
modelbased::estimate_contrasts()
.
When using nice_lm_contrasts()
, please use as.factor()
outside the
lm()
formula, or it will lead to an error.
nice_lm_contrasts
,
Tutorial: https://rempsyc.remi-theriault.com/articles/contrasts