MyNixOS website logo
Description

Designing Cluster-Randomized Trials with Two Co-Primary Outcomes.

Provides methods for powering cluster-randomized trials with two co-primary outcomes using five key design techniques. Includes functions for calculating required sample size and statistical power. For more details on methodology, see Li et al. (2020) <doi:10.1111/biom.13212>, Pocock et al. (1987) <doi:10.2307/2531989>, Vickerstaff et al. (2019) <doi:10.1186/s12874-019-0754-4>, and Yang et al. (2022) <doi:10.1111/biom.13692>.

crt2power

Overview

crt2power is an R package that allows users to calculate the statistical power or sample size of their cluster randomized trials (CRTs) with two co-primary outcomes, given a set of input parameters. The motivation for this package is to aid in the design of hybrid 2 studies. Hybrid 2 studies are studies where there are two co-primary outcomes, namely an implementation outcome (such as fidelity or reach) and a health outcome (such as infection rates, or change from baseline health scores). When powering these studies, cluster correlations and the inflation of the Type I error rate must be accounted for.

The five key study design approaches are included in this package that can be used to power hybrid 2 CRTs.

  1. P-Value Adjustments for Multiple Testing
  2. Combined Outcomes Approach
  3. Single 1-Degree of Freedom (DF) Combined Test for Two Outcomes
  4. Disjunctive 2-DF Test for Two Outcomes
  5. Conjunctive Intersection-Union Test for Two outcomes

For details on the methods listed above, please refer to the publication that discusses these methods, available here. (Add link)

Installation

install.packages("devtools")
require(devtools)
install_github("https://github.com/melodyaowen/crt2power")
require(crt2power)

Required Input Parameters

Table of Key Required Input Parameters:

ParameterStatistical NotationVariable NameDescription
Statistical power$\pi$powerProbability of detecting a true effect under $H_A$
Number of clusters$K$KNumber of clusters in each treatment arm
Cluster size$m$mNumber of individuals in each cluster
Family-wise false positive rate$\alpha$alphaProbability of one or more Type I error(s)
Effect for $Y_1$$\beta_1^*$beta1Estimated intervention effect on the first outcome ($Y_1$)
Effect for $Y_2$$\beta_2^*$beta2Estimated intervention effect on the second outcome ($Y_2$)
Total variance of $Y_1$$\sigma_1^2$varY1Total variance of the first outcome, $Y_1$
Total variance of $Y_2$$\sigma_2^2$varY2Total variance of the second outcome, $Y_2$
Endpoint-specific ICC for $Y_1$$\rho_0^{(1)}$rho01Correlation for $Y_1$ for two different individuals in the same cluster
Endpoint-specific ICC for $Y_2$$\rho_0^{(2)}$rho02Correlation for $Y_2$ for two different individuals in the same cluster
Inter-subject between-endpoint ICC$\rho_1^{(1,2)}$rho1Correlation between $Y_1$ and $Y_2$ for two different individuals in the same cluster
Intra-subject between-endpoint ICC$\rho_2^{(1,2)}$rho2Correlation between $Y_1$ and $Y_2$ for the same individual
Treatment allocation ratio$r$rTreatment allocation ratio; $K_2 = rK_1$ where $K_1$ is number of clusters in experimental group

Function Description

Each method has a set of functions for calculating the statistical power ($\pi$), required number of clusters per treatment group ($K$), or cluster size ($m$) given a set of input parameters. The names of all functions offered in this package are listed below, organized by study design method.

1. P-Value Adjustments for Multiple Testing

  • calc_pwr_pval_adj() calculates power for this method
  • calc_K_pval_adj() calculates number of clusters per treatment group for this method
  • calc_m_pval_adj() calculates cluster size for this method

2. Combined Outcomes Approach

  • calc_pwr_comb_outcome() calculates power for this method
  • calc_K_comb_outcome() calculates number of clusters per treatment group for this method
  • calc_m_comb_outcome() calculates cluster size for this method

3. Single 1-Degree of Freedom (DF) Combined Test for Two Outcomes

  • calc_pwr_single_1dftest() calculates power for this method
  • calc_K_single_1dftest() calculates number of clusters per treatment group for this method
  • calc_m_single_1dftest() calculates cluster size for this method

4. Disjunctive 2-DF Test for Two Outcomes

  • calc_pwr_disj_2dftest() calculates power for this method
  • calc_K_disj_2dftest() calculates number of clusters per treatment group for this method
  • calc_m_disj_2dftest() calculates cluster size for this method

5. Conjunctive Intersection-Union Test for Two outcomes

  • calc_pwr_conj_test() calculates power for this method
  • calc_K_conj_test() calculates number of clusters per treatment group for this method
  • calc_m_conj_test() calculates cluster size for this method

Usage

# Example of using Method 1 for a power calculation
calc_pwr_pval_adj(K = 15, m = 300, alpha = 0.05,
                  beta1 = 0.1, beta2 = 0.1,
                  varY1 = 0.23, varY2 = 0.25,
                  rho01 = 0.025, rho02 = 0.025,
                  rho2  = 0.05, r = 1)

# Example of using Method 3 for number of clusters in treatment group (K) calculation
calc_K_single_1dftest(power = 0.8, m = 300, alpha = 0.05,
                      beta1 = 0.1, beta2 = 0.1,
                      varY1 = 0.23, varY2 = 0.25,
                      rho01 = 0.025, rho02 = 0.025,
                      rho1 = 0.01, rho2  = 0.05, r = 1)

# Example of using Method 5 for cluster size (m) calculation
calc_m_conj_test(power = 0.8, K = 15, alpha = 0.05,
                 beta1 = 0.1, beta2 = 0.1,
                 varY1 = 0.23, varY2 = 0.25,
                 rho01 = 0.025, rho02 = 0.025,
                 rho1 = 0.01, rho2  = 0.05, r = 1)

# Example of calculating power based on all five methods
run_crt2_design(output = "power", K = 15, m = 300, alpha = 0.05,
                beta1 = 0.1, beta2 = 0.1,
                varY1 = 0.23, varY2 = 0.25,
                rho01 = 0.025, rho02 = 0.025,
                rho1 = 0.01, rho2 = 0.05, r = 1)

Contact

For questions or comments, please email Melody Owen at [email protected], or submit an issue to this repository.

Metadata

Version

1.1.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows