The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.
To use traditional \(f_2\) method, several conditions defined in the regulatory guidelines have to be fulfilled. Different guidelines phrase the conditions differently, which led to confusion some times. The details were explained in the vignette Introduction to bootf2.
This document gives some examples of the usage of the function calcf2()
.
The complete list of arguments of the function is as follows:
calcf2(test, ref, path.in, file.in, path.out, file.out,
regulation = c("EMA", "FDA", "WHO", "Canada", "ANVISA"),
cv.rule = TRUE, message = FALSE, min.points = 3L,
f2.type = c("est.f2", "exp.f2", "bc.f2", "vc.exp.f2",
"vc.bc.f2", "all"), both.TR.85 = FALSE,
digits = 2L, time.unit = c("min", "h"), plot = TRUE,
plot.start.time = 0, plot.max.unit = 24L)
test
, ref
, path.in
, file.in
test
and ref
are data frames with the time as the first column, and individual units for the rest of columns. In such cases, arguments path.in
and file.in
should not be used..xlsx
or .xls
. In this case, data of test and reference should be stored in separate worksheets. The first column should be time, the rest columns are individual units. The first row is the column head indicating the names, such as ‘time,’ ‘unit 01,’ unit 02’, …. It doesn’t matter what the names are as columns will be renamed internally by the function. The important point is that the first row will not be read, so do not put dissolution data on the first row.path.in
and file.in
are provided, the argument test
and ref
should be the worksheet names inside quotation mark, e.g., "lot ABCD1234 pH 6.8"
.path.in
can be an absolute path such as"/home/myname/my.project/dat/"
, or a relative path such as "../dat/"
if the working directory is in the folder "/home/myname/my.project/analysis/"
and the data file is in the folder "/home/myname/my.project/dat/"
."C:\user\myname\my.project\dat\"
cannot be the path.in
, you have to changed it to "C:\\user\\myname\\my.project\\dat\\"
, or to "C:/user/myname/my.project/dat/"
, the same format as used in Linux system.path.out
and file.out
are really overkill. By default the result will be printed to screen. But if somehow you feel that you need it, the same principle for path.in
and file.in
applies here.cv.rule
is set to TRUE
, and if argument message
is also TRUE
, additional message will be printed to screen. One particular note is the rounding of CV before checking compliance. Since the guidelines does not specify the precision for CV, when checking if CV condition defined in the guidelines is fulfilled, the calculated CV values are rounded with digits
decimal first before they were compared to the 20%/10% criterion. And refer to vignette Introduction to bootf2 for details of regulation rules."EMA"
and "FDA"
are the same. See vignette Introduction to bootf2 for details. The reason both of them are included in regulation
argument is because they have different rules for CV.both.TR.85 = TRUE
, and regulation = FDA
, then the function will calculate \(f_2\) using all time points until both test and reference dissolve more than 85%. This is the wrong interpretation of the guidelines, as explained in the vignette Introduction to bootf2. The purpose of this argument is for historical reason, in case users want to check the calculation published in the old articles where the wrong interpretation was used, or for validation purpose. It should be set to FALSE
for the daily analysis.f2.type
. This argument is only for bootstrap method. The default est.f2
is the correct one to use. See vignette Confidence Intervals of \(f_2\) Using Bootstrap Method for details.plot.max.unit
control how individual profile will be represented in the plot. When the actual number of units is greater than the value of plot.max.unit
, the individual profile will be represented as boxplots at each time points.plot.start.time = 120
(or plot.start.time = 2
if the time unit is "h"
) for example, can make plots more readable.help("calcf2")
for more details on each argument.First, let’s simulate profiles with low variability for reference and test.
# time points
<- c(5, 10, 15, 20, 30, 45, 60)
tp
# model.par for reference with low variability
<- list(fmax = 100, fmax.cv = 3, mdt = 15, mdt.cv = 13,
par.r1.lv tlag = 0, tlag.cv = 0, beta = 1.5, beta.cv = 7)
# simulate reference data
<- sim.dp(tp, model.par = par.r1.lv, seed = 100, plot = FALSE,
dr1.lv message = TRUE)
# Dissolution data was generated using Weibull model, with the
# following model parameters:
# - fmax = 100
# - fmax.cv = 3%
# - tlag = 0
# - tlag.cv = 0%
# - mdt = 15
# - mdt.cv = 13%
# - beta = 1.5
# - beta.cv = 7%
#
# Seed number used: 100
# model.par for test
<- list(fmax = 100, fmax.cv = 3, mdt = 12.29, mdt.cv = 10,
par.t1.lv tlag = 0, tlag.cv = 0, beta = 1.727, beta.cv = 8)
# simulate test data with low variability
<- sim.dp(tp, model.par = par.t1.lv, seed = 100, plot = FALSE,
dt1.lv message = TRUE)
# Dissolution data was generated using Weibull model, with the
# following model parameters:
# - fmax = 100
# - fmax.cv = 3%
# - tlag = 0
# - tlag.cv = 0%
# - mdt = 12.29
# - mdt.cv = 10%
# - beta = 1.727
# - beta.cv = 8%
#
# Seed number used: 100
Calculate f2 with default setting (following EMA’s guideline)
<- calcf2(dt1.lv$sim.disso, dr1.lv$sim.disso,
t_vs_r_ema message = TRUE)
# The f2 method was applied according to EMA's BE guideline.
#
# Individual data was provided with option 'cv.rule = TRUE',
# therefore, CV has been calculated and checked accordingly.
#
# Calculated mean and CV as follows:
# Time Mean (T) Mean (R) CV (T) CV (R)
# 5 19.02 17.60 17.66 18.33
# 10 50.77 42.48 10.46 12.82
# 15 76.24 63.95 5.79 8.95
# 20 90.52 79.22 2.91 5.99
# ------------------------------------------------
# 30 98.68 94.18 1.08 2.38
# 45 99.41 98.98 0.88 0.98
# 60 99.42 99.39 0.88 0.89
# ==================================
# Number of units for test is : nt = 12
# Number of units for reference is : nr = 12
#
# CV criteria fulfilled; therefore, f2 method can be applied.
#
# The time points above the dashed line are used in f2 calculation.
#
# Estimated f2 = 51.34
calculate f2 following WHO guideline
<- calcf2(dt1.lv$sim.disso, dr1.lv$sim.disso,
t_vs_r_who regulation = "WHO", message = TRUE)
# The f2 method was applied according to WHO's BE guideline.
#
# Individual data was provided with option 'cv.rule = TRUE',
# therefore, CV has been calculated and checked accordingly.
#
# Calculated mean and CV as follows:
# Time Mean (T) Mean (R) CV (T) CV (R)
# 5 19.02 17.60 17.66 18.33
# 10 50.77 42.48 10.46 12.82
# 15 76.24 63.95 5.79 8.95
# 20 90.52 79.22 2.91 5.99
# 30 98.68 94.18 1.08 2.38
# ------------------------------------------------
# 45 99.41 98.98 0.88 0.98
# 60 99.42 99.39 0.88 0.89
# ==================================
# Number of units for test is : nt = 12
# Number of units for reference is : nr = 12
#
# CV criteria fulfilled; therefore, f2 method can be applied.
#
# The time points above the dashed line are used in f2 calculation.
#
# Estimated f2 = 53.13
Calculate f2 following FDA guidance, to confirm “old calculation” with wrong interpretation. See vignette Introduction to bootf2 for details.
<- calcf2(dt1.lv$sim.disso, dr1.lv$sim.disso, regulation = "FDA",
t_vs_r both.TR.85 = TRUE, message = TRUE, plot = FALSE)
# The f2 method was applied according to FDA's BE guidance.
#
# Individual data was provided with option 'cv.rule = TRUE',
# therefore, CV has been calculated and checked accordingly.
#
# Calculated mean and CV as follows:
# Time Mean (T) Mean (R) CV (T) CV (R)
# 5 19.02 17.60 17.66 18.33
# 10 50.77 42.48 10.46 12.82
# 15 76.24 63.95 5.79 8.95
# 20 90.52 79.22 2.91 5.99
# 30 98.68 94.18 1.08 2.38
# ------------------------------------------------
# 45 99.41 98.98 0.88 0.98
# 60 99.42 99.39 0.88 0.89
# ==================================
# Number of units for test is : nt = 12
# Number of units for reference is : nr = 12
#
# CV criteria fulfilled; therefore, f2 method can be applied.
#
# The time points above the dashed line are used in f2 calculation.
#
# Estimated f2 = 53.13*
#
# *Note: Argument 'both.TR.85' is 'TRUE', which is the wrong interpretation
# of the guidance. This should only be used for cases such as checking the
# calculation published in the old literature.
Simulate profiles with the same population parameters but with higher variability.
# model.par for reference with high variability
<- list(fmax = 100, fmax.cv = 3, mdt = 15, mdt.cv = 20,
par.r1.hv tlag = 0, tlag.cv = 0, beta = 1.5, beta.cv = 10)
# simulate reference data
<- sim.dp(tp, model.par = par.r1.hv, seed = 100, plot = FALSE)
dr1.hv
# model.par for test
<- list(fmax = 100, fmax.cv = 3, mdt = 12.29, mdt.cv = 15,
par.t1.hv tlag = 0, tlag.cv = 0, beta = 1.727, beta.cv = 12)
# simulate test data with low variability
<- sim.dp(tp, model.par = par.t1.hv, seed = 100, plot = FALSE) dt1.hv
When CV conditions are not fulfilled, the function will stop running.
calcf2(dt1.hv$sim.disso, dr1.hv$sim.disso, message = TRUE)
# The f2 method was applied according to EMA's BE guideline.
#
# Individual data was provided with option 'cv.rule = TRUE',
# therefore, CV has been calculated and checked accordingly.
#
# Calculated mean and CV as follows:
# Time Mean (T) Mean (R) CV (T) CV (R)
# 5 19.19 17.92 25.22 25.93
# 10 51.11 43.02 15.82 19.05
# 15 76.58 64.46 9.13 13.90
# 20 90.73 79.55 4.49 9.66
# ------------------------------------------------
# 30 98.70 94.20 1.18 3.83
# 45 99.41 98.95 0.88 1.05
# 60 99.42 99.39 0.88 0.89
# ==================================
# Number of units for test is : nt = 12
# Number of units for reference is : nr = 12
#
# CV criteria not fulfilled; therefore, f2 method cannot be applied.
# Error in calcf2(dt1.hv$sim.disso, dr1.hv$sim.disso, message = TRUE): You should consider alternative methods such as bootstrap f2.
There might be a time that you just want to check the \(f_2\) regardless of the variability, option cv.rule
can be set to FALSE
in such case.
<- calcf2(dt1.hv$sim.disso, dr1.hv$sim.disso,
dt1.hv_vs_dr1.hv cv.rule = FALSE, message = TRUE)
# The f2 method was applied according to EMA's BE guideline.
#
# Individual data was provided with option 'cv.rule = FALSE',
# therefore, CV has been calculated but has not been checked.
# You should really consider setting 'cv.rule = TRUE' to comply
# regulatory requirements.
#
# Calculated mean and CV as follows:
# Time Mean (T) Mean (R) CV (T) CV (R)
# 5 19.19 17.92 25.22 25.93
# 10 51.11 43.02 15.82 19.05
# 15 76.58 64.46 9.13 13.90
# 20 90.73 79.55 4.49 9.66
# ------------------------------------------------
# 30 98.70 94.20 1.18 3.83
# 45 99.41 98.95 0.88 1.05
# 60 99.42 99.39 0.88 0.89
# ==================================
# Number of units for test is : nt = 12
# Number of units for reference is : nr = 12
#
# CV has not been checked.
#
# The time points above the dashed line are used in f2 calculation.
#
# Estimated f2 = 51.68
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.