get_OC  R Documentation 
The get_OC
function is designed to generate the operating
characteristics of SAM priors (Yang, et al., 2023), including the
relative bias, relative mean squared error, and type I error and power
under a twoarm comparative trial design. As an option, the operating
characteristic of robust MAP priors (Schmidli, et al., 2014)
can also be generated for comparison.
get_OC(
if.prior,
theta.h,
method.w,
prior.odds,
nf.prior,
delta,
n,
n.t,
decision,
ntrial,
if.MAP,
weight,
theta,
theta.t,
...
)
## S3 method for class 'betaMix'
get_OC(
if.prior,
theta.h,
method.w,
prior.odds,
nf.prior,
delta,
n,
n.t,
decision,
ntrial,
if.MAP,
weight,
theta,
theta.t,
...
)
## S3 method for class 'normMix'
get_OC(
if.prior,
theta.h,
method.w,
prior.odds,
nf.prior,
delta,
n,
n.t,
decision,
ntrial,
if.MAP,
weight,
theta,
theta.t,
...,
sigma
)
if.prior 
Informative prior constructed from historical data, represented (approximately) as a mixture of conjugate distributions. 
theta.h 
Estimate of the treatment effect based on historical data.
If missing, the default value is set to be the posterior mean estimate from

method.w 
Methods used to determine the mixture weight for SAM priors.
The default method is LRT (Likelihood Ratio Test), the alternative option can
be PPR (Posterior Probability Ratio). See 
prior.odds 
The prior probability of 
nf.prior 
Noninformative prior used for constructing the SAM prior and robust MAP prior. 
delta 
Clinically significant difference used for the SAM prior. 
n 
Sample size for the control arm. 
n.t 
Sample size for the treatment arm. 
decision 
Decision rule to compare the treatment with the control;
see 
ntrial 
Number of trials simulated. 
if.MAP 
Whether to simulate the operating characteristics of the
robust MAP prior for comparison, the default value is 
weight 
Weight assigned to the informative prior component
( 
theta 
A vector of the response rate (binary endpoints) or mean (continuous endpoints) for the control arm. 
theta.t 
A vector of the response rate (binary endpoints) or mean (continuous endpoints) for the treatment arm. 
... 
Additional parameters for continuous endpoints. 
sigma 
Variance to simulate the continuous endpoint under normality assumption. 
The get_OC
function is designed to generate the operating
characteristics of SAM priors, including the relative bias, relative
mean squared error, and type I error, and power under a twoarm
comparative trial design. As an option, the operating characteristics of
robust MAP priors (Schmidli, et al., 2014) can also be generated for
comparison.
The relative bias is defined as the difference between the bias of a method and the bias of using a noninformative prior. The relative mean squared error is the difference between the mean squared error (MSE) of a method and the MES of using a noninformative prior.
To evaluate type I error and power, the determination of whether the
treatment is superior to the control is calculated based on function
decision2S
.
Returns dataframe that contains the relative bias, relative MSE, type I error, and power for both SAM priors, as well as robust MAP priors. Additionally, the mixture weight of the SAM prior is also displayed.
get_OC(betaMix)
: The function is designed to generate the operating
characteristics of SAM priors for binary endpoints.
get_OC(normMix)
: The function is designed to generate the operating
characteristics of SAM priors for continuous endpoints.
Yang P, Zhao Y, Nie L, Vallejo J, Yuan Y. SAM: Selfadapting mixture prior to dynamically borrow information from historical data in clinical trials. Biometrics 2023; 00, 1–12. https://doi.org/10.1111/biom.13927
Schmidli H, Gsteiger S, Roychoudhury S, O'Hagan A, Spiegelhalter D, Neuenschwander B. Robust metaanalyticpredictive priors in clinical trials with historical control information. Biometrics 2014; 70(4):10231032.
set.seed(123)
## Example of a binary endpoint
## Consider a randomized comparative trial designed to borrow information
## from historical data on the control. We assumed a noninformative prior
## beta(1, 1) and an informative prior beta(30, 50) after incorporating
## the historical data. The treatment is regarded as superior to the control
## if Pr(RR.t > RR.c  data) > 0.95, where RR.t and RR.c are response rates
## of the treatment and control, respectively. The operating characteristics
## were assessed under the scenarios of (RR.c, RR.t) = (0.3, 0.36) and (0.3, 0.56).
## OC < get_OC(## Informative prior constructed based on historical data
## if.prior = mixbeta(c(1, 30, 50)),
## ## Noninformative prior used for constructing the SAM prior
## nf.prior = mixbeta(c(1,1,1)),
## delta = 0.2, ## Clinically significant difference
## n = 35, ## Sample size for the control arm
## n.t = 70, ## Sample size for the treatment arm
## ## Decision rule to compare the whether treatment is superior
## ## than the control
## decision = decision2S(0.95, 0, lower.tail=FALSE),
## ntrial = 1000, ## Number of trials simulated
## ## Weight assigned to the informative component for MAP prior
## weight = 0.5,
## ## A vector of response rate for the control arm
## theta = c(0.3, 0.36),
## ## A vector of response rate for the treatment arm
## theta.t = c(0.3, 0.56))
## OC
## Example of continuous endpoint
## Consider a randomized comparative trial designed to borrow information
## from historical data on the control. We assumed a noninformative prior
## N(0, 1e4) and an informative prior N(0.5, 2) after incorporating
## the historical data. The treatment is regarded as superior to the control
## if Pr(mean.t > mean.c  data) > 0.95, where mean.t and mean.c are mean
## of the treatment and control, respectively. The operating characteristics
## were assessed under the scenarios of (mean.c, mean.t) = (0.1, 0.1) and
## (0.5, 1.0).
sigma < 2
prior.mean < 0.5
prior.se < sigma/sqrt(100)
## OC < get_OC(## Informative prior constructed based on historical data
## if.prior = mixnorm(c(1, prior.mean, prior.se)),
## ## Noninformative prior used for constructing the SAM prior
## nf.prior = mixnorm(c(1, 0, 1e4)),
## delta = 0.2 * sigma, ## Clinically significant difference
## n = 100, ## Sample size for the control arm
## n.t = 200, ## Sample size for the treatment arm
## ## Decision rule to compare the whether treatment is superior
## ## than the control
## decision = decision2S(0.95, 0, lower.tail=FALSE),
## ntrial = 1000, ## Number of trials simulated
## ## A vector of mean for the control arm
## theta = c(0.1, 0.5),
## ## A vector of mean for the treatment arm
## theta.t = c(0.1, 1.0),
## sigma = sigma)
## OC
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.