Type: | Package |
Title: | Designing Cluster-Randomized Trials with Two Continuous Co-Primary Outcomes |
Version: | 1.2.1 |
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: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>. |
License: | GPL-3 |
Encoding: | UTF-8 |
URL: | https://github.com/melodyaowen/crt2power |
Depends: | R (≥ 4.3) |
Imports: | devtools (≥ 2.4.5), knitr (≥ 1.43), rootSolve (≥ 1.8.2.3), tidyverse (≥ 2.0.0), tableone (≥ 0.13.2), foreach (≥ 1.5.2), mvtnorm (≥ 1.2), tibble (≥ 3.2.1), dplyr (≥ 1.1.4), tidyr (≥ 1.3.0), stats (≥ 3.6.2) |
RoxygenNote: | 7.3.2 |
Suggests: | testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2025-05-06 19:15:54 UTC; melodyowen |
Author: | Melody Owen [aut, cre] |
Maintainer: | Melody Owen <melody.owen@yale.edu> |
Repository: | CRAN |
Date/Publication: | 2025-05-07 10:30:02 UTC |
Calculate required number of clusters per treatment group for a cluster-randomized trial with co-primary endpoints using a combined outcomes approach.
Description
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.
Usage
calc_K_comb_outcome(
dist = "Chi2",
power,
m,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho1,
rho2,
r = 1
)
Arguments
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. |
Value
A data frame of numerical values.
Examples
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)
Calculate required number of clusters per treatment group for a cluster-randomized trial with co-primary endpoints using the conjunctive intersection-union test approach.
Description
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.
Usage
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
)
Arguments
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. |
Value
A data frame of numerical values.
Examples
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)
Calculate required number of clusters per treatment group for a cluster-randomized trial with co-primary endpoints using a disjunctive 2-DF test approach.
Description
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.
Usage
calc_K_disj_2dftest(
dist = "Chi2",
power,
m,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho1,
rho2,
r = 1
)
Arguments
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. |
Value
A data frame of numerical values.
Examples
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)
Calculate required number of clusters per treatment group for a cluster-randomized trial with co-primary endpoints using three common p-value adjustment methods
Description
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.
Usage
calc_K_pval_adj(
dist = "Chi2",
power,
m,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho2,
r = 1
)
Arguments
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. |
Value
A data frame of numerical values.
Examples
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)
Calculate required number of clusters per treatment group for a cluster-randomized trial with co-primary endpoints using the single 1-DF combined test approach.
Description
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.
Usage
calc_K_single_1dftest(
dist = "Chi2",
power,
m,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho1,
rho2,
r = 1
)
Arguments
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. |
Value
A data frame of numerical values.
Examples
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)
Calculate cluster size for a cluster-randomized trial with co-primary endpoints using a combined outcomes approach.
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 a combined outcomes approach where the two outcome effects are summed together.
Usage
calc_m_comb_outcome(
dist = "Chi2",
power,
K,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho1,
rho2,
r = 1
)
Arguments
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. |
Value
A numerical value.
Examples
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)
Calculate cluster size for a cluster-randomized trial with co-primary endpoints using the conjunctive intersection-union test approach.
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 the conjunctive intersection-union test approach.
Usage
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
)
Arguments
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. |
Value
A numerical value.
Examples
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)
Calculate cluster size for a cluster-randomized trial with co-primary endpoints using a disjunctive 2-DF test approach.
Description
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.
Usage
calc_m_disj_2dftest(
dist = "Chi2",
power,
K,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho1,
rho2,
r = 1
)
Arguments
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. |
Value
A numerical value.
Examples
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)
Calculate cluster size for a cluster-randomized trial with co-primary endpoints using three common p-value adjustment methods
Description
#' @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.
Usage
calc_m_pval_adj(
dist = "Chi2",
power,
K,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho2,
r = 1
)
Arguments
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. |
Value
A data frame of numerical values.
Examples
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)
Calculate cluster size for a cluster-randomized trial with co-primary endpoints using the single 1-DF combined test approach.
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 the single 1-DF combined test approach for clustered data and two outcomes.
Usage
calc_m_single_1dftest(
dist = "Chi2",
power,
K,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho1,
rho2,
r = 1
)
Arguments
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. |
Value
A numerical value.
Examples
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)
Find the non-centrality parameter corresponding to Type I error rate and statistical power
Description
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.
Usage
calc_ncp_chi2(alpha, power, df = 1)
Arguments
alpha |
Type I error rate; numeric. |
power |
Desired statistical power in decimal form; numeric. |
df |
Degrees of freedom; numeric. |
Value
A number.
Examples
calc_ncp_chi2(alpha = 0.05, power = 0.8, df = 1)
Calculate statistical power for a cluster-randomized trial with co-primary endpoints using a combined outcomes approach.
Description
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.
Usage
calc_pwr_comb_outcome(
dist = "Chi2",
K,
m,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho1,
rho2,
r = 1
)
Arguments
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. |
Value
A numerical value.
Examples
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)
Calculate statistical power for a cluster-randomized trial with co-primary endpoints using the conjunctive intersection-union test approach.
Description
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.
Usage
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
)
Arguments
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. |
Value
A numerical value.
Examples
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)
Calculate statistical power for a cluster-randomized trial with co-primary endpoints using a disjunctive 2-DF test approach.
Description
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.
Usage
calc_pwr_disj_2dftest(
dist = "Chi2",
K,
m,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho1,
rho2,
r = 1
)
Arguments
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. |
Value
A numerical value.
Examples
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)
Calculate statistical power for a cluster-randomized trial with co-primary endpoints using three common p-value adjustment methods
Description
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.
Usage
calc_pwr_pval_adj(
dist = "Chi2",
K,
m,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho2,
r = 1
)
Arguments
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. |
Value
A data frame of numerical values.
Examples
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)
Calculate statistical power for a cluster-randomized trial with co-primary endpoints using the single 1-DF combined test approach.
Description
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.
Usage
calc_pwr_single_1dftest(
dist = "Chi2",
K,
m,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho1,
rho2,
r = 1
)
Arguments
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. |
Value
A numerical value.
Examples
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)
Find study design output specifications based on all five CRT co-primary design methods.
Description
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.
Usage
run_crt2_design(
output,
power = NA,
K = NA,
m = NA,
alpha = 0.05,
beta1,
beta2,
varY1,
varY2,
rho01,
rho02,
rho1,
rho2,
r = 1
)
Arguments
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. |
Value
A data frame of numerical values.
Examples
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)