View source: R/powMCTInterim.R
| powMCTInterim | R Documentation |
Calculates the predictive or conditional power for a multiple contrast test based on
interim data, e.g. for a futility interim analysis. This function can also be applied
to longitudinal endpoints, where at the time of interim analysis incomplete data is
available. For more details see the vignette on longitudinal data analysis with
MCP-Mod: vignette("Longitudinal Data MCP-Mod", package = "DoseFinding").
powMCTInterim(
contMat,
mu_0t,
S_0t,
S_01,
alpha = 0.025,
type = c("predictive", "conditional"),
mu_assumed = NULL,
alternative = c("one.sided", "two.sided"),
control = mvtnorm.control()
)
contMat |
Contrast matrix to use. The individual contrasts should be saved in the columns of the matrix |
mu_0t |
The first stage estimates |
S_0t |
The covariance matrix for the first stage estimates |
S_01 |
The covariance matrix anticipated for the estimates at study end |
alpha |
Significance level to use |
type |
Whether predictive power (for a flat prior) or conditional power should be calculated. For conditional power mu_assumed needs to be specified. |
mu_assumed |
Mean vector to assume for the second stage (only used when type is
‘conditional’). If |
alternative |
Character determining the alternative for the multiple contrast trend test. |
control |
A list specifying additional control parameters for the ‘pmvnorm’ calls in the code, see also ‘mvtnorm.control’ for details. |
Numeric containing the calculated power values
bornkamp2024DoseFinding
powMCT() MCTtest(), optContr()
# Setup the scenario.
doses <- c(0, 0.5, 1, 2, 4, 8)
mods <- Mods(
emax = c(0.5, 1, 2, 4),
sigEmax = rbind(c(0.5, 3), c(1, 3), c(2, 3), c(4, 3)),
quadratic = -0.1,
doses = doses
)
w <- c(1, 0.5, 0.5, 0.5, 1, 1)
contMat <- optContr(models = mods, w = w)$contMat
sigma <- 0.3
n_final <- round(531 * w / sum(w))
n <- floor(n_final / 2)
S_0t <- diag(sigma^2 / n)
S_01 <- diag(sigma^2 / n_final)
## assumed interim estimate
mu_0t <- 0.05 * doses / (doses + 1) + rnorm(6, 0, 0.382 / sqrt(n))
## assumed mu (needed for conditional power)
mu_assumed <- 0.135 * doses / (doses + 1)
# Calculate predictive and conditional power.
powMCTInterim(
contMat = contMat, S_0t = S_0t, S_01 = S_01, mu_0t = mu_0t,
type = "predictive"
)
powMCTInterim(
contMat = contMat, S_0t = S_0t, S_01 = S_01, mu_0t = mu_0t,
type = "conditional", mu_assumed = mu_assumed
)
powMCTInterim(
contMat = contMat, S_0t = S_0t, S_01 = S_01, mu_0t = mu_0t,
type = "predictive", alternative = "two.sided"
)
powMCTInterim(
contMat = contMat, S_0t = S_0t, S_01 = S_01, mu_0t = mu_0t,
type = "predictive", control = mvtnorm.control(maxpts = 1e5)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.