bootf2 {bootf2} | R Documentation |
Estimate 90% Confidence Intervals of
with Bootstrap Methodology
Description
Main function to estimate 90% confidence intervals of using
bootstrap methodology.
Usage
bootf2(test, ref, path.in, file.in, path.out, file.out,
n.boots = 10000L, seed = 306L, digits = 2L, alpha = 0.05,
regulation = c("EMA", "FDA", "WHO","Canada", "ANVISA"),
min.points = 1L, both.TR.85 = FALSE, print.report = TRUE,
report.style = c("concise", "intermediate", "detailed"),
f2.type = c("all", "est.f2", "exp.f2", "bc.f2",
"vc.exp.f2", "vc.bc.f2"),
ci.type = c("all", "normal", "basic", "percentile",
"bca.jackknife", "bca.boot"),
quantile.type = c("all", as.character(1:9), "boot"),
jackknife.type = c("all", "nt+nr", "nt*nr", "nt=nr"),
time.unit = c("min", "h"), output.to.screen = FALSE,
sim.data.out = FALSE)
Arguments
test , ref |
Data frames of dissolution profiles of test and reference
product if |
path.in , file.in , path.out , file.out |
Character strings of input and output directories and file names. See Input/Output in Details. |
n.boots |
An integer indicating the number of bootstrap samples. |
seed |
Integer seed value for reproducibility. If missing, a random seed will be generated for reproducibility purpose. |
digits |
An integer indicating the decimal points for the output. |
alpha |
A numeric value between 0 and 1 to estimate
|
regulation |
Character strings indicating regulatory guidelines.
@seealso |
min.points |
An integer indicating the minimum time points to be used
to calculate |
both.TR.85 |
Logical. If |
print.report |
Logical. If |
report.style |
|
f2.type |
Character strings indicating which type of |
ci.type |
Character strings indicating which type of confidence interval should be estimated. See Types of confidence intervals in Details. |
quantile.type |
Character strings indicating the type of percentile. |
jackknife.type |
Character strings indicating the type of jackknife method. See Details. |
time.unit |
Character strings indicating the unit of time. It should
be either |
output.to.screen |
Logical. If |
sim.data.out |
Logical. If |
Details
Minimum required arguments that must be provided by the user
Arguments test
and ref
must be provided by the user. They should be R
data frames
, with time as the first column, and all individual profiles
profiles as the rest columns. The actual names of the columns do not matter
since they will be renamed internally.
Input/Output
The dissolution data of test and reference product can either be provided as
data frames for test
and ref
, as explained above, or be read from an
Excel file with data of test and reference stored in separate worksheets.
In the latter case, the argument path.in
, the directory where the Excel
file is, and file.in
, the name of the Excel file including the file
extension .xls
or .xlsx
, must be provided. In such case, the argument
test
and ref
must be the names of the worksheets in quotation marks.
The first column of each Excel worksheet must be time, and the rest columns
are individual dissolution profiles. The first row should be column names,
such as time, unit01, unit02, ... The actual names of the columns do not
matter as they will be renamed internally.
Arguments path.out
and file.out
are the names of the output directory
and file. If they are not provided, but argument print.report
is TRUE
,
then a plain text report will be generated automatically in the current
working directory with file name test_vs_ref_TZ_YYYY-MM-DD_HHMMSS.txt
,
where test
and ref
are data set names of test and reference, TZ
is the
time zone such as CEST
, YYYY-MM-DD
is the numeric date format and
HHMMSS
is the numeric time format for hour, minute, and second.
For a quick check, set argument output.to.screen = TRUE
, a summary report
very similar to concise
style report will be printed on screen.
Types of Estimators
According to Shah et al, the population for the inference is
where is the number of time points;
and
are population mean of test and
reference product at time point
, respectively;
is the summation from
to
.
Five estimators for are included in the function:
The estimated
, denoted by
, is the one written in various regulatory guidelines. It is expressed differently, but mathematically equivalently, as
where
is the number of time points;
and
are mean dissolution data at the
th time point of random samples chosen from the test and the reference population, respectively. Compared to the equation of population
above, the only difference is that in the equation of
the sample means of dissolution profiles replace the population means for the approximation. In other words, a point estimate is used for the statistical inference in practice.
The Bias-corrected
, denoted by
, was described in the article of Shah et al, as
where
and
are unbiased estimates of variance at the
th time points of random samples chosen from test and reference population, respectively; and
is the sample size.
The variance- and bias-corrected
, denoted by
, does not assume equal weight of variance as
does.
where
and
are weighting factors for variance of test and reference products, respectively, which can be calculated as follows:
and
The expected
, denoted by
, is calculated based on the mathematical expectation of estimated
,
using mean dissolution profiles and variance from samples for the approximation of population values.
The variance-corrected expected
, denoted by
, is calculated as
Types of Confidence Interval
The following confidence intervals are included:
The Normal interval with bias correction, denoted by
normal
in the function, is estimated according to Davison and Hinkley,where
are the lower and upper limit of the confidence interval estimated from bootstrap samples;
denotes the estimators described above;
represents the inverse of standard normal cumulative distribution function with type I error
;
and
are the resampling estimates of bias and variance calculated as
and
where
is the number of bootstrap samples;
is the
estimate with
th bootstrap sample, and
is the mean value.
The basic interval, denoted by
basic
in the function, is estimated according to Davison and Hinkley,and
where
and
are the
th and
th ordered resampling estimates of
, respectively. When
is not an integer, the following equation is used for interpolation,
where
is the integer part of
,
and
are the
th and the
th ordered resampling estimates of
, respectively.
The percentile intervals, denoted by
percentile
in the function, are estimated using nine different types of quantiles, Type 1 to Type 9, as summarized in Hyndman and Fan's article and implemented inR
'squantile
function. UsingR
'sboot
package, programbootf2BCA
outputs a percentile interval using the equation above for interpolation. To be able to compare the results among different programs, the same interval, denoted byPercentile (boot)
in the function, is also included in the function.The bias-corrected and accelerated (BCa) intervals are estimated according to Efron and Tibshirani,
where
and
are the
th and the
th percentile of the resampling estimates of
, respectively. Type I errors
and
are obtained as
and
where
and
are called bias-correction and acceleration, respectively.
There are different methods to estimate
and
. Shah et al. used jackknife technique, denoted by
bca.jackknife
in the function,and
where
denotes the number of element in the set,
is the
th jackknife statistic,
is the mean of the jackknife statistics, and
is the summation from 1 to sample size
.
Program
bootf2BCA
gives a slightly different BCa interval withR
'sboot
package. This approach, denoted bybca.boot
in the function, is also implemented in the function for estimating the interval.
Notes on the argument jackknife.type
For any sample with size , the jackknife estimator is obtained by
estimating the parameter for each subsample omitting the
th
observation. However, when two samples (e.g., test and reference) are
involved, there are several possible ways to do it. Assuming sample size
of test and reference are
and
,
the following three possibility are considered:
Estimated by removing one observation from both test and reference samples. In this case, the prerequisite is
, denoted by
nt=nr
in the function. So if there are 12 units in test and reference data sets, there will be 12 jackknife estimators.Estimate the jackknife for test sample while keeping the reference data unchanged; and then estimate jackknife for reference sample while keeping the test sample unchanged. This is denoted by
nt+nr
in the function. This is the default method. So if there are 12 units in test and reference data sets, there will bejackknife estimators.
For each observation deleted from test sample, estimate jackknife for reference sample. This is denoted by
nt*nr
in the function. So if there are 12 units in test and reference data sets, there will bejackknife estimators.
Value
A list of 3 or 5 components.
-
boot.ci
: A data frame of bootstrapconfidence intervals.
-
boot.f2
: A data frame of all individualvalues for all bootstrap data set.
-
boot.info
: A data frame with detailed information of bootstrap for reproducibility purpose, such as all arguments used in the function, time points used for calculation of, and the number of
NA
s. -
boot.summary
: A data frame with descriptive statistics of the bootstrap.
-
boot.t
andboot.r
: Lists of individual bootstrap samples for test and reference product ifsim.data.out = TRUE
.
References
Shah, V. P.; Tsong, Y.; Sathe, P.; Liu, J.-P. In Vitro
Dissolution Profile Comparison—Statistics and Analysis of the
Similarity Factor, . Pharmaceutical Research 1998,
15 (6), 889–896. DOI: 10.1023/A:1011976615750.
Davison, A. C.; Hinkley, D. V. Bootstrap Methods and Their Application. Cambridge University Press, 1997.
Hyndman, R. J.; Fan, Y. Sample Quantiles in Statistical Packages. The American Statistician 1996, 50 (4), 361–365. DOI: /10.1080/00031305.1996.10473566.
Efron, B.; Tibshirani, R. An Introduction to the Bootstrap. Chapman & Hall, 1993.
Examples
# time points
tp <- c(5, 10, 15, 20, 30, 45, 60)
# model.par for reference with low variability
par.r <- list(fmax = 100, fmax.cv = 3, mdt = 15, mdt.cv = 14,
tlag = 0, tlag.cv = 0, beta = 1.5, beta.cv = 8)
# simulate reference data
dr <- sim.dp(tp, model.par = par.r, seed = 100, plot = FALSE)
# model.par for test
par.t <- list(fmax = 100, fmax.cv = 3, mdt = 12.29, mdt.cv = 12,
tlag = 0, tlag.cv = 0, beta = 1.727, beta.cv = 9)
# simulate test data with low variability
dt <- sim.dp(tp, model.par = par.t, seed = 100, plot = FALSE)
# bootstrap. to reduce test run time, n.boots of 100 was used in the example.
# In practice, it is recommended to use n.boots of 5000--10000.
# Set `output.to.screen = TRUE` to view the result on screen
d <- bootf2(dt$sim.disso, dr$sim.disso, n.boots = 100, print.report = FALSE)