getDesignOneMultinom: Power and Sample Size for One-Sample Multinomial Response

View source: R/getDesignProportions.R

getDesignOneMultinomR Documentation

Power and Sample Size for One-Sample Multinomial Response

Description

Obtains the power given sample size or obtains the sample size given power for one-sample multinomial response.

Usage

getDesignOneMultinom(
  beta = NA_real_,
  n = NA_real_,
  ncats = NA_integer_,
  piH0 = NA_real_,
  pi = NA_real_,
  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.

piH0

The prevalence of each category under the null hypothesis. Only need to provide the values for the first ncats-1 categories.

pi

The prevalence of each category. Only need to provide the values for the first ncats-1 categories.

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 designOneMultinom 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.

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

  • piH0: The prevalence of each category under the null hypothesis.

  • pi: The prevalence of each category.

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

  • rounding: Whether to round up sample size.

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

Examples


(design1 <- getDesignOneMultinom(
  beta = 0.1, ncats = 3, piH0 = c(0.25, 0.25),
  pi = c(0.3, 0.4), alpha = 0.05))


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