| Title: | Sample Size and Power for an Ordered Categorical Outcome |
|---|---|
| Description: | Sample size and power calculations for a two-group randomized trial with an ordinal outcome analysed by a proportional-odds model. Implements the 'ologit' method of White, Marley-Zagar, Morris, Parmar, Royston & Babiker (2023) <doi:10.1177/1536867X231161934> in R. |
| Authors: | André Moser [cre, aut] |
| Maintainer: | André Moser <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-09-25 14:16:26 UTC |
| Source: | https://github.com/dcr-unibe-ch/artcatr |
Implements the methods of White et al (2023), including their new ologit
method (which allows a non-proportional-odds anticipated effect via pe,
is more accurate for large effects, and supports non-inferiority /
substantial-superiority trials via margin), and Whitehead's (1993)
original method for comparison.
artcatr( pc, cumulative = FALSE, pe = NULL, or = NULL, rr = NULL, margin = 1, favourable = NULL, power = NULL, n = NULL, aratio = c(1, 1), alpha = 0.05, onesided = FALSE, method = c("ologit", "whitehead"), variance = c("NA", "NN", "AA"), quiet = FALSE )artcatr( pc, cumulative = FALSE, pe = NULL, or = NULL, rr = NULL, margin = 1, favourable = NULL, power = NULL, n = NULL, aratio = c(1, 1), alpha = 0.05, onesided = FALSE, method = c("ologit", "whitehead"), variance = c("NA", "NN", "AA"), quiet = FALSE )
pc |
Numeric vector. Anticipated probabilities (or cumulative
probabilities, if |
cumulative |
Logical. Are |
pe |
Numeric vector. Anticipated (cumulative) probabilities in the
experimental arm, specified like |
or |
Numeric scalar. Anticipated common odds ratio applied to the control-arm cumulative probabilities (assumes proportional odds). An odds ratio below 1 shifts probability towards the right-most level. |
rr |
Numeric scalar. Anticipated common risk ratio (applied to every level except the right-most). |
margin |
Numeric scalar odds ratio defining the null hypothesis.
|
favourable |
Logical or |
power |
Numeric scalar in (0, 1). Power to achieve; sample size is
calculated. Default |
n |
Numeric scalar. Total sample size; power is calculated. |
aratio |
Length-2 numeric vector, allocation ratio control:experimental
(e.g. |
alpha |
Numeric scalar significance level. Default |
onesided |
Logical. Is |
method |
One of |
variance |
For |
quiet |
Logical. Suppress the printed summary? |
A list with the computed sample size or power, per-group sample sizes, the anticipated probability table, and other design parameters (mirroring the Stata command's stored results).
White IR, Marley-Zagar E, Morris TP, Parmar MKB, Royston P, Babiker AG (2023). artcat: Sample-size calculation for an ordered categorical outcome. Stata Journal 23(1):3-23. https://doi.org/10.1177/1536867X231161934
Whitehead J (1993). Sample size calculations for ordered categorical data. Statistics in Medicine 12:2257-2271.
# FLU-IVIG trial (Davey et al 2019), reproducing White et al (2023) sec 4: # default (new) ologit method artcatr(pc = c(.018, .036, .156, .141, .39, .259), or = 1 / 1.77, power = .8, favourable = FALSE) # Whitehead method, for comparison artcatr(pc = c(.018, .036, .156, .141, .39, .259), or = 1 / 1.77, power = .8, favourable = FALSE, method = "whitehead") # Non-inferiority trial (margin expressed as an odds ratio) artcatr(pc = c(.010, .021, .099, .103, .384, .383), or = 1, margin = 1.33, power = .8, favourable = FALSE)# FLU-IVIG trial (Davey et al 2019), reproducing White et al (2023) sec 4: # default (new) ologit method artcatr(pc = c(.018, .036, .156, .141, .39, .259), or = 1 / 1.77, power = .8, favourable = FALSE) # Whitehead method, for comparison artcatr(pc = c(.018, .036, .156, .141, .39, .259), or = 1 / 1.77, power = .8, favourable = FALSE, method = "whitehead") # Non-inferiority trial (margin expressed as an odds ratio) artcatr(pc = c(.010, .021, .099, .103, .384, .383), or = 1, margin = 1.33, power = .8, favourable = FALSE)
artcatr objectPrint an artcatr object
## S3 method for class 'artcatr' print(x, digits = 3, probtable = TRUE, ...)## S3 method for class 'artcatr' print(x, digits = 3, probtable = TRUE, ...)
x |
An object returned by artcatr(). |
digits |
Number of significant digits to round probabilities to. |
probtable |
Logical; include the table of anticipated probabilities? |
... |
Not used. |
x, invisibly.
summary.artcatr objectPrint a summary.artcatr object
## S3 method for class 'summary.artcatr' print(x, ...)## S3 method for class 'summary.artcatr' print(x, ...)
x |
An object returned by |
... |
Not used. |
x, invisibly.
artcatr objectTidy summary table of anticipated probabilities from an artcatr object
## S3 method for class 'artcatr' summary(object, digits = 3, ...)## S3 method for class 'artcatr' summary(object, digits = 3, ...)
object |
An object returned by artcatr(). |
digits |
Number of significant digits to round probabilities to. |
... |
Not used. |
A data frame with columns level, description (favourable/
unfavourable labels for the extreme levels), control, experimental,
and (for non-inferiority/substantial-superiority designs) experimental_null.