power.multiCA.test {multiCA}R Documentation

Power calculations for the multinomial Cochran-Armitage trend test

Description

Given the probabilities of outcomes, compute the power of the overall multinomial Cochran-Armitage trend test or determine the sample size to obtain a target power.

Usage

power.multiCA.test(N = NULL, power = NULL, pmatrix = NULL, p.ave = NULL,
  p.start = NULL, p.end = NULL, slopes = NULL, scores = 1:G,
  n.prop = rep(1, G), G = length(p.ave), sig.level = 0.05)

Arguments

N

integer, the total sample size of the study. If NULL then power needs to be specified.

power

target power. If NULL then N needs to be specified.

pmatrix

numeric matrix of hypothesized outcome probabilities in each group, with #' the outcomes as rows and ordered groups as columns. The columns should add up to 1.

p.ave

numeric vector of average probability of each outcome over the groups weighted by n.prop.

p.start, p.end

numeric vectors of the probability of each outcome for the first / last ordered group

slopes

numeric vector of the hypothesized slope of each outcome when regressed against the column scores wiht weights n.prop

scores

non-decreasing numeric vector of the same length as the number of ordered groups giving the trend test scores. Defaults to linearly increasing values.

n.prop

numeric vector describing relative sample sizes of the ordered groups. Will be normalized to sum to 1. Defaults to equal sample sizes.

G

integer, number of ordered groups

sig.level

significance level

Details

The distribution of the outcomes can be specified in two ways: either the full matrix of outcome probabilities pmatrix can be specified, or exactly two of the parameters p.ave, slopes, p.start, and p.end must be specified, while

Value

object of class "power.htest"

Examples

power.multiCA.test(power=0.8, p.start=c(0.1,0.2,0.3,0.4), p.end=c(0.4, 0.3, 0.2, 0.1), 
                     G=5, n.prop=c(3,2,1,2,3))

## Power of stroke study with 100 subjects per year and observed trends
data(stroke)
strk.mat <- xtabs(Freq ~ Type + Year, data=stroke)
power.multiCA.test(N=900, pmatrix=prop.table(strk.mat, margin=2))

[Package multiCA version 1.1 Index]