power.contrast.t: power function for contrasts

Description Usage Arguments Details Value Author(s)

View source: R/functions.R

Description

computes power parameters for t-test associated with a custom contrast

Usage

1
2
3
power.contrast.t(cont = NULL, d = NULL, n = NULL, power = NULL,
  scale = "g", sig.level = 0.05, type = "between",
  alternative = c("two.sided", "one.sided"))

Arguments

cont

contrast codes as a numeric vector

d

effect size d

n

number of observations per cell

power

power of test (1 minus Type II error probability)

scale

used to scale the d index. It can be "g", "z" or a numeric value

sig.level

significance level (Type I error probability)

type

string specifying the type of t test. Can be abbreviated.

alternative

one- or two-sided test. Can be abbreviated

Details

Exactly one of the parameters 'd','n','power' and 'sig.level' must be passed as NULL, and that parameter is determined from the others.

The parameter scale controls the method used to scale the effect size d.

  1. scale="g" assumes scaling by dividing 2*d by the sum of absolute coefficients

  2. scale="z" assumes scaling by dividing d by the square-root of the sum of squares of the contrast weigths

  3. numeric any constant that multiplies the unscaled d to obtain the scaled d

Value

Object of class '"power.htest"', a list of the arguments (including the computed one) augmented with 'method' and 'note' elements.

Author(s)

Marcello Gallucci, mcfanda@gmail.com


mcfanda/cpower documentation built on May 28, 2019, 1 p.m.