On this page
13.1 Long-Term Stability
Statistical model
The expiration time or shelf time is defined through a long-term stability study. To determine the shelf life of a pharmaceutical product, reference is made to the Resolution of the Collegiate Board of Directors RDC Nº318 and the guide Q1E do ICH. These guides recommend using at least 3 manufacturing batches to include batch-to-batch variation in determining shelf life.
Although it is possible to calculate a shelf time for each batch individually, it is desirable to establish a single shelf time valid for all manufacturing batches. Before combining stability data, the similarity between batches needs to be assessed. The statistical technique used for this evaluation is ANCOVA (Analysis of Covariance), where time is the covariate and tests whether there is a significant difference or variation in the trend curves between batches.
Therefore, to define the study model that evaluates the similarity between batches, it is first necessary to define the batch planning matrix. Suppose you have $K$ lots under analysis, through a dummy variable, we have the following planning matrix with $K-1$ columns: $$ \begin{array} {c}\mathrm{Lote~1}\to \cr \mathrm{Lote~2}\to \cr \mathrm{Lote~3}\to \cr \mathrm{Lote~4}\to \cr \vdots \cr \mathrm{Lote~K}\to \end{array}\quad \begin{bmatrix} 0 & 0 & 0 & 0 & \cdots & 0 \cr 1 & 0 & 0 & 0 & \cdots & 0 \cr 0 & 1 & 0 & 0 & \cdots & 0 \cr 0 & 0 & 1 & 0 & \cdots & 0 \cr & & \vdots & & \ddots & \vdots \cr 0 & 0 & 0 & 0 & \cdots & 1 \end{bmatrix} _{K \times n} $$
For each batch $ i $, there is $ n_i $ observations related to the times $ t_{ij} $ and interactions between time and batches, with $ i=1,2,…,K $ and $ j=1,…,n_i $. Therefore, the linear regression model can be defined:
$$ \begin{equation} Y = X \beta + \varepsilon, \tag{1} \end{equation} $$
where:
Figure 13.1.1: Matrix model
$$ \begin{align*} Y&=\begin{bmatrix} y_1 \cr y_2 \cr y_3 \cr \vdots \cr y_n \end{bmatrix}; \beta=\begin{bmatrix} \beta_0 \cr \beta_1 \cr \beta_2 \cr \beta_3 \cr \vdots \cr \beta_{2 K-1} \end{bmatrix}; \varepsilon=\begin{bmatrix} \varepsilon_1 \cr \varepsilon_2 \cr \varepsilon_3 \cr \vdots \cr \varepsilon_n \end{bmatrix} \hspace{5cm} \end{align*} $$
where $X$ is a matrix of $n \times 2K$ and $ n = \sum_{i=1}^K n_i $. Model (1) has $p=2K-1$ parameters.
It is admitted that experimental errors $ \varepsilon_{ij} $ are independent and identically distributed with zero mean and variance $ \sigma^2 $.
Then, you can interpret the model separately by batch:
-
Lot 1: $Y_{1j} = \beta_0 + \beta_1\cdot t_{1j}+\varepsilon_{1j}$
-
Lot 2: $Y_{n2} = (\beta_0 + \beta_2)+(\beta_1 + \beta_{K+1})\cdot t_{n2}+\varepsilon_{n2}$
-
Lot 3: $Y_{n3} =(\beta_0 + \beta_3)+(\beta_1 + \beta_{K+2})\cdot t_{n3}+\varepsilon_{n3}$
$\vdots$
-
Lot K: $Y_{nK} =(\beta_0 + \beta_K)+(\beta_1 + \beta_{2K-1})\cdot t_{nK}+\varepsilon_{nK}$
in which $ Y_{n_i}, t_{n_i} $ and $ \varepsilon_{n_i}$ are the partitions of the vectors per batch, with $ i=1,2,…,K $,
Parameter Estimation
Parameter estimation $\beta$ in model (1) it is obtained via the least squares method in the form:
$$ \begin{align*} \varepsilon^\top\varepsilon &= \left(Y - X\beta\right)^\top\left(Y-X\beta\right) \cr &= Y^\top Y -2Y^\top X\beta + \beta^\top X^\top X\beta . &= Y^\top Y -2 \beta^\top X^\top Y + \beta^\top X^\top X\beta. \end{align*} $$
To find the minimum of $\varepsilon^\top\varepsilon$ is derived as a function of $\beta$ and equals zero: $$ \dfrac{\partial\varepsilon^\top\varepsilon}{\partial\beta} = 0 - 2X^\top Y + 2X^\top X \beta = 0, $$ Therefore, the solution is to estimate the $\beta$ given by $$ \begin{equation} \widehat{\beta} = \left(X^\top X\right)^{-1}X^\top Y. \tag{2} \end{equation} $$
Therefore, the fit of the regression model and the model residual vector are defined by:
$$\widehat{Y} = X\widehat{\beta}\quad \quad \text{e} \quad \quad e = Y - \widehat{Y} .$$
Properties
For the defined regression model, the following properties are available:
- $\mathbb{E}\left[\widehat{\beta}\right] = \beta$;
- $Cov\left[\widehat{\beta}\right] = \sigma^2\left(X^\top X\right)^{-1}$;
- $SQE = Y^\top\left(\mathbb{I} - X\left(X^\top X\right)^{-1}X^\top\right)Y = Y^\top\left(\mathbb{I} - \mathbb{H}\right)Y$;
- $\widehat{\sigma}^2 = QME = \dfrac{SQE}{n - 2K}$.
In matrix notation, the following expressions are valid for the sum of squares:
- $SQT = Y^\top Y - \dfrac{Y^\top \mathbb{J} Y}{n}$;
- $SQR = Y^\top\left(\mathbb{H} - \dfrac{\mathbb{J}}{n}\right)Y$;
- $SQE = Y^\top Y - \widehat{\beta}^\top X^\top Y$;
being that $\mathbb{I}$ represents the identity matrix, $\mathbb{H} = X\left(X^\top X\right)^{-1}X^\top$ the matrix Hat and $\mathbb{J} = \begin{bmatrix} 1 & \cdots & 1 \cr \vdots & \ddots & \vdots \cr 1 & \cdots & 1 \end{bmatrix}$.
Curve Comparison Tests
The similarity between lots is assessed by testing hypotheses of equality of intercepts and equality of angular coefficients of the lots' trend curves. The FDA guidance recommends a significance level of $0,25$ to complete the tests.
The model containing Time, Lot and the interaction between these two factors is adjusted. In this model, if the equality of angular coefficients (parallelism) is rejected, the complete model is adopted, that is, the regression model will contain the covariates Time, Lot and the interaction Time and Lot. If the equality of angular coefficients is not rejected, the model is adjusted considering Time and Lot. After this adjustment, the significance of the Lot factor is checked, if it is significant, the model considering Time and Lot is adopted, if it is not significant, only a model considering Time is adopted. This approach is known as sequential ANOVA.
sequential ANOVA
Given a complete linear regression model, considering all factors, that is, a model with Time, Batch and the interaction between these two factors:
$$ \begin{equation} \begin{split} Y = \beta_0 + \beta_1 \cdot\text{Tempo} + \beta_2 \cdot \text{Lote2} + \cdots + \beta_{k} \cdot\text{LoteK} + \hspace{2cm} \cr \beta_{k + 1} \cdot\text{Tempo} \cdot \text{Lote1} + \cdots + \beta_{2K-1} \cdot\text{Tempo} \cdot\text{LoteK} + \epsilon \end{split} \tag{3} \end{equation} $$
To evaluate this model, an ANOVA is carried out and a test is carried out $F$ partial for the following hypotheses: $$ \begin{cases} H_{0}:\beta_{K+1}=\beta_{K+2}=\cdots=\beta_{2K-1}=0;\cr H_{1}: \text{Pelo menos um é diferente}. \end{cases} $$
The hypotheses above concern the parallelism of the regression lines, in other words, if the null hypothesis ($H_0$) is not rejected, it is possible to say that all lots have the same trend.
Case $H_0$ is rejected, it is concluded that there is no parallelism. In this case, the approach with the complete model as presented in equation (3) is carried out. Case $H_0$ is not rejected, a model containing only Time and Lot is fitted, without considering the interaction between them. In other terms:
$$ \begin{equation} Y = \beta_0 + \beta_1 \cdot \text{Tempo} + \beta_2 \cdot \text{Lote2} + \cdots + \beta_{k}\cdot \text{LoteK} + \epsilon \tag{4} \end{equation} $$
Now, in the model above, the significance of the batch factor is evaluated, that is, through the test $F$ partial the following hypotheses are evaluated: $$ \begin{cases} H_{0}:\beta_2=\beta_3=\cdots=\beta_K=0;\cr H_{1}: \text{Pelo menos um é diferente}. \end{cases} $$
The hypotheses above refer to the intercept of the regression lines. In other words, if the null hypothesis is not rejected, it can be said that all lots have the same intercept.
If the null hypothesis is rejected, the model without interaction will be used, as presented in equation (4). If the null hypothesis is not rejected, a single model will be considered for all data without the Lot factor, that is, the following model:
$$ \begin{equation} Y = \beta_0 + \beta_1 \cdot \text{Tempo} + \epsilon. \tag{5} \end{equation} $$
Test for equality of angular coefficients (Parallelism)
Firstly, we are interested in testing whether or not there is a difference between the angular coefficients of each model, that is, whether the fitted lines are parallel or not. If there is no significant difference between the coefficients, the subset values of the parameter vector $ \beta $ which correspond to a change in the slope, i.e. $ \beta_{K+1},\beta_{K+2},\cdots,\beta_{2K-1} $, are null and the fitted lines are parallel. Therefore, we want to test the hypotheses: $$ \begin{cases} H_{0a}:\beta_{K+1}=\beta_{K+2}=\cdots=\beta_{2K-1}=0;\cr H_{1a}: \text{Pelo menos um é diferente}. \end{cases} $$
In Figura 13.1.2, we can see an illustrative example in which, in the first case, we do not reject $ H_{0a} $ because there is parallelism between the adjusted straight lines and, therefore, the angular coefficients are equal and the values of $ \beta_{K+1},\beta_{K+2},\cdots,\beta_{2K-1} $ are null. In the second case, we reject $ H_{0a} $ because we conclude that the fitted lines are not parallel and, therefore, the angular coefficients are different and the parameters $ \beta_{K+1},\beta_{K+2},\cdots,\beta_{2K-1} $ are significant.
Figure 13.1.2: Image illustrating the parallelism test hypotheses
As we want to determine whether a subset of parameters are significant to the regression model, we need to use the Test $F$ Partial. For this, we consider the following partition of the parameter vector $\beta$:
$$\beta=\begin{bmatrix}\beta_{0}\cr \beta_{1}\cr \vdots\cr\beta_{2K-1}\end{bmatrix}=\begin{bmatrix}\beta_{R2}\cr\beta_{R2^c}\end{bmatrix}.$$
in which $ \beta_{R2^c} $ are the parameters we are interested in testing and $ \beta_{R2} $ are the other parameters of the vector $ \beta $:
$$\beta_{R2}=\begin{bmatrix}\beta_{0}\cr\beta_{1}\cr\vdots\cr\beta_{K}\end{bmatrix}\quad{e}\quad\beta_{R2^c}=\begin{bmatrix}\beta_{K+1}\cr\beta_{K+2}\cr\vdots\cr\beta_{2K-1}\end{bmatrix}.$$
Thus, we also partition the matrix $ X $, so that the partition $ X_{R2} $ is associated with the vectors of $ \beta_{R2} $ and $ X_{R2^c} $ to the values of $ \beta_{R2^c} $, as follows:
$$X=[X_{R2}\quad X_{R2^c}]$$
where: $$ X_{R_2}=\left[\begin{array}{cccccccc} 1 & t_{11} & 0 & 0 & 0 & 0 & \cdots & 0 \cr 1 & t_{12} & 0 & 0 & 0 & 0 & \cdots & 0 \cr 1 & t_{13} & 0 & 0 & 0 & 0 & \cdots & 0 \cr \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \cdots & \vdots \cr 1 & t_{1 n_1} & 0 & 0 & 0 & 0 & \cdots & 0 \cr 1 & t_{21} & 1 & 0 & 0 & 0 & \cdots & 0 \cr 1 & t_{22} & 1 & 0 & 0 & 0 & \cdots & 0 \cr \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \cdots & \vdots \cr 1 & t_{2 n_2} & 1 & 0 & 0 & 0 & \cdots & 0 \cr \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \cdots & \vdots \cr 1 & t_{K n_K} & 0 & 0 & 0 & 0 & \cdots & 1 \end{array}\right] \quad \text { e } \quad X_{R_2^C}=\left[\begin{array}{cclc} 0 & 0 & \cdots & 0 \cr 0 & 0 & \cdots & 0 \cr 0 & 0 & \cdots & 0 \cr \vdots & \vdots & \cdots & \vdots \cr 0 & 0 & \cdots & 0 \cr t_{21} & 0 & \cdots & 0 \cr t_{22} & 0 & \cdots & 0 \cr \vdots & \vdots & \cdots & \vdots \cr t_{2 n_2} & 0 & \cdots & 0 \cr \vdots & \vdots & \cdots & \vdots \cr 0 & 0 & \cdots & t_{K n_K} \end{array}\right]. $$
We are only interested in how much the subset $ {\beta_{K+1},\beta_{K+2},\cdots,\beta_{2K-1}} $ influences the regression, that is, we want to test the additional sum of the square of $ \beta_{R2^c}=\begin{bmatrix}\beta_{K+1}\cr\beta_{K+2}\cr\cdots\cr\beta_{2K-1}\end{bmatrix} $ on the model you already have $ \beta_{R2}=\begin{bmatrix}\beta_{0}\cr\beta_{1}\cr\cdots\cr\beta_{K}\end{bmatrix}$. The sum of squares referring to the parameters of the null hypothesis is given by: $$ \begin{align*} SQR(\beta_{R2^c} \mid \beta_{R2})&= SQR(\beta_{K+1},\beta_{K+2},\cdots,\beta_{2K-1} \mid \beta_{0}, \beta_{1}, \cdots, \beta_{K})\cr &= SQR(\beta) - SQR(\beta_{0}, \beta_{1}, \cdots, \beta_{K})\cr &= SQR(\beta) - SQR(\beta_{R2}) \end{align*} $$
To find $ SQR(\beta_{R2}) $, we will consider the model under the null hypothesis $ H_{0a} $, assuming the values of $ \beta_{R2^c} $ as null. We call this model reduced: $$Y = X_{R2}\beta_{R2} + \varepsilon$$
Calculating the sum of squares of the regression of the reduced model we have:
$$SQR\left(\beta_{R2}\right) = \widehat{\beta}_{R2}^\top X_{R2}^\top Y - \dfrac{Y^{\top}\mathbb{J}Y}{n}.$$
A $SQR\left(\beta_{R2^C} \mid \beta_{R2}\right) $ owns $K-1$ degrees of freedom. In this way, the test statistics can be calculated $F$ by:
$$F_P = \dfrac{\dfrac{SQR\left(\beta_{R2^C} \mid \beta_{R2}\right)}{K-1}}{QME} \sim F_{(K-1, n-2K)}$$ in which $F_P$ has distribution $F$ with $K-1$ and $n-2K$ degrees of freedom. O $p-$ test value is given by:
$$p-\text{valor} = \mathbb{P}\left(F_{(K-1,n-2K)} > F_P \right | H_0).$$
Figure 13.1.3: Image illustrating the p-value for the parallelism test
Adopting the significance level of $ \alpha = 0,25 $, if
- $p-$value $> \alpha $ we do not reject the null hypothesis and conclude that the slopes are equal.
- $p-$value $\leq \alpha $ we reject the null hypothesis and conclude that the slopes are different.
Test for equality of intercepts
If the null hypothesis is rejected in the parallelism test, the complete model is addressed in Eq. (3) and, therefore, the intercept equality test is not evaluated. Otherwise, we are interested in testing whether or not there is a difference between the model intercepts for each batch. If there is no difference, the subset values $ {\beta_2,\beta_3,\cdots,\beta_K} $ of the parameter vector $ \beta $, corresponding to the intercepts, are null. Therefore, we are interested in testing the hypotheses: $$ \begin{cases} H_{0b}:\beta_2=\beta_3=\cdots=\beta_K=0;\cr H_{1b}: \text{Pelo menos um é diferente}. \end{cases} $$
Figure 13.1.4: Image illustrating the hypotheses of the intercept equality test
In Figura 13.1.4, we can see an illustrative example in which, in the first case we would not reject $ H_{0b} $, as the intercepts are equal, and in the second case we would reject the null hypothesis, as the lots significantly influence the intercept of each model.
When verifying these hypotheses, we must then use the Test $F$ Partial as we did in the parallelism test. We consider the following partition of the parameter vector $ \beta $: $$\beta=\begin{bmatrix}\beta_{R1}\cr\beta_{R1^c}\end{bmatrix}$$ in which $ \beta_{R1^c} $ are the parameters we are interested in testing and $ \beta_{R1} $ are the other parameters of the vector $ \beta $. In the case of the Intercept test with $K$ lots we have: $$\beta_{R1}=\begin{bmatrix}\beta_{0}\cr\beta_{1}\end{bmatrix} \quad \text{e} \quad \beta_{R1^c}=\begin{bmatrix}\beta_{2}\cr\beta_{3}\cr\vdots\cr\beta_{K}\end{bmatrix}$$
We partition the matrix $X$ so that the partition $ X_{R1} $ is related to the subset of $ \beta_{R1} $ and $ X_{R1^c} $ related to the subset of $ \beta_{R1^c}$
Thus, we have: $$X=[X_{R1}\quad X_{R1^c}]$$ in which $$ X_{R_1}=\left[\begin{array}{cc} 1 & t_{11} \cr 1 & t_{12} \cr 1 & t_{13} \cr \vdots & \vdots \cr 1 & t_{1 n_1} \cr 1 & t_{21} \cr 1 & t_{22} \cr \vdots & \vdots \cr 1 & t_{2 n_2} \cr \vdots & \vdots \cr 1 & t_{K n_K} \end{array}\right] \quad \text { e } \quad X_{R_1^C}=\left[\begin{array}{cccccc} 0 & 0 & 0 & 0 & \cdots & 0 \cr 0 & 0 & 0 & 0 & \cdots & 0 \cr 0 & 0 & 0 & 0 & \cdots & 0 \cr \vdots & \vdots & \vdots & \vdots & \cdots & \vdots \cr 0 & 0 & 0 & 0 & \cdots & 0 \cr 1 & 0 & 0 & 0 & \cdots & 0 \cr 1 & 0 & 0 & 0 & \cdots & 0 \cr \vdots & \vdots & \vdots & \vdots & \cdots & \vdots \cr 1 & 0 & 0 & 0 & \cdots & 0 \cr \vdots & \vdots & \vdots & \vdots & \cdots & \vdots \cr 0 & 0 & 0 & 0 & \cdots & 1 \end{array}\right] $$
We are interested in how much the subset $\beta_2, \cdots, \beta_K$ influences the regression, that is, we want to test the additional sum of the square of $ \beta_{R1^c}=\begin{bmatrix}\beta_{2}\cr\vdots\cr\beta_{K}\end{bmatrix}$ on the model you already have $ \beta_{R1}=\begin{bmatrix}\beta_{0}\cr\beta_{1}\end{bmatrix} $. The sum of squares referring to the parameters of the $H_{0b}$ is given by: $$ \begin{align*} SQR(\beta_{R1^C} \mid \beta_{R1}) &= SQR(\beta_2,\cdots,\beta_K \mid \beta_0, \beta_1)\cr &= SQR(\beta_{R2}) - SQR(\beta_{R1}) \end{align*} $$
To find $ SQR(\beta_{R1}) $, we will consider the model under the null hypothesis $ H_{0b} $, assuming the values of $ \beta_{R1^c} $ as null. We call this model reduced: $$Y = X_{R1}\beta_{R1} + \varepsilon.$$ Calculating the sum of squares of the regression of the reduced model we have: $$SQR\left(\beta_{R1}\right) = \widehat{\beta}_{R1}^\top X_{R1}^\top Y - \dfrac{Y^{\top}\mathbb{J}Y}{n}.$$
A $SQR(\beta_{R1^C} \mid \beta_{R1})$ owns $K-1$ degrees of freedom. In this way, the test statistic can be calculated $F$ by: $$F_I = \dfrac{\dfrac{SQR(\beta_{R1^C} \mid \beta_{R1})}{K-1}}{QME} \sim F_{(K-1, n-2K)}$$ in which $F_I$ has distribution $F$ with $K-1$ and $n-K-1$ degrees of freedom and the $p-$test value given by:
$$p-\text{valor} = \mathbb{P}\left(F_{(K-1,n-K-1)} > F_I \right | H_0)$$
Figure 13.1.5: Illustrative image of the $p-$value for the intercept equality test
Adopting the significance level of $ \alpha = 0,25$, we have to:
-
$p-$value $> \alpha $ we do not reject the null hypothesis and conclude that the intercepts are the same for all batches.
-
$p-$value $\leq \alpha $ we reject the null hypothesis and conclude that the intercepts are not the same for all batches.
Shelf time
Shelf time is the time at which the confidence interval for the mean response touches the specification limit. To determine the shelf life, it is necessary to determine the time at which the confidence interval (95%) for the average response reaches the specification. Based on the results of the intercept and parallelism hypothesis tests, we can have three possible scenarios:
Scenario 1: Intercepts and angular coefficients equal for all lots (Pooling data). In this case, only a simple regression model is fitted, disregarding the batches;
Scenario 2: Different intercepts but equal angular coefficients for all lots. In this scenario, only one regression model is adjusted but the intercept value is changed for each batch;
Scenario 3: Different angular coefficients for all lots. In this scenario, only one regression model is adjusted but the value of the angular coefficient is changed for each batch.
Figure 13.1.6: Flowchart of stability analysis and shelf life determination
Confidence interval
To calculate the confidence interval, in the scenario 1 there is only one regression model with data from all batches. $$ IC\left(\mu_{Y \mid x}, 100(1-\alpha)\ \char37 \right) = \left[ \widehat{\beta}_0 + \widehat{\beta}_1 x_t \pm \widehat{\sigma}t_{(n-2)}\sqrt{\frac{1}{n}+\frac{\left(x_t - \bar{x}\right)^2}{S_{xx}}}\right] $$
where:
- $\mu_{Y|x}$: is the average response of $Y$ given $x$ in time $t$;
- $x_t$: is the time in which you want to make the forecast and $\bar{x}$ is the average of the model times;
- $\widehat{\beta}_0$ and $\widehat{\beta}_1$: are the estimates of the model parameters;
- $\widehat{\sigma} = \frac{1}{n-2}\left(S_{yy} - \frac{S_{xy}^2}{S_{xx}}\right)$: is the estimate of the model’s standard deviation;
- $S_{xx} = \sum_{i=1}^n\left(x_i - \bar{x}\right)^2; S_{yy} = \sum_{i=1}^n\left(y_i - \bar{y}\right)^2$ and $ S_{xy} = \sum_{i=1}^n\left(x_i - \bar{x}\right)\left(y_i - \bar{y}\right)$;
- $t_{n-2}$: is the percentile of $\left(1-\frac{\alpha}{2}\right)%$ from the t-student distribution with $n-2$ degrees of freedom.
Us scenarios 2 and 3 It is necessary to use matrix notation to estimate the confidence interval. Consider a vector of values $x_i = \left[1, x_{i1}, x_{i2}, …, x_{ip}\right]$ in which $x_i$ is the time for each batch in which you want to estimate the confidence interval for the adjustment, in other words, the $x_i$ is the $i$-th vector of the regression design matrix $X$. So,
$$IC\left(\mu_{Y|x}^i, 100(1-\alpha) \ \char37 \right) = \left[ x_i^\top \widehat{\beta} \pm t_{(n-p-1)} \widehat{\sigma} \sqrt{x_i^\top\left(X^\top X\right)^{-1}x_i}\right]$$ where:
- $\mu_{Y|x}^i$: is the average response time of $Y$ given $x$ for $i$-th observation;
- $\widehat{\beta}$: is the vector of regression parameter estimates;
- $p$: number of covariates used in the regression model;
- $\widehat{\sigma} = \sqrt{\frac{SQE}{n-p-1}} = \sqrt{QME}$: is the estimate of the model’s standard deviation;
- $t_{n-p-1}$: is the percentile of $\left(1-\frac{\alpha}{2}\right)%$ from the t-student distribution with $n-p-1$ degrees of freedom;
- $x_i$: vector referring to $i$-th line of the design matrix;
- $X$: regression design matrix.
Determination of shelf life
Therefore, to calculate shelf time, the FDA recommends the following procedure Figura 13.1.6:
- Initially, a set of information is needed that respects the basic requirements mentioned above. In this data set, it is always necessary to use the level of concentration (Content) of the pharmaceutical product as a percentage measure;
- The ANCOVA model is developed to test homogeneity between batches, that is, curve comparison tests are carried out;
- The indicated model is adjusted depending on the result obtained in the curve comparison test, there are three possible situations:
- A single model for all batches (in which case no significant difference was detected at a significance level of 0.25 between batches);
- One model per batch, changing only the intercept value (a situation in which only the intercept equality test is significant at the 0.25 level);
- Different models for each batch (scenario in which the parallelism test is rejected at a significance level of 0.25);
- Acceptance limits are set for the pharmaceutical product under study, usually the lower limit is set at 90% and the upper at 110%. In this step it is also decided which of the limits will need to be used: only lower, upper or both. This decision is made by the analyst and depends on the pharmaceutical product under study;
- Using the adjusted model, a prediction is made with a 95% confidence interval (this value can be changed depending on the study) for the next few months in which the validity of the product is to be checked;
- For the months defined in the previous item, it is checked whether the estimated confidence interval exceeds the established acceptance limits. The month before the acceptance limit is exceeded by the confidence interval is the Shelf Time for the model/batch in question;
- Steps 5 and 6 are repeated for all adjusted models (if there is more than one model), the Shelf Time of the pharmaceutical product will be the shortest time found among all the models studied.
In some studies, there are cases in which the estimated confidence interval does not exceed the established detection limits, in these cases it is said that it was not possible to find the shipping time for the period evaluated in the study.
Release Limits
Release limits will be verified by calculating IRL. The IRL (Internal Release Limits) is a specification range calculated based on process variations (production and analysis) and changes undergone by the product throughout the long-term stability study. By comparing the IRL with the results obtained and with the current release specifications, it is possible to verify that the products meet the specifications throughout their useful life.
The calculations take into account the specification limits, the degradation of the product over time determined by the long-term stability study (trend) and the expected variation resulting from the process and analyzes (confidence band). When calculating release limits, there are three possible scenarios:
Figure 13.1.7: Flowchart for calculating release limits
Meaningful Interaction
The Trend will be calculated based on the angular coefficient with the greatest magnitude in module. Be $(\beta_1 + \beta_{K+1}, \beta_1 + \beta_{K+2}, …, \beta_1 + \beta_{2K-1})$ the angular coefficients for the different lots. Consider $$ \beta_M = \max \lbrace |\beta_1 + \beta_{K+1}|, | \beta_1 + \beta_{K+2}|, …, |\beta_1 + \beta_{2k-1}| \rbrace, $$
$t$ the shelf life obtained and $BC$ the confidence band at the point $x_t$.
Then the release limits are calculated by $$ LSL = \begin{cases} LSE - \beta_M \cdot t - BC, \qquad \text{se $\beta_M > 0$};\cr LSE - BC, \qquad \qquad \qquad \text{se $\beta_M \leq 0$}. \end{cases} $$
$$ \begin{equation*} LIL = \begin{cases} LIE + \beta_M \cdot t + BC, \qquad \text{se $\beta_M < 0$};\cr LIE + BC, \qquad \qquad \qquad \text{se $\beta_M \geq 0$}.\end{cases} \end{equation*} $$ where:
- $BC = t_{(1-\alpha/2, n-p-1)} \hat{\sigma} \sqrt{x_t^\top (X^\top X)^{-1}x_t}$: represents half the width of the confidence interval, $X$ the model design matrix;
- $t$: shelf life obtained;
- $x_t$: matrix vector $X$ in time $t$ and for the batch with the highest angular coefficient in module.
Non-Significant Interaction and Significant Time
In this case, the lots do not interact with time, that is, there is a single angular coefficient. If the time covariate is significant, the calculation of release limits must take into account the angular coefficient associated with time. $\beta_{1}$, the shelf time obtained $t$ and the band of trust $BC$ associated with time $t$. $$ \begin{equation*} LSL = \begin{cases} LSE - \beta_1 \cdot t - BC, \qquad \text{se $\beta_1 > 0$};\cr LSE - BC, \qquad \qquad \qquad \text{se $\beta_1 \leq 0$}.\end{cases} \end{equation*} $$
$$ \begin{equation*} LIL = \begin{cases} LIE + \beta_1 \cdot t + BC, \qquad \text{se $\beta_1 < 0$};\cr LIE + BC, \qquad \qquad \qquad \text{se $\beta_1 \geq 0$}.\end{cases} \end{equation*} $$ where:
- $BC = t_{(1-\alpha/2, n-p-1)} \hat{\sigma} \sqrt{x_t^\top (X^\top X)^{-1}x_t}$: represents half the width of the confidence interval, $X$ the model design matrix;
- $t$: shelf life obtained;
- $x_t$: For scenario 2, represents the matrix vector $X$ in time $t$ and for the first batch that has the most data. In case of scenario 1, there is only $x_t = [1, t]^\top$.
Non-Significant Interaction and Non-Significant Time
When time is not significant, the release limit will be calculated without the Trend.
$$LSL = LSE - BC$$
$$LIL = LIE + BC$$
where:
- $BC = t_{(1-\alpha/2, n-p-1)} \hat{\sigma} \sqrt{x_t^\top (X^\top X)^{-1}x_t}$: represents half the width of the confidence interval, $X$ the model design matrix;
- $x_t$: For scenario 2, represents the matrix vector $X$ in time $t$ and for the first batch that has the most data. In case of scenario 1, there is only $x_t = [1, t]^\top$. $t$ is the shelf time obtained.
Caption:
- $LSL$: Upper release limit
- $LIL$: Lower release limit
- $LSE$: Upper specification limit
- $LIE$: Lower specification limit
When there is only one specification limit, the release limit to be presented will be the corresponding one. The only difference in the calculations presented above is that the quantile of the t-student distribution will be with respect to $\alpha$ and no more $\frac{\alpha}{2}$.
The flowchart in Figura 13.1.7 illustrates the passages for the release specification calculations described above.
Off Trend
As recommended in RDC 318, out-of-trend results (that is, those results that, during the trend analysis, were not consistent with the observed behavior) must have the causes for the deviation presented. The reason for this request is the need to evaluate the model as a whole and avoid distortions related to various errors, which could compromise the statistical analysis. To demonstrate that a given result is outside the trend, an appropriate statistical test is recommended to identify outliers.
Outliers or influential points are identified in the model’s Residual Analysis. Waste that is defined as $ e_i=Y_i-\widehat{Y}_i $, which corresponds to the difference between the observed value and the value adjusted by the model. However, for better detection of outliers in $Y$, several “standardized” forms have been proposed. In the case of the stability study, we will use standardized residuals.
There are numerous ways to express the residue vector $e$ that will be useful to us. $$e=Y-\widehat{Y}=Y-X\widehat{\beta}=Y - \mathbb{H}Y=(I-\mathbb{H})Y.$$
The covariance matrix of the residuals is,
$$Cov[e]=Cov[(I-\mathbb{H})Y]=(I-\mathbb{H})Var(Y)(I-\mathbb{H})^\top$$ $$=\sigma^2(I-\mathbb{H})(I-\mathbb{H})^\top=\sigma^2(I-\mathbb{H}),$$
in which $ \mathbb{H}=X(X^\top X)^{-1} X^\top $ is the hat matrix Hat and $ X $ the model matrix.
Thus, we define the standardized residuals by
$$r_{i}=\frac{e_i}{\sqrt{QME(1-h_{ii})}},~i=1,2,\ldots,n,$$
with $ \hat{\sigma}^2=QME $ and $ h_{ii} $ the $ i $-th element of the hat array $\mathbb{H}$.
Standardized residuals have constant variances $ Var(r_i)=1 $ which consequently makes the search for outliers, which are observations distant from the others, very practical. In general, observations with a standardized residual outside the range $ -3\leq r_i \leq 3 $ must be considered outliers or influential points.
A better way to visualize the behavior of model residuals is through graphical analysis. After calculating the standardized residuals, we constructed a graph in which the residual values are presented according to the adjusted values.
Example 1 - Equal angular coefficients and equal intercepts
Consider an experiment under study in Table 13.1.1, in which the degradation of a drug was measured for 3 batches.
| Lot 1 | Lot 2 | Lot 3 | |||
|---|---|---|---|---|---|
| Time | Measurements | Time | Measurements | Time | Measurements |
| 0 | 97,6827 | 0 | 102,0645 | 0 | 102,6337 |
| 3 | 104,4361 | 3 | 95,6986 | 3 | 102,2354 |
| 6 | 101,4657 | 6 | 95,0475 | 6 | 107,4803 |
| 9 | 101,2829 | 9 | 100,6914 | 9 | 99,3431 |
| 12 | 101,4556 | 12 | 96,7143 | 12 | 101,1194 |
| 18 | 96,7930 | 18 | 101,9347 | 18 | 100,1674 |
| 24 | 98,4863 | 24 | 101,3223 | 24 | 97,2033 |
| 36 | 104,8448 | 36 | 102,3533 |
Table 13.1.1: Drug degradation data over time for different batches
So, to estimate the ANCOVA model, we have the following matrix $X$: $$ \begin{align*} X=& \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 \cr 1 & 3 & 0 & 0 & 0 & 0 \cr \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \cr 1 & 36 & 0 & 0 & 0 & 0 \cr 1 & 0 & 1 & 0 & 0 & 0 \cr \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \cr 1 & 24 & 1 & 0 & 24 & 0 \cr 1 & 0 & 0 & 1 & 0 & 0 \cr \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \cr 1 & 36 & 0 & 1 & 0 & 36 \cr \end{bmatrix};~ Y=\begin{bmatrix} 97,6827 \cr 104,4361 \cr \vdots \cr 104,8448 \cr 102,0645\cr \vdots\cr 101,3223\cr 102,6337\cr \vdots\cr 102,3533 \end{bmatrix}.\cr &\text{\scriptsize ~~(1) \quad (2) \quad (3) \quad (4) \quad (5) \quad (6) } \end{align*} $$
The interpretation is as follows
(1) Intercept,
(2) Time,
(3) Lot 2,
(4) Lot 3,
(5) Interaction between Time and Batch 2,
(6) Interaction between Time and Lot 3.
Using Equation 2, the estimate of the parameters of the complete model is given by: $$ \widehat{\beta}=\begin{bmatrix} 100,2107\cr 0,0441\cr -2,5291\cr 2,5551\cr 0,0907\cr -0,1329 \end{bmatrix}, $$ and the equation of the complete model $$ Y = 100,2107 + 0,0441 \cdot\text{Tempo} -2,5291 \cdot\text{Lote2} + 2,5551 \cdot\text{Lote3} + 0,0907 \cdot\text{Tempo} \cdot\text{Lote2} -0,1329 \cdot\text{Tempo} \cdot\text{Lote3}. $$
Thus, we have the equation for each batch:
- Lot 1: $Y = 100,2107 + 0,0441 \cdot \text{Tempo}$;
- Lot 2: $Y = (100,2107 -2,5291) + (0,0441 + 0,0907) \cdot \text{Tempo};$
- Lot 3: $Y = (100,2107 + 2,5551) + (0,0441 -0,1329) \cdot \text{Tempo}$.
And the sums of squares: $$SQT = Y^\top Y - \dfrac{Y^\top \mathbb{J} Y}{n} = 207,2812,$$
$$SQE=Y^\top Y - \widehat{\beta}^\top X^\top Y=165,3966,$$
$$SQR = SQT - SQE = 41,8846,$$
$$\widehat{\sigma}^2=QME=\dfrac{SQE}{n-2K}=\dfrac{165,3966}{23-6}=9,7292.$$
To apply the parallelism test, we have the following hypotheses: $$ \begin{cases} H_{0}:\beta_{4}=\beta_{5}=0;\cr H_{1}:\text{Pelo menos um é diferente}. \end{cases} $$
We partition the vector: $$\beta_{R2}=\begin{bmatrix}\beta_{0}\cr\beta_{1}\cr\beta_{2}\cr\beta_{3}\end{bmatrix}\quad{e}\quad\beta_{R2^c}=\begin{bmatrix}\beta_{4}\cr\beta_{5}\end{bmatrix} $$
The parameter estimate $ \beta_{R2} $ in the reduced model it is: $$ \widehat{\beta}_{R2} = \left( X_{R2}^{\top} X \right)^{-1} X_{R2}^{\top} Y = \begin{bmatrix} 100,7353\cr 0,0052\cr -1,7215\cr 0,7611 \end{bmatrix}. $$
Calculating the sum of squares of the regression of the reduced model we have:
$$SQR\left(\beta_{R2}\right) = \widehat{\beta}_{R2}^\top X_{R2}^\top Y - \dfrac{Y^{\top}\mathbb{J}Y}{n} = 24,2455$$
Then, the sum of squares referring to the parameters of the null hypothesis is given by:
$$SQR\left(\beta_{R2^c}|\beta_{R2}\right) = SQR\left(\beta\right) - SQR\left(\beta_{R2}\right) = 41,8846 - 24,2455 = 17,6391$$
In this way, the test statistic can be calculated $F$ by:
$$F_P = \dfrac{\dfrac{SQR\left(\beta_{R2^c} \mid \beta_{R2}\right)}{K-1}}{QME} = \dfrac{\dfrac{17,6391}{2}}{9,7292} = 0,9065$$ and the $p$-test value by: $$p-\text{valor} = \mathbb{P}\left(F_{(2, 17)} > 0,9065\right) = 0,4226.$$
How the $p-$value is greater than 0.25, we conclude that the angular coefficients are the same for the lots.
In the parallelism test, there is no evidence to reject the null hypothesis at the significance level of 0.25 and, therefore, it is concluded that the same angular coefficient can be adjusted for all lots. In this way, the model is adjusted with $\beta_{R2}$ described in Equation (4): $$Y = 100,7353 + 0,0052 \cdot \text{Tempo} -1,7215 \cdot \text{Lote2} + 0,7611 \cdot \text{Lote3} $$
Thus, we have the equation for each batch:
- Lot 1: $Y = 100,7353 + 0,0052 \cdot\text{Tempo}$;
- Lot 2: $Y = (100,7353 -1,7215) + 0,0052 \cdot \text{Tempo}$;
- Lot 3: $Y = (100,7353 + 0,7611) + 0,0052 \cdot \text{Tempo}$.
The sum of the squares of the residuals is: $$SQE=SQT - SQR(\beta_{R2}) =207,2812 - 24,2455 = 183,0357$$ and the variability estimate is given by
$$\widehat{\sigma}^2=QME=\dfrac{SQE}{n-K-1}=\frac{183,0357}{23-3-1}=9,6335.$$
To perform the intercept equality test, the Test $F$ partial, with the hypotheses: $$ \begin{cases} H_{0}:\beta_2=\beta_3=0;\cr H_{1}:\text{Pelo menos um é diferente}. \end{cases} $$ The subset of parameters of interest is given by: $$\beta_{R1}=\begin{bmatrix}\beta_{0}\cr\beta_{1}\end{bmatrix}\quad\text{e }\beta_{R1^c}=\begin{bmatrix}\beta_{2}\cr\beta_{3}\end{bmatrix}.$$
The parameter estimate $ \beta_{R1} $ becomes: $$\widehat{\beta}_{R1}=\left(X_{R1}^{\top}X_{R1}\right)^{-1}X_{R1}^{\top}Y =\begin{bmatrix}100,3110\cr0,0184\end{bmatrix} $$
For the Test $F$ partial, the sum of squares of the regression of the reduced model is first calculated: $$SQR\left(\beta_{R1}\right) = \widehat{\beta}_{R1}^\top X_{R1}^\top Y - \dfrac{Y^{\top}\mathbb{J}Y}{n} = 0,846$$
The sum of squares referring to the parameters of the null hypothesis: $$SQR\left(\beta_{R1^c}|\beta_{R1}\right) = SQR\left(\beta_{R2}\right) - SQR\left(\beta_{R1}\right) = 24,2455 - 0,846 = 23,4$$
So the test statistics $F$ calculated partial:
$$F_I = \dfrac{\dfrac{SQR\left(\beta_{R2^C} \mid \beta_{R1}\right)}{K-1}}{QME} = \dfrac{\dfrac{23,4}{2}}{9,6335} = 1,2145$$
The statistic $F_I$ has distribution $F$ with $2$ and $19$ degrees of freedom, the p-value is given by:
$$p-\text{valor} = \mathbb{P}\left(F_{(2,19)} > 1,2145\right) = 0,3189$$
How $p-\text{valor} = 0,3189 > 0,25$ The null hypothesis is not rejected and the conclusion is in favor of the hypothesis of equality of intercepts. We proceed with a simple linear regression model for the entire data set. Therefore, the model is given by:
$$Y = 100,311 + 0,0184 \cdot \text{Tempo}.$$
The example has the lower acceptance limit set at 90% and the upper limit at 110%. We wish to forecast the average response for, in this case, the next 36 months with a 95% confidence interval.
In the case of scenario 1, there is the same intercept for all batches and only one angular coefficient for the model, so the confidence interval is given by: $$IC\left(\mu_{Y|x}, 100(1-\alpha)\ \char37 \right) = \left[ \widehat{\beta}_0 + \widehat{\beta}_1 x_t \pm \widehat{\sigma}t_{(n-2)}\sqrt{\frac{1}{n}+\frac{\left(x_t - \bar{x}\right)^2}{S_{xx}}} \right] . $$
For the example, the limits of the time confidence interval (month) are calculated $ x_t = 36$: $$ \widehat{\beta}_0= 100,311 \text{ e } \widehat{\beta}_1 = 0,0184$$
$$SQE=SQT - SQR(\beta_{R1}) = 207,2812 - 0,846 = 206,435$$ $$\widehat{\sigma} = \sqrt{\widehat{\sigma}^2} =\sqrt{QME} = \sqrt{\dfrac{SQE}{23-2}} = \sqrt{\dfrac{206,435}{21}} = \sqrt{9,8302} = 3,1353$$
$$t_{(1-\alpha/2; 23-2)} = t_{(0,975; 21)} = 2,0796$$
$$\sqrt{\frac{1}{n}+\frac{\left(x_t - \bar{x}\right)^2}{S_{xx}}} = \sqrt{\frac{1}{23}+\frac{\left(36 - 12,5217\right)^2}{2495,739}} = 0,5141.$$
Finally, $$IC_{Inf}({y_{36}},95 \char37)= 100,311 + 0,0184 \cdot 36 - 3,1353\cdot2,0796\cdot0,5141 = 97,6214$$ $$IC_{Sup}({y_{36}},95\char37)= 100,311 + 0,0184 \cdot 36 + 3,1353\cdot2,0796\cdot0,5141= 104,3262$$
It has to $ IC_{Inf}({y_{36}},95\char37) = 97,6214 > 90 $ and $ IC_{Sup}({y_{36}},95\char37) = 104,3262 < 110 $, therefore the expiration date for a period of 36 months has not yet been found. In this way, with Action Stat, the trend analysis graph presented in Figura 13.1.8.
Figure 13.1.8: Trend analysis for the stability study
The following constants are used to calculate release limits:
$$\text{prazo de validade } t=36 \text{ e, portanto, } x_t = [1, 36]^\top$$ $$BC = t_{(1-\alpha/2, n-2)} \hat{\sigma} \sqrt{x_t^\top (X^\top X)^{-1}x_t} = 3,3524$$
As the time covariate was not significant for the example, the release limits are given by
$$ LSL = LSE - BC = 110 - 3,3524 = 106,648$$
$$ LIL = LIE + BC =90 + 3,3524 = 93,352.$$
With example 1, we calculated the residuals and built the graphs using the computational support of Action Stat.
The green dotted line represents the range $(-3,3)$ in Figura 13.1.9. As we have no residues outside the ranges, we did not identify extreme points or outliers for this case.
Figure 13.1.9: Waste analysis (Standardized)
Example 2 - Different intercepts and same angular coefficient
Consider an experiment in Table 13.1.2, in which the degradation of a drug was measured for 5 batches (BV, AJ, AN66, AV634, BZ8331). For each batch, the concentration was measured at different time levels. The objective is to evaluate the concentration stability of a drug, and evaluate the similarity between the degradation curves and calculate the shelf time.
| Time (months) | B.V. | A.J. | AN66 | AV634 | BZ8331 |
|---|---|---|---|---|---|
| 0 | 104,7 | 101,04 | 99,32 | 103,52 | 102,16 |
| 3 | 106,42 | 101,92 | 106,34 | 98,66 | |
| 6 | 105,04 | 99,78 | 104,26 | 102,62 | |
| 9 | 105,2 | 98,88 | 104,08 | 100,16 | |
| 12 | 104,54 | 104,74 | 99,6 | 102,44 | 98,54 |
| 18 | 102,02 | 99,66 | 102,38 | ||
| 24 | 105,54 | 101,56 | 98,26 | 104,18 | |
| 36 | 104,32 | 99,24 |
Table 13.1.2: Drug degradation data over time for different batches
Initially, it is necessary to estimate the complete ANCOVA model, such that: $$Y = X\beta + \varepsilon$$
If batch AJ is considered as a reference batch, the matrix $X$ is as follows: $$ \begin{align*} X=& \begin{bmatrix} 1 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \cr \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \cr 1 & 24 & 0 & 0 & 1 & 0 & 0 & 0 & 24 & 0 \cr 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \cr \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \cr 1 & 36 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \cr 1 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \cr \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \cr 1 & 36 & 1 & 0 & 0 & 0 & 36 & 0 & 0 & 0 \cr 1 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \cr \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \cr 1 & 24 & 0 & 1 & 0 & 0 & 0 & 24 & 0 & 0 \cr 1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \cr \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \cr 1 & 12 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 12 \cr \end{bmatrix};~ Y=\begin{bmatrix} 101,04 \cr \vdots \cr 104,32 \cr 99,32 \cr \vdots \cr 99,24 \cr 103,52 \cr \vdots\cr 104,8 \cr 104,18 \cr \vdots \cr 104,7 \cr 102,16\cr \vdots \cr 105,54 \end{bmatrix}\cr &\text{\scriptsize ~~(1) \quad(2) \quad(3) ~~(4) ~~~(5) ~~(6) \quad(7) \quad(8) \quad(9) \quad(10) } \end{align*} $$ (1) Intercept,
(2) Time,
(3) Lot AN66,
(4) Lot AV634,
(5) Lot BV,
(6) Lot BZ8331,
(7) Interaction between Time and Lot AN66,
(8) Interaction between Time and Lot AV634,
(9) Interaction between Time and Lot BV,
(10) Interaction between Time and Lot BZ8331.
In this way, the objective is to estimate the vector of parameters $\beta$ and find the ANCOVA model by:
$$\widehat{\beta} = \left(X^\top X\right)^{-1}X^\top Y = \begin{bmatrix} \widehat{\beta}_0; \widehat{\beta}_1; \widehat{\beta}_2; \widehat{\beta}_3; \widehat{\beta}_4; \widehat{\beta}_5; \widehat{\beta}_6; \widehat{\beta}_7; \widehat{\beta}_8; \widehat{\beta}_9 \end{bmatrix}^\top$$
It is known that the sum of squares of the error $(SQE)$ satisfies:
$$\dfrac{SQE}{\sigma^2}\sim\chi^{2}_{n-2K}.$$
Therefore, an unbiased estimator for $\sigma^2$ is given by:
$$\widehat{\sigma}^2=QME=\dfrac{SQE}{n-2K}.$$
Carrying out the calculations, you will find the estimate of the sums of squares:
$$SQT=Y^\top Y - \dfrac{Y^\top \mathbb{J} Y}{n}=193,8994$$ $$SQE=Y^\top\left(\mathbb{I} - \mathbb{H}\right)Y=53,592$$
and the variability estimate is given by:
$$\widehat{\sigma}^2=QME=\dfrac{SQE}{n-2K}=\frac{53,592}{31-10}=2,552.$$
Next, the parallelism test is analyzed. In the parallelism test, the Test $F$ partial, with the hypotheses:
$$ \begin{cases} H_0: \beta_6 = \beta_7 = \beta_8 = \beta_9 = 0 \cr H_1: \text{pelo menos um é diferente}\end{cases} $$
Calculating the sum of squares of the regression of the reduced model we have:
$$SQR\left(\beta_{R2}\right) = \widehat{\beta}_{R2}^\top X_{R2}^\top Y - \dfrac{Y^{\top}\mathbb{J}Y}{n} = 136,321.$$
Then, the sum of squares referring to the parameters of the null hypothesis is given by:
$$SQR\left(\beta_{R2^C} \mid \beta_{R2}\right) = SQR\left(\beta\right) - SQR\left(\beta_{R2}\right) = 140,307 - 136,321 = 3,985.$$
In this way, the F test statistic can be calculated by:
$$F_P = \dfrac{\dfrac{SQR\left(\beta_{R2^C} \mid \beta_{R2}\right)}{K-1}}{QME} = \dfrac{\dfrac{3,985}{4}}{2,552} = 0,3903.$$
In which $F_P$ has distribution $F$ with $K-1$ and $n-2K$ degrees of freedom. The p-value of the test is calculated by:
$$p-\text{valor} = \mathbb{P}\left(F_{(4, 21)} > 0,3903\right) = 0,81$$
In the parallelism test, there is no evidence to reject the null hypothesis at the significance level of 0.25 and, therefore, it is concluded that the same angular coefficient can be adjusted for all lots.
Therefore, the following model is now adjusted:
$$Y = \beta_0 + \beta_1 \cdot \hbox{Tempo}+\beta_2\cdot \hbox{LoteAN66}+\beta_3\cdot \hbox{LoteAV634}+\beta_4\cdot \hbox{LoteBV}+\beta_5\cdot \hbox{LoteBZ8331}+\epsilon$$
and from it we obtain:
$$SQE=Y^\top\left(\mathbb{I} - \mathbb{H}\right)Y=57,578$$
and the variability estimate is given by:
$$\widehat{\sigma}^2=QME=\dfrac{SQE}{n-K-1}=\frac{53,592}{31-5-1}=2,303.$$
And, through testing $F$ partial, the hypothesis of equality of intercepts is evaluated.
$$ \begin{cases} H_0: \beta_2 = \beta_3 = \beta_4 = \beta_5 = 0 \cr H_1: \text{pelo menos um é diferente} \end{cases} $$
For the Test $F$ partial, the sum of squares of the regression of the reduced model is first calculated:
$$SQR\left(\beta_{R1}\right) = \widehat{\beta}_{R1}^\top X_{R1}^\top Y - \dfrac{Y^{\top}\mathbb{J}Y}{n} = 2,0220.$$
And the sum of squares referring to the parameters of the null hypothesis:
$$SQR\left(\beta_{R1^C} \mid \beta_{R1}\right) = SQR\left(\beta\right) - SQR\left(\beta_{R1}\right) = 136,3220 - 2,022 = 134,3.$$
So the test statistics $F$ calculated partial is:
$$F = \dfrac{\dfrac{SQR\left(\beta_{R1^C} \mid \beta_{R1}\right)}{K-1}}{QME} = \dfrac{\dfrac{134,3}{4}}{2,303} = 14,5788.$$
The statistic $F$ has distribution $F$ with $4$ and $25$ degrees of freedom, the p-value is given by:
$$p-\text{valor} = \mathbb{P}\left(F_{(4,25)} > 14,5788\right) \approx 0,00.$$
How the $p-$value of the test for equality of intercepts is lower than the significance level of $25\char37$, the null hypothesis is rejected.
The next step is to estimate the regression model for the study. Note that the parallelism test identified that $\beta_6=\beta_7=\beta_8=\beta_9=0$, this is equivalent to a model without interaction between batches and time. Therefore, adjusting the model without interaction between time and batch, we find the following estimates: $$ \widehat{\beta}=\left[104,27;-0,0357; -4,21;-0,0216;1,08;-3,632\right]^\top$$
This way, you can separate the model by batch, note that the basis for calculating the Intercept is using the AJ Lot.
$$ \begin{align*} \text{Lote AJ:}~ Y &= 104,27 -0,0357\cdot \hbox{Tempo} \cr \text{Lote AN66:}~ Y &= (104,27 - 4,21) -0,0357\cdot \hbox{Tempo} \cr \text{Lote AV634:}~ Y &= (104,27 -0,0216) - 0,0357\cdot \hbox{Tempo} \cr \text{Lote BV:}~ Y &= (104,27 + 1,08) -0,0357\cdot \hbox{Tempo} \cr \text{Lote BV:}~ Y &=(104,27 -3,632)-0,0357\cdot \hbox{Tempo} \end{align*} $$
Note that there is only one general model for the study; in these models separated by batch, only values are assigned to the covariates (0 or 1) depending on the batch of interest.
$$SQE = SQT-SQR\left(\beta_{R2}\right) =193,8994 -136,321 = 57,578.$$
Using Action Stat we have the following results:
sequential ANOVA
Model with interaction
| G.L. | Sum of Squares | Medium Square | Stat. F | P-value | |
|---|---|---|---|---|---|
| Time | 1 | 2,02 | 2,00 | 0,79 | 0,38 |
| Lot | 4 | 134,30 | 33,57 | 13,16 | 0,00 |
| Time: Lot | 4 | 3,99 | 1,00 | 0,39 | 0,81 |
| Waste | 21 | 53,59 | 2,55 |
Table 13.1.3: ANOVA Table - Model with interaction
Model without interaction
| G.L. | Sum of Squares | Medium Square | Stat. F | P-value | |
|---|---|---|---|---|---|
| Time | 1 | 2,02 | 2,02 | 0,88 | 0,36 |
| Lot | 4 | 134,30 | 33,57 | 14,58 | 0,00 |
| Waste | 25 | 57,58 | 2,30 |
Table 13.1.4: ANOVA Table - Model without interaction
Regression Model
| Estimate | Standard Deviation | Stat.t | P-value | |
|---|---|---|---|---|
| Intercept | 104,27 | 0,66 | 157,82 | 0,00 |
| Time | -0,04 | 0,03 | -1,25 | 0,22 |
| LotAN66 | -4,21 | 0,76 | -5,55 | 0,00 |
| LotAV634 | -0,02 | 0,79 | -0,03 | 0,98 |
| LoteBV | 1,08 | 1,03 | 1,05 | 0,30 |
| LotBZ8331 | -3,63 | 0,89 | -4,08 | 0,00 |
Table 13.1.4: Regression model
Then, the lower limit of acceptance is set at 90% and the upper limit at 110%. It is necessary to make predictions of the average response per batch for the next 24 months with a 95% confidence interval. This case is scenario 2, there is an intercept for each lot and only one angular coefficient for the model, so the confidence interval is given by:
$$IC\left(\mu_{Y|x}^i, 100(1-\alpha)\char37 \right) = \left[ x_i^\top \widehat{\beta} \pm t_{(n-p-1)} \widehat{\sigma} \sqrt{x_i^\top\left(X^\top X\right)^{-1}x_i} \text{ } \right].$$
For the example, the limits of the time confidence interval (month) are calculated $t = 24 $ and the lot $ BV $, for the calculation we have the following values:
$$ x_{24}=\left[1,24,0,0,1,0\right]^\top $$
$$ \hat{\beta}=\left[104,27;-0,0357; -4,21;-0,0216;1,08;-3,632\right]^\top $$
So, $$ \widehat{y_{24}} = x_{24}^{\top} \widehat{\beta} = 104,4980$$ $$\widehat{\sigma} = \sqrt{\widehat{\sigma^2}} =\sqrt{QME} = \sqrt{\dfrac{SQE}{31-4-2}} = \sqrt{\dfrac{57,578}{25}} = 1,518$$
$$t_{(1-\alpha/2; 31-4-2)} = t_{(0,975; 25)} = 2,0595$$
$$\sqrt{x_{24}^\top(X^\top X)^{-1}x_{24}} = 0,6199$$
Finally,
$$IC_{Inf}({y_{24}},95\char37)= 104,4980 - 1,518 \cdot 2,0595 \cdot 0,6199 = 102,56$$
$$IC_{Sup}({y_{24}},95\char37)= 104,4980 + 1,518 \cdot 2,0595 \cdot 0,6199 = 106,44$$
It has to $ IC_{Inf}({y_{24}},95\char37) = 102,56 > 90 $ and $ IC_{Sup}({y_{24}},95\char37) = 106,44 < 110 $, so the expiration date is not yet known.
Continuing the calculations for all batches for all 24 months with Action Stat, it is highlighted that in 24 months a lower limit of degradation below 90% or an upper limit above 110% was not identified. In this situation, the product is said to have a shelf life of 24 months.
Figure 13.1.10: Trend analysis
Figure 13.1.11: Waste analysis
For this application, the following constants are used to calculate release limits: $$t = 24 \text{ e, portanto, } x_t = [1, 24, 0, 0, 0, 0]^T$$
$$BC = t_{(1-\alpha/2, n-p-1)} \hat{\sigma} \sqrt{x_t^T (X^TX)^{-1}x_t} = 1,2659$$
As time was not significant for the study, the release limits are given by
$$ LSL = LSE - BC = 110 - 1,27 = 108,73$$ $$ LIL = LIE + BC =90 + 1,27 = 91,27.$$
Example 3 - Different slopes
An example is presented for when the hypothesis of equality of angular coefficients is rejected. For this example, consider the data in Table 13.1.5:
| Time | A | B | C |
|---|---|---|---|
| 0 | 101,615842 | 104,3506 | 104,647 |
| 3 | 99,29220985 | 103,4975 | 106,3846 |
| 6 | 99,0759734 | 97,5835 | 100,0886 |
| 9 | 100,0949979 | 101,4073 | 101,1726 |
| 12 | 100,421851 | 99,0102 | 101,7178 |
| 18 | 99,10443276 | 98,744 | 103,8475 |
| 24 | 101,0260878 | 96,2554 | 106,0826 |
| 36 | 100,0835435 | — | 101,5334 |
Table 13.1.5: Drug degradation data over time for different batches
Estimate the parameter vector $\beta$ and the ANCOVA model is found by:
$$\widehat{\beta} = \left(X^\top X\right)^{-1}X^\top Y = \begin{bmatrix} \widehat{\beta}_0; \widehat{\beta}_1; \widehat{\beta}_2; \widehat{\beta}_3; \widehat{\beta}_4; \widehat{\beta}_5 \end{bmatrix}^\top$$
It is known that the sum of squares of the error $(SQE)$ satisfies:
$$\dfrac{SQE}{\sigma^2}\sim\chi^{2}_{n-2K}.$$
Therefore, an unbiased estimator for $\sigma^2$ is given by:
$$\widehat{\sigma}^2=QME=\dfrac{SQE}{n-2K}.$$
Carrying out the calculations, you will find the estimate of the sums of squares: $$SQT=Y^\top Y - \dfrac{Y^\top \mathbb{J} Y}{n}=150,6342$$ $$SQE=Y^\top\left(\mathbb{I} - \mathbb{H}\right)Y=64,5769$$ and the variability estimate is given by
$$\widehat{\sigma}^2=QME=\dfrac{SQE}{n-2K}=\frac{64,5769}{23-6}=3,7986.$$
Next, the hypotheses of parallelism are analyzed. Through testing $F$ partial evaluation of the following hypotheses:
$$ \begin{cases} H_0: \beta_4 = \beta_5 = 0 \cr H_1: \text{pelo menos um é diferente}\end{cases} $$
Calculating the sum of squares of the regression of the reduced model we have:
$$SQR\left(\beta_{R2}\right) = \widehat{\beta}_{R2}^\top X_{R2}^\top Y - \dfrac{Y^{\top}\mathbb{J}Y}{n} =58,3261$$
Then, the sum of squares referring to the parameters of the null hypothesis is given by:
$$SQR\left(\beta_{R2^C} \mid \beta_{R2}\right) = SQR\left(\beta\right) - SQR\left(\beta_{R2}\right) = 86,0573 - 58,3261 = 27,7312$$
In this way, the F test statistic can be calculated by:
$$F_P = \dfrac{\dfrac{SQR\left(\beta_{R2^C} \mid \beta_{R2}\right) }{K-1}}{QME} = \dfrac{\dfrac{27,7312}{2}}{3,7986} = 3,6502$$
In which $F_P$ has distribution $F$ with $K-1$ and $n-2K$ degrees of freedom. The p-value of the test is calculated by:
$$p-valor = \mathbb{P}\left(F_{(2, 17)} > 3,6502 \right) = 0,0480$$
In the Parallelism test, there is evidence to reject the null hypothesis at a significance level of 0.25 and it is concluded that different angular coefficients must be adjusted for the lots.
Therefore, as the null hypothesis of the parallelism test was rejected, a model containing time, the batch factor and the interaction between them was adjusted. The following estimates are found: $$ \widehat{\beta}=\left[ 100,0879 ; 0,0001 ; 3,0136 ; 3,3992 ; -0,2899 ; -0,0225 \right]^\top $$
This way, you can separate the model by batch, note that the basis for the Intercept calculation is using batch A.
- Lot A: $Y = 100,08787 + 0,00011 \cdot \text{Tempo} $
- Lot B: $Y = (100,08787 + 3,01357) + (0,00011 + 0,28963) \cdot \text{Tempo} $
- Lot C: $Y =(100,08787 + 3,39918) + (0,00011 - 0,02232) \cdot \text{Tempo}$
Note that there is only one general model for the study; in these models separated by batch, only values (0 or 1) are assigned to the covariates depending on the batch of interest. Using Action Stat we have the following results:
ANCOVA
| G.L. | Sum of Squares | Medium Square | Stat. F | P-value | |
|---|---|---|---|---|---|
| Time | 1 | 6,0817 | 6,0815 | 1,6010 | 0,2228 |
| Lot | 2 | 52,2446 | 26,1223 | 6,8768 | 0,0065 |
| Lot:Time | 2 | 27,7312 | 13,8656 | 3,6502 | 0,0480 |
| Waste | 17 | 64,5769 | 3,7986 |
Table 13.1.6: ANCOVA
Regression Model
| Estimate | Standard Deviation | Stat.t | P-value | |
|---|---|---|---|---|
| Intercept | 100,0879 | 1,0778 | 92,8637 | 0,0000 |
| Time | 0,0001 | 0,0614 | 0,0018 | 0,9966 |
| LotB | 3,0136 | 1,6249 | 1,8547 | 0,0811 |
| LotC | 3,3992 | 1,5242 | 2,2301 | 0,0395 |
| LotB:Time | -0,2899 | 0,1123 | -2,5808 | 0,0194 |
| LotC:Time | -0,0225 | 0,0868 | -0,2596 | 0,7983 |
Table 13.1.7: Regression model
Then, the lower limit of acceptance is set at 90% and the upper limit at 110%. It is necessary to make predictions of the average response per batch for the next 24 months with a 95% confidence interval. In this case, we have scenario 3, which is an intercept for each lot and an angular coefficient also for each lot, so the confidence interval is given by:
$$IC\left(\mu^i_{Y|x}, 100(1-\alpha)\char37\right) = \left[ x_i^\top \widehat{\beta} \pm t_{(n-p-1)} \widehat{\sigma} \sqrt{x_i^\top\left(X^\top X\right)^{-1}x_i}\right].$$
For the example, the limits of the time confidence interval (month) will be calculated $ t_i = 24 $ and lot A, the following values are used for calculation:
$$ x_{24}=\left[1,24,0,0,0,0\right]^\top $$ $$\widehat{\beta}=\left[ 100,0879; 0,0001; 3,0136; 3,3992; -0,2899 ; 0,0225 \right]^\top $$
So, $$\widehat{y_{24}} = x_{24}^{\top}\widehat{\beta} = 100,0905$$ $$\widehat{\sigma} = \sqrt{\widehat{\sigma^2}} =\sqrt{QME} = \sqrt{\dfrac{SQE}{23-5-1}} = \sqrt{\dfrac{64,5769}{17}} = 1,9490$$ $$t_{(1-\alpha/2; 23-5-1)} = t_{(0,975; 17)} = 2,1098$$ $$\sqrt{x_{24}^\top (X^\top X)^{-1}x_{24}} = 0,4841$$
Finally, $$IC_{Inf}({y_{24}},95\char37)= 100,0905 - 2,1098 \cdot 1,9490 \cdot 0,4841 = 98,04977$$ $$IC_{Sup}({y_{24}},95\char37)= 100,0905 + 2,1098 \cdot 1,9490 \cdot 0,4841 = 102,13126$$
It has to $ IC_{Inf}({y_{24}},95\char37) = 98,04977 > 90 $ and $ IC_{Sup}({y_{24}},95\char37) = 102,13126 < 110 $, therefore the expiration date for lot A has not yet been found.
Continuing the calculations for all batches for all 24 months with Action Stat, it is observed that in 24 months a lower limit of degradation below 90% or an upper limit above 110% was not identified. In this situation, the product is said to have a shelf life of 24 months.
Figure 13.1.12: Trend analysis
Figure 13.1.13: Waste analysis
For this application, the shelf life was 24 months and batch 2 has the highest slope magnitude $\beta_M=-0,2899$. This way, release limits can be calculated. $$t = 24 \text{ e, portanto, } x_t = [1, 24, 1, 0, 24, 0]^\top $$
$$BC = t_{(1-\alpha/2, n-p-1)} \widehat{\sigma} \sqrt{x_t^\top (X^\top X)^{-1}x_t} = 3,2126$$
As, in this case, the interaction between time and batch was significant, the release limits are: $$ \begin{align*} LSL &= \begin{cases} LSE - \beta_M \cdot t - BC, \qquad \text{se $\beta_M > 0$};\cr LSE - BC, ~~\qquad \quad \qquad \text{se $\beta_M \leq 0$}.\end{cases} \cr \Rightarrow LSL &= 110 - (-0,28974) \cdot 24 - 3,2126 = 93,2126\cr LIL &= \begin{cases} LIE + \beta_M \cdot t + BC, \qquad \text{se $\beta_M < 0$};\cr LIE + BC, ~~\qquad \quad \qquad \text{se $\beta_M \geq 0$}.\end{cases}\cr \Rightarrow LIL &= 90 + 3,2126 = 100,7896. \end{align*} $$