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.
- P-Value Adjustments for Multiple Testing
- Combined Outcomes Approach
- Single 1-Degree of Freedom (DF) Combined Test for Two Outcomes
- Disjunctive 2-DF Test for Two Outcomes
- 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)
install.packages("devtools")
require(devtools)
install_github("https://github.com/melodyaowen/crt2power")
require(crt2power)
Table of Key Required Input Parameters:
Parameter | Statistical Notation | Variable Name | Description |
---|---|---|---|
Statistical power | power |
Probability of detecting a true effect under |
|
Number of clusters | K |
Number of clusters in each treatment arm | |
Cluster size | m |
Number of individuals in each cluster | |
Family-wise false positive rate | alpha |
Probability of one or more Type I error(s) | |
Effect for |
beta1 |
Estimated intervention effect on the first outcome ( |
|
Effect for |
beta2 |
Estimated intervention effect on the second outcome ( |
|
Total variance of |
varY1 |
Total variance of the first outcome, |
|
Total variance of |
varY2 |
Total variance of the second outcome, |
|
Endpoint-specific ICC for |
rho01 |
Correlation for |
|
Endpoint-specific ICC for |
rho02 |
Correlation for |
|
Inter-subject between-endpoint ICC | rho1 |
Correlation between |
|
Intra-subject between-endpoint ICC | rho2 |
Correlation between |
|
Treatment allocation ratio | r |
Treatment allocation ratio; |
Each method has a set of functions for calculating the statistical power (
calc_pwr_pval_adj()
calculates power for this methodcalc_K_pval_adj()
calculates number of clusters per treatment group for this methodcalc_m_pval_adj()
calculates cluster size for this method
calc_pwr_comb_outcome()
calculates power for this methodcalc_K_comb_outcome()
calculates number of clusters per treatment group for this methodcalc_m_comb_outcome()
calculates cluster size for this method
calc_pwr_single_1dftest()
calculates power for this methodcalc_K_single_1dftest()
calculates number of clusters per treatment group for this methodcalc_m_single_1dftest()
calculates cluster size for this method
calc_pwr_disj_2dftest()
calculates power for this methodcalc_K_disj_2dftest()
calculates number of clusters per treatment group for this methodcalc_m_disj_2dftest()
calculates cluster size for this method
calc_pwr_conj_test()
calculates power for this methodcalc_K_conj_test()
calculates number of clusters per treatment group for this methodcalc_m_conj_test()
calculates cluster size for this method
# 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)
For questions or comments, please email Melody Owen at melody.owen@yale.edu, or submit an issue to this repository.