When comparing a single armed study to historical controls it is necessary to take into account that there may be variation in the underlying treatment/placebo effect from study to study. If this among-study variability is not accounted for the type one and two errors may be inaccurate. Given a historical database of study data, such as one might have in a meta-analysis the program calculates the criteria for significance for a new study that uses the database as an historical control and calculates the power of such as study as a function of sample size and difference to be detected.
hct(data, estimate, standardError, N, iter = 2000, rseed = NA,
silent=TRUE,constantStderr=TRUE)A data frame of historical data one study per row.
The name or column number of the variable in
data containing the estimated outcome.
The name or column number of the variable in data
containing the standard error of the estimated outcome.
The name or column number of the variable in data
containing the sample size of the study.
The number of interations to use in the MCMC to calculate the posterior distribution of the among-study variation and mean outcome measure.
Seed for random number generator
Suppresses STAN output to the console
If TRUE it assumes that that standard
deviation for each study is known exactly this is
appropriate for larger studies.
If FALSE it assumes that they are proportional to a
chi-square distribution with N-1 degrees of freedom and
uses a hierarchical model for the patient-level variance.
A hct object which is a list of four elements.
A function with signature (p,se,df==NULL) to calculate the cut-off value
for statistical significance at a one sided p-value of p, with standard
error of the estimate equal to se. When df=NULL a normal test is used otherwise a t-test with df degrees of freedom.
A function to calculate the power of a study with signature (t,delta,se,df=NULL),
where t is the cuttoff value, se is the standard error of the estimate
and delta
is the treatment effect
Which is the effective standard deviation of the outcome measure.
It is calculated as
sqrt(sum(data[,standardError]^2*data[,N]*(data[,N]-1))/(sum(data[,N])-1))),
which is what it would be if the parameter estimates were sample means. When df=NULL a normal test is used otherwise a t-test with df degrees of freedom.
An object of class stanfit with the fit of the data
A generic summary function prints out the value of effective.SD and uses the data frame summary function for data.frame(extract(fit,c("mu"","sig"","y_pred"))). The generic print function prints this summary.
Design and analysis of a clinical trial using previous trials as historical control
# NOT RUN {
als=data.frame(estimate=c(3.5,2.6,2.3),SE=c(.4,.3,.6),N=c(100,150,76))
ts=hct(als,'estimate','SE','N')
print(ts)
us=ts$criteria(0.025,.3)
ts$power(us,5,.4)
# }
Run the code above in your browser using DataLab