Title: | Designing Cluster-Randomized Trials with Two Continuous Co-Primary Outcomes |
---|---|
Description: | Provides methods for powering cluster-randomized trials with two continuous co-primary outcomes using five key design techniques. Includes functions for calculating required sample size and statistical power. For more details on methodology, see Owen et al. (2025) <doi.org/10.1002/sim.70015>, Yang et al. (2022) <doi:10.1111/biom.13692>, Pocock et al. (1987) <doi:10.2307/2531989>, Vickerstaff et al. (2019) <doi:10.1186/s12874-019-0754-4>, and Li et al. (2020) <doi:10.1111/biom.13212>. |
Authors: | Melody Owen [aut, cre] |
Maintainer: | Melody Owen <[email protected]> |
License: | GPL-3 |
Version: | 1.2.0 |
Built: | 2025-03-12 20:40:10 UTC |
Source: | https://github.com/melodyaowen/crt2power |
Allows user to calculate the number of clusters per treatment arm of a cluster-randomized trial with two co-primary outcomes given a set of study design input values, including the number of clusters in each trial arm, and cluster size. Uses a combined outcomes approach where the two outcome effects are summed together.
calc_K_comb_outcome( dist = "Chi2", power, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
calc_K_comb_outcome( dist = "Chi2", power, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
power |
Desired statistical power in decimal form; numeric. |
m |
Individuals per cluster; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A data frame of numerical values.
calc_K_comb_outcome(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)
calc_K_comb_outcome(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)
Allows user to calculate the required number of clusters per treatment group of a cluster-randomized trial with two co-primary outcomes given a set of study design input values, including the statistical power, and cluster size. Uses the conjunctive intersection-union test approach.Code is adapted from "calSampleSize_ttestIU()" from https://github.com/siyunyang/coprimary_CRT written by Siyun Yang.
calc_K_conj_test( dist = "T", power, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1, cv = 0, deltas = c(0, 0), two_sided = FALSE )
calc_K_conj_test( dist = "T", power, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1, cv = 0, deltas = c(0, 0), two_sided = FALSE )
dist |
Specification of which distribution to base calculation on, either 'T' for T-Distribution or 'MVN' for Multivariate Normal Distribution. Default is T-Distribution. |
power |
Desired statistical power in decimal form; numeric. |
m |
Individuals per cluster; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
cv |
Cluster variation parameter, set to 0 if assuming all cluster sizes are equal; numeric. |
deltas |
Vector of non-inferiority margins, set to delta_1 = delta_2 = 0; numeric vector. |
two_sided |
Specification of whether to conduct two 2-sided tests, 'TRUE', or two 1-sided tests, 'FALSE', default is FALSE; boolean. |
A data frame of numerical values.
calc_K_conj_test(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)
calc_K_conj_test(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)
Allows user to calculate the number of clusters per treatment arm of a cluster-randomized trial with two co-primary outcomes given a set of study design input values, including the statistical power, and cluster size. Uses the disjunctive 2-DF test approach. Code is adapted from "calSampleSize_omnibus()" from https://github.com/siyunyang/coprimary_CRT.
calc_K_disj_2dftest( dist = "Chi2", power, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
calc_K_disj_2dftest( dist = "Chi2", power, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
power |
Desired statistical power in decimal form; numeric. |
m |
Individuals per cluster; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A data frame of numerical values.
calc_K_disj_2dftest(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)
calc_K_disj_2dftest(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)
Allows user to calculate the number of clusters per treatment arm of a cluster-randomized trial with two co-primary endpoints given a set of study design input values, including the statistical power, and cluster size. Uses three common p-value adjustment methods.
calc_K_pval_adj( dist = "Chi2", power, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho2, r = 1 )
calc_K_pval_adj( dist = "Chi2", power, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
power |
Desired statistical power in decimal form; numeric. |
m |
Individuals per cluster; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A data frame of numerical values.
calc_K_pval_adj(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, rho2 = 0.05)
calc_K_pval_adj(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, rho2 = 0.05)
Allows user to calculate the number of clusters per treatment arm of a cluster-randomized trial with two co-primary endpoints given a set of study design input values, including the statistical power, and cluster size. Uses the single 1-DF combined test approach for clustered data and two outcomes.
calc_K_single_1dftest( dist = "Chi2", power, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
calc_K_single_1dftest( dist = "Chi2", power, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
power |
Desired statistical power in decimal form; numeric. |
m |
Individuals per cluster; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A data frame of numerical values.
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)
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)
Allows user to calculate the cluster size of a cluster-randomized trial with two co-primary endpoints given a set of study design input values, including the number of clusters in each trial arm, and statistical power. Uses a combined outcomes approach where the two outcome effects are summed together.
calc_m_comb_outcome( dist = "Chi2", power, K, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
calc_m_comb_outcome( dist = "Chi2", power, K, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
power |
Desired statistical power in decimal form; numeric. |
K |
Number of clusters in treatment arm, and control arm under equal allocation; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A numerical value.
calc_m_comb_outcome(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)
calc_m_comb_outcome(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)
Allows user to calculate the cluster size of a cluster-randomized trial with two co-primary endpoints given a set of study design input values, including the number of clusters in each trial arm, and statistical power. Uses the conjunctive intersection-union test approach.
calc_m_conj_test( dist = "T", power, K, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1, cv = 0, deltas = c(0, 0), two_sided = FALSE )
calc_m_conj_test( dist = "T", power, K, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1, cv = 0, deltas = c(0, 0), two_sided = FALSE )
dist |
Specification of which distribution to base calculation on, either 'T' for T-Distribution or 'MVN' for Multivariate Normal Distribution. Default is T-Distribution. |
power |
Desired statistical power in decimal form; numeric. |
K |
Number of clusters in treatment arm, and control arm under equal allocation; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
cv |
Cluster variation parameter, set to 0 if assuming all cluster sizes are equal; numeric. |
deltas |
Vector of non-inferiority margins, set to delta_1 = delta_2 = 0; numeric vector. |
two_sided |
Specification of whether to conduct two 2-sided tests, 'TRUE', or two 1-sided tests, 'FALSE', default is FALSE; boolean. |
A numerical value.
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)
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)
Allows user to calculate the cluster size of a cluster-randomized trial with two co-primary outcomes given a set of study design input values, including the number of clusters in each trial arm, and statistical power. Uses the disjunctive 2-DF test approach.
calc_m_disj_2dftest( dist = "Chi2", power, K, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
calc_m_disj_2dftest( dist = "Chi2", power, K, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
power |
Desired statistical power in decimal form; numeric. |
K |
Number of clusters in treatment arm, and control arm under equal allocation; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A numerical value.
calc_m_disj_2dftest(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)
calc_m_disj_2dftest(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)
#' @description Allows user to calculate the cluster size of a cluster-randomized trial with two co-primary endpoints given a set of study design input values, including the number of clusters in each trial arm, and statistical power. Uses three common p-value adjustment methods.
calc_m_pval_adj( dist = "Chi2", power, K, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho2, r = 1 )
calc_m_pval_adj( dist = "Chi2", power, K, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
power |
Desired statistical power in decimal form; numeric. |
K |
Number of clusters in treatment arm, and control arm under equal allocation; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A data frame of numerical values.
calc_m_pval_adj(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, rho2 = 0.05)
calc_m_pval_adj(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, rho2 = 0.05)
Allows user to calculate the cluster size of a cluster-randomized trial with two co-primary endpoints given a set of study design input values, including the number of clusters in each trial arm, and statistical power. Uses the single 1-DF combined test approach for clustered data and two outcomes.
calc_m_single_1dftest( dist = "Chi2", power, K, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
calc_m_single_1dftest( dist = "Chi2", power, K, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
power |
Desired statistical power in decimal form; numeric. |
K |
Number of clusters in treatment arm, and control arm under equal allocation; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A numerical value.
calc_m_single_1dftest(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)
calc_m_single_1dftest(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)
Allows user to find the corresponding non-centrality parameter for power analysis based on the Type I error rate, statistical power, and degrees of freedom.
calc_ncp_chi2(alpha, power, df = 1)
calc_ncp_chi2(alpha, power, df = 1)
alpha |
Type I error rate; numeric. |
power |
Desired statistical power in decimal form; numeric. |
df |
Degrees of freedom; numeric. |
A number.
calc_ncp_chi2(alpha = 0.05, power = 0.8, df = 1)
calc_ncp_chi2(alpha = 0.05, power = 0.8, df = 1)
Allows user to calculate the statistical power of a cluster-randomized trial with two co-primary outcomes given a set of study design input values, including the number of clusters in each trial arm, and cluster size. Uses a combined outcomes approach where the two outcome effects are summed together.
calc_pwr_comb_outcome( dist = "Chi2", K, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
calc_pwr_comb_outcome( dist = "Chi2", K, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
K |
Number of clusters in treatment arm, and control arm under equal allocation; numeric. |
m |
Individuals per cluster; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A numerical value.
calc_pwr_comb_outcome(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)
calc_pwr_comb_outcome(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)
Allows user to calculate the statistical power of a cluster-randomized trial with two co-primary outcomes given a set of study design input values, including the number of clusters in each trial arm, and cluster size. Uses the conjunctive intersection-union test approach. Code is adapted from "calPower_ttestIU()" from https://github.com/siyunyang/coprimary_CRT written by Siyun Yang.
calc_pwr_conj_test( dist = "T", K, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1, cv = 0, deltas = c(0, 0), two_sided = FALSE )
calc_pwr_conj_test( dist = "T", K, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1, cv = 0, deltas = c(0, 0), two_sided = FALSE )
dist |
Specification of which distribution to base calculation on, either 'T' for T-Distribution or 'MVN' for Multivariate Normal Distribution. Default is T-Distribution. |
K |
Number of clusters in treatment arm, and control arm under equal allocation; numeric. |
m |
Individuals per cluster; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
cv |
Cluster variation parameter, set to 0 if assuming all cluster sizes are equal; numeric. |
deltas |
Vector of non-inferiority margins, set to delta_1 = delta_2 = 0; numeric vector. |
two_sided |
Specification of whether to conduct two 2-sided tests, 'TRUE', or two 1-sided tests, 'FALSE', default is FALSE; boolean. |
A numerical value.
calc_pwr_conj_test(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)
calc_pwr_conj_test(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)
Allows user to calculate the statistical power of a cluster-randomized trial with two co-primary outcomes given a set of study design input values, including the number of clusters in each trial arm, and cluster size. Uses the disjunctive 2-DF test approach. Code is adapted from "calPower_omnibus()" from https://github.com/siyunyang/coprimary_CRT written by Siyun Yang.
calc_pwr_disj_2dftest( dist = "Chi2", K, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
calc_pwr_disj_2dftest( dist = "Chi2", K, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
K |
Number of clusters in treatment arm, and control arm under equal allocation; numeric. |
m |
Individuals per cluster; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A numerical value.
calc_pwr_disj_2dftest(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)
calc_pwr_disj_2dftest(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)
Allows user to calculate the statistical power of a cluster-randomized trial with two co-primary endpoints given a set of study design input values, including the number of clusters in each trial arm, and cluster size. Uses three common p-value adjustment methods.
calc_pwr_pval_adj( dist = "Chi2", K, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho2, r = 1 )
calc_pwr_pval_adj( dist = "Chi2", K, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
K |
Number of clusters in treatment arm, and control arm under equal allocation; numeric. |
m |
Individuals per cluster; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A data frame of numerical values.
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)
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)
Allows user to calculate the statistical power of a cluster-randomized trial with two co-primary endpoints given a set of study design input values, including the number of clusters in each trial arm, and cluster size. Uses the single 1-DF combined test approach for clustered data and two outcomes.
calc_pwr_single_1dftest( dist = "Chi2", K, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
calc_pwr_single_1dftest( dist = "Chi2", K, m, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
dist |
Specification of which distribution to base calculation on, either 'Chi2' for Chi-Squared or 'F' for F-Distribution. |
K |
Number of clusters in treatment arm, and control arm under equal allocation; numeric. |
m |
Individuals per cluster; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A numerical value.
calc_pwr_single_1dftest(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)
calc_pwr_single_1dftest(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)
Allows user to calculate either statistical power, number of clusters per treatment group (K), or cluster size (m), given a set of input values for all five study design approaches.
run_crt2_design( output, power = NA, K = NA, m = NA, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
run_crt2_design( output, power = NA, K = NA, m = NA, alpha = 0.05, beta1, beta2, varY1, varY2, rho01, rho02, rho1, rho2, r = 1 )
output |
Parameter to calculate, either "power", "K", or "m"; character. |
power |
Desired statistical power; numeric. |
K |
Number of clusters in each arm; numeric. |
m |
Individuals per cluster; numeric. |
alpha |
Type I error rate; numeric. |
beta1 |
Effect size for the first outcome; numeric. |
beta2 |
Effect size for the second outcome; numeric. |
varY1 |
Total variance for the first outcome; numeric. |
varY2 |
Total variance for the second outcome; numeric. |
rho01 |
Correlation of the first outcome for two different individuals in the same cluster; numeric. |
rho02 |
Correlation of the second outcome for two different individuals in the same cluster; numeric. |
rho1 |
Correlation between the first and second outcomes for two individuals in the same cluster; numeric. |
rho2 |
Correlation between the first and second outcomes for the same individual; numeric. |
r |
Treatment allocation ratio - K2 = rK1 where K1 is number of clusters in experimental group; numeric. |
A data frame of numerical values.
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)
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)