Learn R Programming

DMAR (version 1.0.0)

ci_dunnett: Dunnett's Simultaneous Confidence Intervals Against a Control

Description

Computes Dunnett's (1955, 1964) simultaneous confidence intervals for the \(a - 1\) comparisons of \(a - 1\) treatment means against a single control mean, with family-wise coverage at the specified conf_level. Returns the result in tidy long form.

Usage

ci_dunnett(
  x,
  group = NULL,
  control = NULL,
  alternative = c("two_sided", "less", "greater"),
  conf_level = 0.95
)

Value

A data.frame with one row per non-control level. Columns: contrast, mean_difference,

se, t_statistic, lower_limit,

upper_limit, p_adjusted.

Arguments

x

Either (a) a fitted lm or aov object with a one-way factor predictor, or (b) a numeric vector of observations, in which case group must also be supplied.

group

When x is a vector, a factor of group labels of the same length.

control

Character name of the control level (must be one of the factor levels). If NULL (default), the first level is used.

alternative

One of "two_sided" (default; the base-R spelling "two.sided" is accepted as an alias), "less", or "greater".

conf_level

Family-wise confidence level. Default 0.95.

Author

Ken Kelley [email protected]

Details

Critical value. The two-sided Dunnett critical value \(d_{\alpha, a - 1, \nu}^{(2)}\) is obtained from the multivariate t distribution with \(a - 1\) dimensions, common correlation \(0.5\) (the Dunnett correlation under balanced n; the function does not adjust for unequal n), and \(\nu\) error degrees of freedom. The function uses the existing cv_dunnett() critical value.

Adjusted p-values. Computed exactly from the same equicorrelated multivariate t distribution. The one common correlation \(1/2\) admits a one-factor representation, so the probability that all comparisons fall inside (or below) the observed statistic collapses to two nested one-dimensional integrals, evaluated by quadrature. The adjusted p-value is one minus that probability. The computation is deterministic (no Monte Carlo) and needs no additional package.

References

Dunnett, C. W. (1955). A multiple comparison procedure for comparing several treatments with a control. Journal of the American Statistical Association, 50(272), 1096--1121.

Dunnett, C. W. (1964). New tables for multiple comparisons with a control. Biometrics, 20(3), 482--491.

Hsu, J. C. (1996). Multiple comparisons: Theory and methods. Chapman & Hall.

See Also

cv_dunnett, ci_tukey_kramer, ci_scheffe

Other hypothesis tests: adjusted_means(), ancova(), anova_within(), ci_scheffe(), ci_tukey_kramer(), compare_cov_structures(), contrast_test(), correlations_test(), equivalence_r(), equivalence_smd(), factorial_anova(), manova_split_plot(), mauchly_test(), mixed_anova(), obrien_test(), pairwise_within(), randomization_test(), randomization_test_paired(), regions_of_significance(), simple_effects_AB(), summary_t_test(), welch_t()

Examples

Run this code
# 1. Compare the SSRI and placebo arms of the depression_bdi study
#    against the wait list control:
fit <- lm(bdi_post ~ condition, data = depression_bdi)
ci_dunnett(fit, control = "wait_list")

# 2. One-sided: a treatment that works pulls the posttest BDI down,
#    so the directional alternative is "less":
ci_dunnett(fit, control = "wait_list", alternative = "less")

Run the code above in your browser using DataLab