Title: | Using Historical Controls for Designing Phase II Clinical Trials |
---|---|
Description: | Provides functions for designing phase II clinical trials adjusting for the heterogeneity of the population using known subgroups or historical controls. |
Authors: | Dominic Edelmann [aut, cre] |
Maintainer: | Dominic Edelmann <[email protected]> |
License: | GPL-2 | GPL-3 |
Version: | 0.1.0 |
Built: | 2024-11-05 03:11:10 UTC |
Source: | https://github.com/edelmand21/hctrial |
The hctrial package provides functions for designing phase 2 clinical trials that adjust for the heterogeneity in the population.
Two different ways are considered for designing a trial: based on known subgroups or based on historical data.
For initializing a stratified trial, use strat_start
.
At interim, strat_interim
should be used to adjust the trial.
At the end of the study, strat_end
is used to adjust the trial again.
hist_start
, hist_interim
and hist_end
work analogously, but are based on historical controls.
Adjust a design based on historical controls at the end of the study using the covariate data of the patients accrued in stage 2.
hist_end(interim, stagetwo_data)
hist_end(interim, stagetwo_data)
interim |
An design based on historical controls and adjusted at interim as returned by |
stagetwo_data |
A dataframe containing the relevant covariate data of the patients accrued in stage 2. |
A list returning the arguments of the function and the final design of the trial.
X <- abs(rnorm(1000, 0, 1)) Y <- rbinom(1000, 1, 1-exp(-X)) mydata <- data.frame("X" = X, "Y" = Y) start <- hist_start(mydata, Y~X, c1 = 2) n1 <- start$des_start[2] X1 <- abs(rnorm(n1, 0, 1)) dataone <- data.frame("X" = X1) interim <- hist_interim(start, dataone) n2 <- interim$des_interim[4] X2 <- abs(rnorm(n2, 0, 1)) datatwo <- data.frame("X" = X2) hist_end(interim, datatwo)
X <- abs(rnorm(1000, 0, 1)) Y <- rbinom(1000, 1, 1-exp(-X)) mydata <- data.frame("X" = X, "Y" = Y) start <- hist_start(mydata, Y~X, c1 = 2) n1 <- start$des_start[2] X1 <- abs(rnorm(n1, 0, 1)) dataone <- data.frame("X" = X1) interim <- hist_interim(start, dataone) n2 <- interim$des_interim[4] X2 <- abs(rnorm(n2, 0, 1)) datatwo <- data.frame("X" = X2) hist_end(interim, datatwo)
Adjust a design based on historical controls at interim using the covariate data of the patients accrued in stage 1.
hist_interim(start, stageone_data)
hist_interim(start, stageone_data)
start |
An initialized design based on historical controls as returned by |
stageone_data |
A dataframe containing the relevant covariate data of the patients accrued in stage 1. |
A list returning the arguments of the function and the preliminary design of a trial based on historical controls adjusted at interim.
X <- abs(rnorm(1000, 0, 1)) Y <- rbinom(1000, 1, 1-exp(-X)) mydata <- data.frame("X" = X, "Y" = Y) start <- hist_start(mydata, Y~X, c1 = 2) n1 <- start$des_start[2] X1 <- abs(rnorm(n1, 0, 1)) dataone <- data.frame("X" = X1) hist_interim(start, dataone)
X <- abs(rnorm(1000, 0, 1)) Y <- rbinom(1000, 1, 1-exp(-X)) mydata <- data.frame("X" = X, "Y" = Y) start <- hist_start(mydata, Y~X, c1 = 2) n1 <- start$des_start[2] X1 <- abs(rnorm(n1, 0, 1)) dataone <- data.frame("X" = X1) hist_interim(start, dataone)
Initializes a design based on historical controls before the start of the study.
hist_start(hist_data, formula, phi = "odds_ratio", c1, modelfit = NULL, mean0 = NULL, mean1 = NULL, alpha = 0.05, beta = 0.2)
hist_start(hist_data, formula, phi = "odds_ratio", c1, modelfit = NULL, mean0 = NULL, mean1 = NULL, alpha = 0.05, beta = 0.2)
hist_data |
A data frame containing covariates and binary responses for historical controls. |
formula |
A formula which is used for fitting a logistic regression model on the historical data. |
phi |
The relation between the response rate under the null and the response rate under the interesting alternative.
"odds_ratio" assumes that the odds ratio (OR) between these response rates is constant with OR = |
c1 |
parameter for obtaining the response rate under the alternative, see description of phi. |
modelfit |
Can be used instead of |
mean0 |
Optional: Can be used to overwrite the estimated average response rate under the null of the fitted model. |
mean1 |
Optional: Can be used to overwrite the estimated average response rate under the alternative of the fitted model. |
alpha |
Specified type I error of the trial. |
beta |
Specified type II error of the trial. |
A list returning the arguments of the function and the preliminary design for starting the stratified trial.
X <- abs(rnorm(1000, 0, 1)) Y <- rbinom(1000, 1, 1-exp(-X)) mydata <- data.frame("X" = X, "Y" = Y) hist_start(mydata, Y~X, c1 = 2)
X <- abs(rnorm(1000, 0, 1)) Y <- rbinom(1000, 1, 1-exp(-X)) mydata <- data.frame("X" = X, "Y" = Y) hist_start(mydata, Y~X, c1 = 2)
Adjust a subspace stratified design at the end of the study.
strat_end(interim, sub_stagetwo)
strat_end(interim, sub_stagetwo)
interim |
A preliminary stratified design adjusted at interim as returned by |
sub_stagetwo |
The subtypes observed for the patients accrued in stage 2. |
A list returning the arguments of the function and the final design of the stratified trial.
p0_sub <- c(0.1, 0.3, 0.5) p1_sub <- c(0.3, 0.5, 0.7) distr_sub <- c(1/3, 1/3, 1/3) start <- strat_start(p0_sub, p1_sub, distr_sub) n1 <- start$des_start[2] subone <- sample(c(1,2,3), n1, TRUE) interim <- strat_interim(start, subone) n2 <- interim$des_interim[4] subtwo <- sample(c(1,2,3), n2, TRUE) strat_end(interim, subtwo)
p0_sub <- c(0.1, 0.3, 0.5) p1_sub <- c(0.3, 0.5, 0.7) distr_sub <- c(1/3, 1/3, 1/3) start <- strat_start(p0_sub, p1_sub, distr_sub) n1 <- start$des_start[2] subone <- sample(c(1,2,3), n1, TRUE) interim <- strat_interim(start, subone) n2 <- interim$des_interim[4] subtwo <- sample(c(1,2,3), n2, TRUE) strat_end(interim, subtwo)
Adjust a subspace stratified design at interim.
strat_interim(start, sub_stageone)
strat_interim(start, sub_stageone)
start |
An initialized stratified design as returned by |
sub_stageone |
The subtypes observed for the patients accrued in stage 1. |
A list returning the arguments of the function and the preliminary design of a stratified trial adjusted at interim.
p0_sub <- c(0.1, 0.3, 0.5) p1_sub <- c(0.3, 0.5, 0.7) distr_sub <- c(1/3, 1/3, 1/3) start <- strat_start(p0_sub, p1_sub, distr_sub) n1 <- start$des_start[2] subone <- sample(c(1,2,3), n1, TRUE) strat_interim(start, subone)
p0_sub <- c(0.1, 0.3, 0.5) p1_sub <- c(0.3, 0.5, 0.7) distr_sub <- c(1/3, 1/3, 1/3) start <- strat_start(p0_sub, p1_sub, distr_sub) n1 <- start$des_start[2] subone <- sample(c(1,2,3), n1, TRUE) strat_interim(start, subone)
Initializes a subspace stratified design before the start of the study.
strat_start(p0_sub, p1_sub, distr_sub, alpha = 0.05, beta = 0.2)
strat_start(p0_sub, p1_sub, distr_sub, alpha = 0.05, beta = 0.2)
p0_sub |
A vector, where the $i$-th entry corresponds to the response rate under the null for the $i$-th subtype. |
p1_sub |
A vector, where the $i$-th entry corresponds to the response rate under the alternative for the $i$-th subtype. |
distr_sub |
A vector, where the $i$-th entry corresponds to the prevalence of the $i$-th subtype in the population. |
alpha |
Specified type I error of the trial. |
beta |
Specified type II error of the trial. |
A list returning the arguments of the function and the preliminary design for starting the stratified trial.
p0_sub <- c(0.1, 0.3, 0.5) p1_sub <- c(0.3, 0.5, 0.7) distr_sub <- c(1/3, 1/3, 1/3) strat_start(p0_sub, p1_sub, distr_sub)
p0_sub <- c(0.1, 0.3, 0.5) p1_sub <- c(0.3, 0.5, 0.7) distr_sub <- c(1/3, 1/3, 1/3) strat_start(p0_sub, p1_sub, distr_sub)