Title: | Power Analysis for a SMART Design |
---|---|
Description: | A set of tools for determining the necessary sample size in order to identify the optimal dynamic treatment regime in a sequential, multiple assignment, randomized trial (SMART). Utilizes multiple comparisons with the best methodology to adjust for multiple comparisons. Designed for an arbitrary SMART design. Please see Artman (2018) <doi:10.1093/biostatistics/kxy064> for more details. |
Authors: | William Artman [aut, cre] |
Maintainer: | William Artman <[email protected]> |
License: | GPL-3 |
Version: | 1.0.3 |
Built: | 2025-03-13 05:17:27 UTC |
Source: | https://github.com/cran/smartsizer |
Computes the power in an arbitrary SMART design with the goal of identifying optimal embedded dynamic treatment regime (EDTR). The power is the probability of excluding from the set of best EDTRs all EDTRs which are inferior to the best EDTR by min_Delta or more.
computePower(V, Delta, min_Delta, alpha = 0.05, sample_size)
computePower(V, Delta, min_Delta, alpha = 0.05, sample_size)
V |
The covariance matrix of mean EDTR estimators. |
Delta |
The vector of effect sizes with a zero indicating the best EDTR. |
min_Delta |
The minimum desired detectable effect size. |
alpha |
The Type I error rate for not including the true best EDTR. |
sample_size |
The sample size. |
The true best EDTR is included in the set of best with probability at least 1-alpha. Multiple comparisons are adjusted for using the Multiple Comparison with the Best methodology.
The power to exclude from the set of best EDTR all EDTR which are inferior to the best EDTR by min_Delta or more.
V <- rbind(c(1, 0.3, 0.3, 0.3), c(0.3, 1, 0.3, 0.3), c(0.3, 0.3, 1, 0.3), c(0.3, 0.3, 0.3, 1)) #Compute power to exclude EDTRs inferior to the best by 0.3 or more #The first DTR is best and the other three are inferior by 0.2, 0.6, and 0.3 #The best DTR is included with probability greater than or equal to 95%. computePower(V, Delta = c(0, 0.2, 0.6, 0.3), min_Delta = 0.3, sample_size = 200)
V <- rbind(c(1, 0.3, 0.3, 0.3), c(0.3, 1, 0.3, 0.3), c(0.3, 0.3, 1, 0.3), c(0.3, 0.3, 0.3, 1)) #Compute power to exclude EDTRs inferior to the best by 0.3 or more #The first DTR is best and the other three are inferior by 0.2, 0.6, and 0.3 #The best DTR is included with probability greater than or equal to 95%. computePower(V, Delta = c(0, 0.2, 0.6, 0.3), min_Delta = 0.3, sample_size = 200)
Computes the power over a grid of sample size values.
computePowerBySampleSize(V, Delta, min_Delta, alpha = 0.05, sample_size_grid)
computePowerBySampleSize(V, Delta, min_Delta, alpha = 0.05, sample_size_grid)
V |
The covariance matrix of mean EDTR estimators. |
Delta |
The vector of effect sizes with a zero indicating the best EDTR. |
min_Delta |
The minimum desired detectable effect size. |
alpha |
The Type I error rate for not including the true best EDTR. |
sample_size_grid |
The vector of sample sizes |
It employs common random variables
to reduce the variance. See computePower
for more details.
A vector of power for each sample size in the given grid.
V <- rbind(c(1, 0.3, 0.3, 0.3), c(0.3, 1, 0.3, 0.3), c(0.3, 0.3, 1, 0.3), c(0.3, 0.3, 0.3, 1)) computePowerBySampleSize(V, Delta = c(0, 0.2, 0.6, 0.3), min_Delta = 0.3, sample_size_grid = seq(50,300, 50))
V <- rbind(c(1, 0.3, 0.3, 0.3), c(0.3, 1, 0.3, 0.3), c(0.3, 0.3, 1, 0.3), c(0.3, 0.3, 0.3, 1)) computePowerBySampleSize(V, Delta = c(0, 0.2, 0.6, 0.3), min_Delta = 0.3, sample_size_grid = seq(50,300, 50))
Computes the necessary sample size to enroll in an arbitrary SMART design for a specified power with the goal of determining optimal embedded dynamic treatment regime (EDTR). The power is the probability of excluding from the set of best EDTRs all EDTRs inferior to the best by min_Delta or more.
computeSampleSize(V, Delta, min_Delta, alpha = 0.05, desired_power)
computeSampleSize(V, Delta, min_Delta, alpha = 0.05, desired_power)
V |
The covariance matrix of mean EDTR estimators. |
Delta |
The vector of effect sizes with the first zero indicating the best EDTR. |
min_Delta |
The minimum desired detectable effect size. |
alpha |
The Type I error rate for not including the true best EDTR. |
desired_power |
The desired power. |
The true best EDTR is included in the set of best with probability at least 1-alpha. Multiple comparisons are adjusted for using the Multiple Comparison with the Best methodology.
The minimum sample size in order to achieve a power of desired_power to exclude EDTRs from the set of best which are inferior to the optimal EDTR by min_Delta or more.
V <- rbind(c(1, 0.3, 0.3, 0.3), c(0.3, 1, 0.3, 0.3), c(0.3, 0.3, 1, 0.3), c(0.3, 0.3, 0.3, 1)) #Compute sample size to achieve power of 80% to exclude EDTRs inferior #to the best by 0.3 or more. The first DTR is best and the other #three are inferior by 0.2, 0.6, and 0.3 #The best EDTR is included with probability greater than or equal to 95%. computeSampleSize(V, Delta = c(0, 0.2, 0.6, 0.3), min_Delta = 0.3, alpha = 0.05, desired_power = 0.8)
V <- rbind(c(1, 0.3, 0.3, 0.3), c(0.3, 1, 0.3, 0.3), c(0.3, 0.3, 1, 0.3), c(0.3, 0.3, 0.3, 1)) #Compute sample size to achieve power of 80% to exclude EDTRs inferior #to the best by 0.3 or more. The first DTR is best and the other #three are inferior by 0.2, 0.6, and 0.3 #The best EDTR is included with probability greater than or equal to 95%. computeSampleSize(V, Delta = c(0, 0.2, 0.6, 0.3), min_Delta = 0.3, alpha = 0.05, desired_power = 0.8)
Plots the power over a grid of sample sizes.
plotPowerByN(V, Delta, min_Delta, alpha = 0.05, sample_size_grid, color = "black")
plotPowerByN(V, Delta, min_Delta, alpha = 0.05, sample_size_grid, color = "black")
V |
The covariance matrix of mean EDTR estimators. |
Delta |
The vector of effect sizes with a zero indicating the best EDTR. |
min_Delta |
The minimum desired detectable effect size. |
alpha |
The Type I error rate for not including the true best EDTR. |
sample_size_grid |
A vector of sample sizes. |
color |
The color of the graph. |
It employs common random variables
to reduce the variance. See computePower
for more details.
The smartsizer package is designed to assist investigators with sizing sequential, multiple assignment, randomized trial (SMART) for determination of the optimal dynamic treatment regime (DTR). smartsizer includes functions which permit calculation of the minimum number of individuals to enroll in a SMART in order to be able to detect a specified effect size between the best and inferior embedded DTR, with a specified power. smartsizer is designed for an arbitrary SMART design.