getDesignTwoMultinom {lrstat}R Documentation

Power and Sample Size for Difference in Two-Sample Multinomial Responses

Description

Obtains the power given sample size or obtains the sample size given power for difference in two-sample multinomial responses.

Usage

getDesignTwoMultinom(
  beta = NA_real_,
  n = NA_real_,
  ncats = NA_integer_,
  pi1 = NA_real_,
  pi2 = NA_real_,
  allocationRatioPlanned = 1,
  rounding = TRUE,
  alpha = 0.05
)

Arguments

beta

The type II error.

n

The total sample size.

ncats

The number of categories of the multinomial response.

pi1

The prevalence of each category for the treatment group. Only need to specify the valued for the first ncats-1 categories.

pi2

The prevalence of each category for the control group. Only need to specify the valued for the first ncats-1 categories.

allocationRatioPlanned

Allocation ratio for the active treatment versus control. Defaults to 1 for equal randomization.

rounding

Whether to round up sample size. Defaults to 1 for sample size rounding.

alpha

The two-sided significance level. Defaults to 0.05.

Details

A two-arm multinomial response design is used to test whether the prevalence of each category differs between two treatment arms. Let \pi_{gi} denote the prevalence of category i in group g, where g=1 for the treatment group and g=2 for the control group. The chi-square test statistic is given by

X^2 = \sum_{g=1}^{2} \sum_{i=1}^{C} \frac{(n_{gi} - n_{g+} n_{+i}/n)^2}{n_{g+} n_{+i}/n}

where n_{gi} is the number of subjects in category i for group g, n_{g+} is the total number of subjects in group g, and n_{+i} is the total number of subjects in category i across both groups, and n is the total sample size.

The sample size is chosen such that the power to reject the null hypothesis is at least 1-\beta for a given significance level \alpha.

Value

An S3 class designTwoMultinom object with the following components:

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

Examples


(design1 <- getDesignTwoMultinom(
  beta = 0.1, ncats = 3, pi1 = c(0.3, 0.35),
  pi2 = c(0.2, 0.3), alpha = 0.05))


[Package lrstat version 0.2.15 Index]