Learn R Programming

DMAR (version 1.0.0)

ss_power_c_ancova: Sample Size or Power for an Unstandardized Contrast in a One-Way ANCOVA

Description

Determine the necessary per-group sample size to achieve a desired level of statistical power for the test of a single planned (unstandardized) contrast on the adjusted means in a one-way analysis of covariance, or, given a per-group sample size, return the realized statistical power.

Usage

ss_power_c_ancova(
  psi,
  c_weights,
  sigma,
  rho,
  desired_power = 0.85,
  alpha_level = 0.05,
  n = NULL,
  directional = FALSE
)

Value

A data.frame with rows for necessary_n_per_group (or

specified_n_per_group), actual_power, and noncentral_t_parm. The result carries the dmar_ss_power class, so

tidy and glance summarize it in broom convention.

Arguments

psi

The population unstandardized contrast effect on the adjusted means, \(\psi = \sum c_j \mu^{(adj)}_j\)

c_weights

Vector of contrast weights (must sum to zero); use fractional weights so the positive weights sum to 1

sigma

Within-group population standard deviation of the response (the same \(\sigma\) as in a one-way ANOVA on the response)

rho

Within-group population correlation between the response and the covariate; must lie in (-1, 1)

desired_power

Desired statistical power (default 0.85)

alpha_level

Type I error rate (default 0.05)

n

Per-group sample size (assumed balanced); if specified, returns the realized power

directional

Logical: TRUE for a one-sided test (in the same sign as psi), FALSE (default) for a two-sided test

Author

Ken Kelley [email protected]

Details

This function uses the standard large-sample formulation in which the ANCOVA error variance is \(\sigma^2_{adj} = \sigma^2 (1 - \rho^2)\), the contrast t-statistic has degrees of freedom \(N - J - 1\) (one less than the corresponding ANOVA contrast because of the covariate), and the noncentrality parameter is \(\lambda = \psi / (\sigma \sqrt{1 - \rho^2} \sqrt{\sum c_j^2 / n})\). This assumes the covariate means are equal across groups (the typical assumption under random assignment); for designs with substantial group differences in the covariate, the small-sample correction \(1 + (\bar X_{j} - \bar X_{\cdot})^2 / SS^{(within)}_X\) would slightly inflate the standard error and reduce power, an effect that is negligible for moderate or large \(n\).

References

Maxwell, S. E., Delaney, H. D., & Kelley, K. (2027). Designing experiments and analyzing data: A model comparison perspective (4th ed.). Routledge.

Lai, K., & Kelley, K. (2012). Accuracy in parameter estimation for ANCOVA and ANOVA contrasts: Sample size planning via narrow confidence intervals. British Journal of Mathematical and Statistical Psychology, 65, 350--370. tools:::Rd_expr_doi("10.1111/j.2044-8317.2011.02029.x")

See Also

ss_power_c, ci_c_ancova, ss_aipe_c_ancova

design_consequences for what a chosen design delivers: power, the Type S (sign) and Type M (exaggeration) errors of the significance filter, and the expected confidence interval width.

Other sample size for power: power_fisher_exact(), ss_aipe_mixed_effects(), ss_power_R2(), ss_power_R2_sensitivity(), ss_power_c(), ss_power_composite_ancova(), ss_power_composite_ancova_2group(), ss_power_composite_anova(), ss_power_composite_factorial_ancova(), ss_power_composite_factorial_ancova_het(), ss_power_composite_factorial_anova(), ss_power_composite_sem(), ss_power_contrast(), ss_power_equivalence_c(), ss_power_factorial_ancova(), ss_power_factorial_anova(), ss_power_indirect_effect(), ss_power_mixed_effects(), ss_power_one_way_anova(), ss_power_pcm(), ss_power_r(), ss_power_rc(), ss_power_reg_coef(), ss_power_reg_coef_sensitivity(), ss_power_rm_anova(), ss_power_sc(), ss_power_sem(), ss_power_smd(), ss_power_split_plot_anova()

Examples

Run this code
# Same population contrast as in the ANOVA example, with rho = 0.5 between
# outcome and covariate; ANCOVA is more efficient than ANOVA here.
ss_power_c_ancova(psi = 0.5, c_weights = c(0.5, 0.5, -0.5, -0.5),
                  sigma = 1, rho = 0.5, desired_power = 0.80)

# Realized power for n = 30 per group
ss_power_c_ancova(psi = 0.5, c_weights = c(0.5, 0.5, -0.5, -0.5),
                  sigma = 1, rho = 0.5, n = 30)

Run the code above in your browser using DataLab