knitr::opts_chunk$set(echo = F, results = "asis")
The trial will be designed to compare $K$ experimental treatments to a shared control arm. Response $X_{ik}$, from patient $i=1,\dots,n_k$ in arm $k=0,\dots,K$, will be assumed to be distributed as $X_{ik} \sim Bern(\pi_k)$. Then, the hypotheses to be tested will be: $$ H_k : \tau_k = \pi_k - \pi_0 \le 0,\ k=1,\dots,K.$$ The global null hypothesis, $H_G$, will be: $$ \pi_0 = \cdots = \pi_K. $$ The global alternative hypothesis, $H_A$, will be: $$ \pi_1 = \cdots = \pi_K = \pi_0 + \delta_1. $$ The least favourable configuration for experimental arm $k$, $LFC_k$, will be: $$ \pi_k = \pi_0 + \delta_1,\ \pi_1 = \cdots = \pi_{k-1} = \pi_{k+1} = \cdots = \pi_K = \pi_0 + \delta_0. $$ Here, $\delta_1$ and $\delta_0$ are interesting and uninteresting treatment effects respectively.
alpha <- params$alpha beta <- params$beta delta0 <- params$delta0 delta1 <- params$delta1 e <- params$e efix <- params$efix f <- params$f ffix <- params$ffix integer <- params$integer J <- params$J K <- params$K lower <- params$lower maxN <- params$maxN n10 <- params$n10 n1 <- params$n1 opchar <- params$opchar pi0 <- params$pi0 plots <- params$plots power <- params$power ratio_type <- params$ratio_type ratio_init <- params$ratio_init ratio <- params$ratio stopping <- params$stopping swss <- params$swss upper <- params$upper
if (power == "marginal") { power_type_text <- "marginal power for each null hypothesis" power_scenario_text <- "each of their respective least favourable configurations" } else { power_scenario_text <- "the global alternative hypothesis" if (power == "conjunctive") { power_type_text <- "conjunctive power" } else if (power == "disjunctive") { power_type_text <- "disjunctive power" } } if (ratio_type == "equal_all") { ratio_text <- "the same as the control arm" } else if (ratio_type == "equal_exp") { ratio_text <- paste0(ratio_init[1], " times that of the control arm") } else { ratio_text <- paste0(round(1/sqrt(K), 3), " times that of the control arm") } if (lower == "fixed") { lower_prelim <- "fixed value" } else if (lower == "obf") { lower_prelim <- "O'Brien-Fleming" } else if (lower == "pocock") { lower_prelim <- "Pocock" } else if (lower == "triangular") { lower_prelim <- "triangular" } if (upper == "fixed") { upper_prelim <- "fixed value" } else if (upper == "obf") { upper_prelim <- "O'Brien-Fleming" } else if (upper == "pocock") { upper_prelim <- "Pocock" } else if (upper == "triangular") { upper_prelim <- "triangular" } if (lower == "fixed") { lower_text <- paste0(lower_prelim, ", with a fixed value of ", ffix) } else { lower_text <- lower_prelim } if (upper == "fixed") { upper_text <- paste0(upper_prelim, ", with a fixed value of ", efix) } else { upper_text <- upper_prelim } if (integer) { integer_text <- "will" } else { integer_text <- "will not" } if (plots) { plot_text <- "will" } else { plot_text <- "will not" }
FWER <- round(opchar$FWERI1[1], 3) if (power == "marginal") { power_type_text <- "minimum marginal power" power_value <- round(min(diag(as.matrix(opchar[-(1:2), (K + 4):(2*K + 3)]))), 3) } else { power_scenario_text <- "the global alternative hypothesis." if (power == "conjunctive") { power_type_text <- "conjunctive power" power_value <- round(opchar$Pcon[2], 3) } else if (power == "disjunctive") { power_type_text <- "disjunctive power" power_value <- round(opchar$Pdis[2], 3) } } if (swss == "fixed") { swss_text <- "is" swss_text2 <- round(n1, 3) } else { swss_text <- "to the control arm is" swss_text2 <- round(n10, 3) }
The following choices were made:
r K
}$ experimental treatments will initially be included in the trial.r J
}$ stages will be allowed in the trial.r stopping
stopping rule will be used.r swss
.r lower_text
.r upper_text
.r alpha
}$ will be used.r power_type_text
will be controlled to level $1-\beta = \boldsymbol{r 1 - beta
}$ under r power_scenario_text
.r pi0
}$.r round(delta1, 3)
}$ and $\delta_0 = \boldsymbol{r round(delta0, 3)
}$ respectively.r ratio_text
.r integer_text
be required to be an integer.r plot_text
be produced.r round(maxN, 3)
}$.r swss_text
: r swss_text2
.r paste(rep(round(ratio, 3), K), collapse = ", ")
)}$.r FWER
}$.r power_type_text
is: $\boldsymbol{r power_value
}$.r paste0("(", paste(round(f, 3), collapse = ", "), ")")
}$.r paste0("(", paste(round(e, 3), collapse = ", "), ")")
}$.library(knitr) kable(round(opchar[, c(1:(K + 1), (2*K + 4):(4*K + 3))]), digits = 3) kable(round(opchar[, 1:(2*K + 3)]), digits = 3) kable(round(opchar[, -((K + 2):(4*K + 3))]), digits = 3)
if (params$plots) { print(params$boundaries) cat("\n \n \n \n \n \n") print(params$equal_error) cat("\n \n \n \n \n \n") print(params$equal_power) cat("\n \n \n \n \n \n") print(params$equal_other) cat("\n \n \n \n \n \n") print(params$equal_sample_size) cat("\n \n \n \n \n \n") print(params$shifted_power) cat("\n \n \n \n \n \n") print(params$shifted_sample_size) cat("\n \n \n \n \n \n") print(params$pmf_N) } else { cat("Not chosen for output: select the box next to 'Plot power curves' to", "add plots to the report.") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.