getDesignTwoOrdinal: Power and Sample Size for the Wilcoxon Test for Two-Sample...

View source: R/getDesignProportions.R

getDesignTwoOrdinalR Documentation

Power and Sample Size for the Wilcoxon Test for Two-Sample Ordinal Response

Description

Obtains the power given sample size or obtains the sample size given power for the Wilcoxon test for two-sample ordinal response.

Usage

getDesignTwoOrdinal(
  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 ordinal 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 significance level. Defaults to 0.025.

Value

An S3 class designTwoOrdinal 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 ordinal response.

  • pi1: The prevalence of each category for the treatment group.

  • pi2: The prevalence of each category for the control group.

  • meanscore1: The mean midrank score for the treatment group.

  • meanscore2: The mean midrank score for the control group.

  • allocationRatioPlanned: Allocation ratio for the active treatment versus control.

  • rounding: Whether to round up sample size.

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

Examples


(design1 <- getDesignTwoOrdinal(
  beta = 0.1, ncats = 4, pi1 = c(0.55, 0.3, 0.1),
  pi2 = c(0.214, 0.344, 0.251), alpha = 0.025))


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