ANCOVA_analytic: Power Calculations for Factorial ANCOVAs

View source: R/ANCOVA_analytic.R

ANCOVA_analyticR Documentation

Power Calculations for Factorial ANCOVAs

Description

Complete power analyses for ANCOVA omnibus tests and contrasts. This function does not support within subjects factors.

Usage

ANCOVA_analytic(
  design,
  mu,
  n = NULL,
  sd,
  r2 = NULL,
  n_cov,
  alpha_level = Superpower_options("alpha_level"),
  beta_level = NULL,
  cmats = list(),
  label_list = NULL,
  design_result = NULL,
  round_up = TRUE
)

Arguments

design

Output from the ANOVA_design function

mu

Vector specifying mean for each condition

n

Sample size in each condition

sd

Standard deviation for all conditions (or a vector specifying the sd for each condition)

r2

Coefficient of Determination of the model with only the covariates

n_cov

Number of covariates

alpha_level

Alpha level used to determine statistical significance

beta_level

Type II error probability (power/100-1)

cmats

List of matrices for specific contrasts of interest

label_list

An optional list to specify the factor names and condition (recommended, if not used factors and levels are indicated by letters and numbers).

design_result

Output from the ANOVA_design function

round_up

Logical indicator (default = TRUE) for whether to round up sample size calculations to nearest whole number

Value

One, or two, data frames containing the power analysis results from the power analysis for the omnibus ANCOVA (main_results) or contrast tests (contrast_results). In addition, every F-test (aov_list and con_list) is included in a list of power.htest results. Lastly, a (design_param) list containing the design parameters is also included in the results.

References

Shieh, G. (2020). Power analysis and sample size planning in ANCOVA designs. Psychometrika, 85(1), 101-120.

Examples

# Simple 2x3 ANCOVA

ANCOVA_analytic(
design = "2b*3b",
mu = c(400, 450, 500,
      400, 500, 600),
n_cov = 3,
sd = 100,
r2 = .25,
alpha_level = .05,
beta_level = .2,
round_up = TRUE
)

Superpower documentation built on May 17, 2022, 5:08 p.m.