anova1way.c.unbal: Power calculation for one-way unbalanced analysis of variance...

anova1way.c.unbalR Documentation

Power calculation for one-way unbalanced analysis of variance contrast test

Description

Calculates power for a test of a contrast in a one-way ANOVA with unbalanced data (that is, unequal sized groups). This function only solves for power. For a one-way balanced ANOVA, (equal group sizes), anova1way.c.bal can also be used, and will solve for quantities other than power.

Usage

anova1way.c.unbal(
  nvec = NULL,
  mvec = NULL,
  cvec = NULL,
  sd = NULL,
  Rsq = 0,
  ncov = 0,
  alpha = 0.05,
  v = FALSE
)

Arguments

nvec

A vector of group sample sizes c(n1, n2, ...).

mvec

A vector of group mvec c(mu1, mu2, ...).

cvec

A vector of contrast coefficients c(c1, c2, ...).

sd

The estimated standard deviation within each group.

Rsq

The estimated R^2 for regressing the outcome on the covariates; defaults to 0.

ncov

The number of covariates adjusted for in the model; defaults to 0.

alpha

The significance level (type 1 error rate); defaults to 0.05.

v

Either TRUE for verbose output or FALSE (default) to output computed argument only.

Value

A list of the arguments (including the computed power).

Examples

anova1way.c.unbal(nvec = c(20, 20, 20), mvec = c(5, 10, 12), cvec = c(1, -1, 0),
sd = 10, alpha = 0.025)
anova1way.c.unbal(nvec = c(20, 20, 20), mvec = c(5, 10, 12), cvec = c(1, 0, -1),
sd = 10, alpha = 0.025)

powertools documentation built on April 4, 2025, 5:02 a.m.