Learn R Programming

DMAR (version 1.0.0)

ci_scheffe: Scheffe-Adjusted Simultaneous Confidence Intervals for Contrasts

Description

Computes the Scheffe (1953, 1959) simultaneous confidence intervals on user-specified contrasts among the means of a one-way design. The Scheffe procedure controls the family-wise error rate for any set of contrasts, however many and however post-hoc, which makes it more conservative than Tukey-Kramer or Bonferroni for the specific case of all-pairwise comparisons but optimal for arbitrary post-hoc contrasts.

Usage

ci_scheffe(x, group = NULL, contrasts = NULL, conf_level = 0.95)

Value

A data.frame with one row per contrast. Columns: contrast (a printed label),

contrast_value, se, F_statistic,

lower_limit, upper_limit, p_adjusted.

Arguments

x

A fitted lm or aov object with a single one-way factor predictor, or a numeric vector of observations with group supplied.

group

Optional factor of group labels when x is a numeric vector.

contrasts

An \(a \times m\) matrix or vector of contrast coefficients (rows = levels, columns = contrasts). Each column must sum to zero. If NULL (default), the function returns intervals for all \(a (a - 1) / 2\) pairwise contrasts.

conf_level

Family-wise confidence level. Default 0.95.

Author

Ken Kelley [email protected]

Details

Critical value. For \(a\) groups with \(\nu\) error degrees of freedom, the Scheffe critical value is $$S \;=\; \sqrt{(a - 1) F_{1 - \alpha, a - 1, \nu}},$$ where \(F_{1 - \alpha, a - 1, \nu}\) is the upper \(\alpha\) quantile of the central F distribution. The Scheffe simultaneous CI on a contrast \(\psi = \sum_i c_i \mu_i\) is $$\hat\psi \;\pm\; S \cdot \mathit{SE}(\hat\psi),$$ where \(\mathit{SE}(\hat\psi) = \sqrt{\mathit{MS}_E \sum_i c_i^2 / n_i}\).

Scope. The Scheffe family-wise coverage holds for any number of contrasts, pairwise, complex, or chosen after looking at the data. The trade-off is conservativeness: for all-pairwise comparisons, Tukey-Kramer is uniformly more powerful.

References

Scheffe, H. (1953). A method for judging all contrasts in the analysis of variance. Biometrika, 40(1/2), 87--104.

Scheffe, H. (1959). The analysis of variance. Wiley.

See Also

cv_scheffe, ci_tukey_kramer, ci_dunnett

Other hypothesis tests: adjusted_means(), ancova(), anova_within(), ci_dunnett(), 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. All pairwise contrasts among the six marketing panels of the
#    test_market data via the default:
fit <- lm(brand_movement ~ panel, data = test_market)
ci_scheffe(fit)

# 2. A contrast chosen after inspecting the means: the two panels with
#    the highest brand movement (5 and 6) against the two with the
#    lowest (1 and 2). The Scheffe coverage holds for a contrast picked
#    this way, and the interval still excludes zero even though none of
#    the pairwise intervals above does.
cmat <- matrix(c(-0.5, -0.5, 0, 0, 0.5, 0.5), nrow = 6,
               dimnames = list(levels(test_market$panel),
                               "panels 5,6 - panels 1,2"))
ci_scheffe(fit, contrasts = cmat)

Run the code above in your browser using DataLab