getDesignUnorderedMultinom: Power and Sample Size for Unordered Multi-Sample Multinomial...

View source: R/getDesignProportions.R

getDesignUnorderedMultinomR Documentation

Power and Sample Size for Unordered Multi-Sample Multinomial Response

Description

Obtains the power given sample size or obtains the sample size given power for the chi-square test for unordered multi-sample multinomial response.

Usage

getDesignUnorderedMultinom(
  beta = NA_real_,
  n = NA_real_,
  ngroups = NA_integer_,
  ncats = NA_integer_,
  pi = NA_real_,
  allocationRatioPlanned = NA_integer_,
  rounding = TRUE,
  alpha = 0.05
)

Arguments

beta

The type II error.

n

The total sample size.

ngroups

The number of treatment groups.

ncats

The number of categories of the multinomial response.

pi

The matrix of response probabilities for the treatment groups. It should have ngroups rows and ncats-1 or ncats columns.

allocationRatioPlanned

Allocation ratio for the treatment groups.

rounding

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

alpha

The two-sided significance level. Defaults to 0.05.

Value

An S3 class designUnorderedMultinom object with the following components:

  • power: The power to reject the null hypothesis.

  • alpha: The two-sided significance level.

  • n: The maximum number of subjects.

  • ngroups: The number of treatment groups.

  • ncats: The number of categories of the multinomial response.

  • pi: The response probabilities for the treatment groups.

  • effectsize: The effect size for the chi-square test.

  • allocationRatioPlanned: Allocation ratio for the treatment groups.

  • rounding: Whether to round up sample size.

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

Examples


(design1 <- getDesignUnorderedMultinom(
  beta = 0.1, ngroups = 3, ncats = 4,
  pi = matrix(c(0.230, 0.320, 0.272,
                0.358, 0.442, 0.154,
                0.142, 0.036, 0.039),
              3, 3, byrow = TRUE),
  allocationRatioPlanned = c(2, 2, 1),
  alpha = 0.05))


lrstat documentation built on Oct. 18, 2024, 9:06 a.m.