knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

disprofas

Functions for the determination of similarity of highly variable dissolution profiles of two drug formulations are provided. Estimation of f~1~, f~2~ and bootstrap f~2~ is implemented. In addition, functions following the model-independent MCR (multivariate confidence region) procedure and the T^2^-test for equivalence procedure are available.

Installation

A stable version of disprofas can be installed from CRAN:

install.packages("disprofas")

The development version is available from GitHub by:

# install.packages("devtools")
# devtools::install_github("piusdahinden/disprofas")

Examples

Example 1

Example 1 illustrates how to solve a common problem by aid of the bootstrap f~2~ procedure proposed by Shah et al. (1998) using a data set containing the dissolution data of one reference batch and one test batch of n = 12 tablets each, i.e. the dissolution profiles of the % drug release observed at 0, 30, 60, 90 and 180 minutes (See Shah et al. (1998), Table 4).

``` {r example-1, message = FALSE} library(disprofas)

Data frame

str(dip2)

Perform estimation and print a summary

res1 <- bootstrap_f2(data = dip2[dip2$batch %in% c("b0", "b4"), ], tcol = 5:8, grouping = "batch", rr = 200, new_seed = 421, use_ema = "no")

class(res1) summary(res1)

Prepare a graphical representation

plot(res1)

### Example 2
*Example 2* illustrates how to solve a common problem by aid of the model-independent non-parametric multivariate confidence region (MCR) procedure proposed by Tsong et al. (1996) using a data set containing the dissolution data of one reference batch and one test batch of *n* = 6 tablets each, i.e. the dissolution profiles of the % drug release observed at 5, 10, 15, 20, 30, 60, 90 and 120 minutes (see Tsong et al. (1996), Table 1).

``` {r example-2, message = FALSE}
library(disprofas)

# Data frame
str(dip3)

# Perform estimation and print a summary
res2 <- mimcr(data = dip3, tcol = 4:6, grouping = "batch")

class(res2)
summary(res2)

Example 3

Example 3 illustrates how to solve a common problem by aid of the T^2^-test for equivalence procedure proposed by Hoffelder (2016) using a data set containing the dissolution data of one reference batch and one test batch of n = 12 capsules each, i.e. the dissolution profiles of the % drug release observed at 15, 20 and 25 minutes (see Hoffelder (2016), Figure 1 (data not shown in publication, but the data set is available on CRAN, package T2EQ, data set ex_data_pharmind)).

``` {r example-3, message = FALSE} library(disprofas)

Data frame

str(dip4)

Perform estimation and print a summary

res3 <- mimcr(data = dip4, tcol = 2:4, grouping = "type") summary(res3)

### Example 4
*Example 4* illustrates the tolerance interval approach proposed by Martinez & Zhao (2018) using the data set that was used in *Example 1*. In the graphical representation of the data, the data points of the reference batch are shown as grey dots, the data points of the test batch as red crosses, the average time course is shown as blue line and the associated tolerance interval limits (*TL*) as green, orange and red lines that are drawn at *TL*, *TL* &#x00B1; S1 (5%) and *TL* &#x00B1; S2 (15%), respectively.

``` {r example-4, message = FALSE}
library(disprofas)

# Data frame
str(dip1)

# Perform estimation and print a summary
res4 <- mztia(data = dip1, shape = "wide", tcol = 3:10, grouping = "type",
                reference = "R")

class(res4)
summary(res4)

# Prepare a graphical representation
ggres4 <- plot_mztia(res4)
class(ggres4)
plot(ggres4)

Example 5

Example 5 illustrates how to solve a common problem by aid of the model-dependent approach as proposed by Sathe, Tsong & Shah (1996) or by Tsong, Hammerstrom & Chen (1997).

Example 5a

In Example 5a, the data set shown in Table 4 of Tsong, Hammerstrom & Chen (1997) is used which contains the Weibull parameter estimates obtained from fitting of Weibull curves to the cumulative dissolution profiles of individual tablets of three reference batches and one test batch of n = 12 tablets each. First, a one-sample T^2^-test is performed with the Weibull parameters of the reference group only, followed by a two-sample T^2^-test to compare the Weibull parameters of the reference batches with the Weibull parameters of the test batch.

``` {r example-5a-step-1, message = FALSE} library(disprofas)

str(dip7) t_param <- c("alpha", "beta")

One-sample T2 test with only the reference data

res1 <- get_T2_one(m = as.matrix(dip7[dip7$type == "ref", t_param]), mu = colMeans(as.matrix(dip7[dip7$type == "test", t_param])), signif = 0.05)

Two-sample T2 test comparing the reference with the test data

res2 <- get_T2_two(m1 = as.matrix(dip7[dip7$type == "ref", t_param]), m2 = as.matrix(dip7[dip7$type == "test", t_param]), signif = 0.05)

Estimates

res1$Parameters res2$Parameters

Since in the current example we have a two-dimensional situation, the results can be illustrated graphically. Based on the reference batch parameter estimates, a (1&#x2212;*signif*)100% confidence region (*CR*) can be constructed. All points on this *CR* have the same Mahalanobis distance. This distance sets the upper confidence limit (*UCL*).

``` {r example-5a-step-2, message = FALSE}
# Stretch factor
qfk <- as.numeric(sqrt(res2$Parameters["k"] / res2$Parameters["K"] *
                         res2$Parameters["F.crit"]))

# Cholesky decomposition, scaling and centering of confidence region
RR         <- chol(res2$covs$S.b1) # chol(res1$cov)
angles     <- seq(0, 2 * pi, length.out = 200)
ellipse    <- qfk[1] * cbind(cos(angles), sin(angles)) %*% RR
ellipseCtr <- sweep(ellipse, 2, res2$means$mean.b1, "+")

# Determination of ucl
ucl <- mahalanobis(x = ellipseCtr[1, ],
                   center = res2$means$mean.b1, cov = res2$covs$S.b1)

The UCL allows checking which points lie outside the CR and which points lie inside.

``` {r example-5a-step-3, message = FALSE}

Determination of scores

scores <- c(mahalanobis(x = as.matrix(dip7[dip7$type == "ref", t_param]), center = res2$means$mean.b1, cov = res2$covs$S.b1), mahalanobis(x = as.matrix(dip7[dip7$type == "test", t_param]), center = res2$means$mean.b1, cov = res2$covs$S.b1))

Check if scores are greater than ucl

is_out <- scores > ucl

Points in the dip7 data frame lying outside the confidence region

dip7[is_out, ]

These results are displayed graphically in the following figure. The points of the reference batches are shown as blue circles and the points of the test batch as red crosses. The *CR* boundary is shown as blue ellipse. The bold blue diamond represents the centre point of the ellipse. The points that have been identified to lie outside the *CR* are highlighted by yellow greek crosses.

``` {r example-5a-step-4, message = FALSE}
op <- par(mar = c(2.5, 2.5, 1.2, 0.5), mgp = c(1.5, 0.5, 0), lwd = 1.5)
{
  plot(dip7[dip7$type == "ref", t_param], asp = 1,
       xlim = c(0.3, 0.8), ylim = c(0.3, 0.8), pch = 1, col = "royalblue",
       xlab = "Weibull Scale Parameter (alpha)",
       ylab = "Weibull Shape Parameter (beta)")
  points(dip7[dip7$type == "test", t_param], pch = 4, col = "red")
  points(res1$means$mean.r[1], res1$means$mean.r[2], pch = 5,
         col = "royalblue", lwd = 2)
  lines(ellipseCtr, col = "royalblue")

  # Highlight the points detected to lie outside the confidence region
  points(dip7[is_out, t_param], pch = 3, col = "gold")
}

Example 5b

In Example 5b, the data set shown in Table III of Sathe, Tsong & Shah (1996) is used which contains the Weibull parameter estimates obtained from fitting of Weibull curves to the cumulative dissolution profiles of individual tablets of one reference batch and one test / post-change batch with a minor modification and a second test / post-change batch with a major modification, n = 12 tablets each. One-sample T^2^-tests are performed with the Weibull parameters of the reference and the two test groups separately.

``` {r example-5b-step-1, message = FALSE} library(disprofas)

str(dip8)

d_dat <- dip8 d_dat[, c("alpha", "beta")] <- log(d_dat[, c("alpha", "beta")]) t_param <- c("alpha", "beta")

res1ref <- get_T2_one(m = as.matrix(d_dat[d_dat$type == "ref", t_param]), mu = colMeans(as.matrix(d_dat[d_dat$type == "ref", t_param])), signif = 0.05) res1min <- get_T2_one(m = as.matrix(d_dat[d_dat$type == "minor", t_param]), mu = colMeans(as.matrix(d_dat[d_dat$type == "minor", t_param])), signif = 0.05) res1maj <- get_T2_one(m = as.matrix(d_dat[d_dat$type == "major", t_param]), mu = colMeans(as.matrix(d_dat[d_dat$type == "major", t_param])), signif = 0.05)

Estimates

res1ref$Parameters res1min$Parameters res1maj$Parameters

Since in the current example we have a two-dimensional situation, the results can be illustrated graphically. Based on the reference batch parameter estimates, a (1&#x2212;*signif*)100% confidence region (*CR*) or similarity region, as it is called in the article from Sathe, Tsong & Shah (1996), can be constructed. All points on this *CR* have the same Mahalanobis distance. The distance obtained with the *CR* of the reference batches sets the upper confidence limit (*UCL*).

``` {r example-5b-step-2, message = FALSE}
# Stretch factor
qfk <- c(ref = as.numeric(sqrt(res1ref$Parameters["k"] /
                                 res1ref$Parameters["K"] *
                                 res1ref$Parameters["F.crit"])),
         min = as.numeric(sqrt(res1min$Parameters["k"] /
                                 res1min$Parameters["K"] *
                                 res1min$Parameters["F.crit"])),
         maj = as.numeric(sqrt(res1maj$Parameters["k"] /
                                 res1maj$Parameters["K"] *
                                 res1maj$Parameters["F.crit"])))

# Cholesky decomposition, scaling and centering of confidence region
# Cholesky decomposition, scaling and centering of ellipse
RR_ref         <- chol(res1ref$cov)
angles_ref     <- seq(0, 2 * pi, length.out = 200)
ellipse_ref    <- qfk["ref"] * cbind(cos(angles), sin(angles)) %*% RR_ref
ellipseCtr_ref <- sweep(ellipse_ref, 2, res1ref$means$mean.r, "+")

RR_min         <- chol(res1min$cov)
angles_min     <- seq(0, 2 * pi, length.out = 200)
ellipse_min    <- qfk["min"] * cbind(cos(angles), sin(angles)) %*% RR_min
ellipseCtr_min <- sweep(ellipse_min, 2, res1min$means$mean.r, "+")

RR_maj         <- chol(res1maj$cov)
angles_maj     <- seq(0, 2 * pi, length.out = 200)
ellipse_maj    <- qfk["maj"] * cbind(cos(angles), sin(angles)) %*% RR_maj
ellipseCtr_maj <- sweep(ellipse_maj, 2, res1maj$means$mean.r, "+")

# Determination of ucl
ucl <- mahalanobis(x = ellipseCtr_ref[1, ],
                   center = res1ref$means$mean.r, cov = res1ref$cov)

The UCL allows checking which points lie outside the CR and which points lie inside of it.

``` {r example-5b-step-3, message = FALSE}

Determination of scores

scores <- c(mahalanobis(x = as.matrix(d_dat[d_dat$type == "ref", t_param]), center = res1ref$means$mean.r, cov = res1ref$cov), mahalanobis(x = as.matrix(d_dat[d_dat$type == "minor", t_param]), center = res1ref$means$mean.r, cov = res1ref$cov), mahalanobis(x = as.matrix(d_dat[d_dat$type == "major", t_param]), center = res1ref$means$mean.r, cov = res1ref$cov))

is_out <- scores > ucl

Points in the dip8 data frame lying outside the confidence region

d_dat[is_out, ]

Finally, the results collected above are displayed graphically for illustration. The black rectangle represents the *3 STD Similarity Region* as shown in Figure 4 in the article from Sathe, Tsong & Shah (1996). The points of the reference batch are shown as blue circles, the points of the minor modification batch as green crosses and the points of the major modification batch as magenta crosses. The *CR* boundaries are shown as ellipses that are coloured according to the corresponding data points. The bold diamonds coloured according to the corresponding data points represent the centre points of the ellipses. The points that have been identified to lie outside the *CR* of the reference batch are highlighted by yellow greek crosses.

``` {r example-5b-step-4, message = FALSE}
op <- par(mar = c(2.5, 2.5, 1.2, 0.5), mgp = c(1.5, 0.5, 0), lwd = 1.5)
t_multiple <- 3

{
  plot(d_dat[d_dat$type == "ref", t_param], asp = 1,
       xlim = c(-0.6, 0.6), ylim = c(-0.2, 0.6), pch = 1, col = "blue2",
       xlab = "ln(alpha)", ylab = "ln(beta)")
  points(d_dat[d_dat$type == "minor", t_param], pch = 4, col = "green3")
  points(d_dat[d_dat$type == "major", t_param], pch = 4, col = "magenta2")
  points(res1ref$means$mean.r[1], res1ref$means$mean.r[2], pch = 5,
         col = "blue2", lwd = 2)
  points(res1min$means$mean.r[1], res1min$means$mean.r[2], pch = 5,
         col = "green3", lwd = 2)
  points(res1maj$means$mean.r[1], res1maj$means$mean.r[2], pch = 5,
         col = "magenta2", lwd = 2)
  lines(ellipseCtr_ref, col = "blue3")
  lines(ellipseCtr_min, col = "green3")
  lines(ellipseCtr_maj, col = "magenta2")
  rect(xleft = t_multiple * -sqrt(diag(res1ref$cov))["alpha"] +
         res1ref$means$mean.r["alpha"],
       ybottom = t_multiple * -sqrt(diag(res1ref$cov))["beta"] +
         res1ref$means$mean.r["beta"],
       xright = t_multiple * sqrt(diag(res1ref$cov))["alpha"] +
         res1ref$means$mean.r["alpha"],
       ytop = t_multiple * sqrt(diag(res1ref$cov))["beta"] +
         res1ref$means$mean.r["beta"])

  # Highlight the points detected to lie outside the confidence region
  points(d_dat[is_out, t_param], pch = 3, col = "gold")
}

Cited Literature

  1. Shah, V. P., Tsong, Y., Sathe, P., and Liu, J. P. In vitro dissolution profile comparison - statistics and analysis of the similarity factor, f~2~. Pharm Res. 1998; 15(6): 889-896.\cr \doi{10.1023/A:1011976615750}
  2. Tsong, Y., Hammerstrom, T., Sathe, P.M., and Shah, V.P. Statistical assessment of mean differences between two dissolution data sets. Drug Inf J. 1996; 30: 1105-1112.\cr\doi{10.1177/009286159603000427}
  3. Hoffelder, T. Highly variable dissolution profiles. Comparison of T^2^-test for equivalence and f~2~ based methods. Pharm Ind. 2016; 78(4): 587-592.\cr \url{https://www.ecv.de/suse_item.php?suseId=Z|pi|8430}
  4. Martinez, M.N., and Zhao, X. A simple approach for comparing the in vitro dissolution profiles of highly variable drug products: a proposal. AAPS Journal. 2018; 20: 78.\cr \doi{10.1208/s12248-018-0238-1}
  5. Sathe, P.M., Tsong, Y., and Shah, V.P. In-Vitro dissolution profile comparison: Statistics and analysis, model dependent approach. Pharm Res. 1996; 13(12): 1799-1803.\cr \doi{10.1023/a:1016020822093}
  6. Tsong, Y., Hammerstrom, T., Chen, J.J. Multipoint dissolution specification and acceptance sampling rule based on profile modeling and principal component analysis. J Biopharm Stat. 1997; 7(3): 423-439.\cr \doi{10.1080/10543409708835198}

Contact

Pius Dahinden, Tillotts Pharma AG




piusdahinden/disprofas documentation built on April 17, 2025, 11:45 p.m.