ANOVA 7 of 9
On this page

ANOVA

9.6 ANOVA - Cross-Over Effect (Mixed Effect)

Chapter 6 of 8 14 min read

ANOVA - Mixed Effects Model

In previous modules we saw the ANOVA models with fixed effects and ANOVA with random effects, in this module we will see ANOVA with mixed effects.

We saw previously that a linear model is considered fixed when it presents only fixed factors, in addition to the experimental error, which is always random, models that present only random factors, in addition to the constant $ \mu $ is considered random models, while models that present both fixed factors and random factors are considered mixed models and it is these models that we will study in this module.

9.6 ANOVA - Cross-Over Effect

We often come across problems where we have more than one group of individuals and each group is randomly subjected to different treatments, with these treatments being exchanged between the groups at each instant of time, thus, at the end of the experiment, all groups will have received all the same treatments, however, in a different order. For problems like this we use the ANOVA model with Cross-Over effect.

Consider a two-factor factorial design with a fixed effect model, in which a group of $ N $ individuals is divided into subgroups of sizes $ n_i(i=1, 2, \cdots, s) $, which received $ t $ treatments in $ p $ different periods. The term $ p $ represents the number of periods and $ s $ the sequence in which treatments or drugs were applied. Table 9.6.1 shows how the groups of individuals are allocated in the respective sequences and periods.

$ Sequência $ $ 1 $ $ 2 $ $ \dots $ $ p $ $ \textbf{Média} $
$ 1 $ $ y_{111},\ldots,y_{11n_1} $ $ y_{121},\ldots,y_{12n_1} $ $ \ldots $ $ y_{1b1},\ldots,y_{1pn_1} $ $ \overline{y}_{1..} $
$ 2 $ $ y_{211},\ldots,y_{21n_2} $ $ y_{221},\ldots,y_{22n_2} $ $ \ldots $ $ y_{2b1},\ldots,y_{2pn_2} $ $ \overline{y}_{2..} $
$ \vdots $ $ \vdots $ $ \vdots $ $ \vdots $ $ \vdots $ $ \vdots $
$ s $ $ y_{s11},\ldots,y_{s1n_s} $ $ y_{s21},\ldots,y_{s2rn_s} $ $ \ldots $ $ y_{sp1},\ldots,y_{spn_s} $ $ \overline{y}_{s..} $
Average $ \overline{y}_{.1.} $ $ \overline{y}_{.2.} $ $ \ldots $ $ \overline{y}_{.p.} $ $ \overline{y}_{…} $

Table 9.6.1: Presentation of data for two factors.

9.6.1 Model

The statistical model for this planning is

$$y_{ijk} = \mu + S_{ik} + \pi_j + \tau_{d[i,j]} + \lambda_{d[i,j-1]}~+~ \varepsilon_{ijk} ~~~~~\begin{cases} i = 1, \cdots, s~~ \hbox{(Sequência)} \cr j = 1, \cdots, p~~ \hbox{(Período)} \cr k = 1, \cdots,n_i~~ \hbox{(Indivíduo)} \end{cases}$$

Where:

$ y_{ijk} $ represents the response of the kth individual in the ith sequence in the jth period;

$ \mu $ is a general average;

$ S_{ik} $ is the random effect of the kth individual in the sequence $ i $;

$ \pi_j $ is the period effect $ j $, with $ \sum_{j=1}^{p}\pi_j=0 $;

$ \tau_{d[i,j]} $ is the direct effect of the treatment administered during the period $ j $ of the sequence $ i $ (Formulation Effect), with $ \sum\tau_{d[i,j]}=0 $;

$ \lambda_d{[i,j-1]} $ is the direct effect of the treatment administered during the period $ j-1 $ of the sequence $ i $ (Carry-over Effect), with $ \sum\tau_{d[i,j-1]}=0 $;

$ \varepsilon_{ijk} $ is the random error for the kth individual in the jth period in the ith sequence.

The effect $ S_{ik} $ will be considered random because, from the population of possible individuals who can receive the treatments, we selected a sample at random, where we assume that:

  • $ S_{ik} $ and $ \varepsilon_{ijk} $ are random variables with normal density, independent and identically distributed with zero mean and variances $ \sigma^2_S $ and $ \sigma^2 $, respectively;

  • $ S_{ik} $ and $ \varepsilon_{ijk} $ are mutually independent.

We can interpret the inter and intra variability parameters in the form:

  • $ \sigma^2_S $, explains inter-individual variability (between individuals);

  • $ \sigma^2 $, explains the intra-individual variability (within the individual) for the t-th formulation.

The inter-individual component describes the variation between individuals in groups, while the intra-individual component describes the individual changes throughout the observations, that is, the changes within each individual.

9.6.2 Sum Decomposition

Let’s partition the total sum of squares of $ 2(n_1+n_2) $ observations on components of the carry-over effect (residual effects), the period effect, the drug effect and the error. To do this, we first have to

$$\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}(y_{ijk}-\bar{y}_{…})^2=\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}(y_{ijk}-\bar{y}_{i.k})^2 +\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}(\bar{y}_{i.k}-\bar{y}_{…})^2$$

$$SQ_T=SQ_{\hbox{dentro}}+SQ_{\hbox{entre}}$$

in which

  • $ SQ_{{dentro}} $ is the sum of squares within each individual;

  • $ SQ_{{entre}} $ is the sum of squares between individuals;

with

$$\bar{y}_{i.k}=\frac{1}{2}\sum_{j=1}^{2}y_{ijk}\quad\quad\bar{y}_{…}=\frac{1}{2(n_1+n_2)}\sum_{i=1}^{2} \sum_{j=1}^{2}\sum_{k=1}^{n_i}y_{ijk}$$

Furthermore, $ SQ_{{entre}} $ can be partitioned into two components, one for the carry-over effect and the other for errors between individuals. From that,

$$SQ_{{entre}}=SQ_{{carry-over}}+SQ_{{inter}}$$

which is more convenient to be written as follows:

$$SQ_{\hbox{carry-over}}=\frac{2n_1n_2}{(n_1+n_2)}\left(\bar{y}_{1..}-\bar{y}_{2..}\right)^2$$

$$SQ_{\hbox{inter}}=\sum_{i=1}^{2}\sum_{k=1}^{n_i}\frac{y^2_{i.k}}{2}-\sum_{i=1}^{2}\frac{y^2_{i..}}{2n_i}$$

Similarly, the sum of squares within each individual can be decomposed into three components, one for the effect of the drug, another for the effect of the period and the last for the error within each individual. From that,

$$SQ_{\hbox{dentro}}=SQ_{\hbox{droga}}+SQ_{\hbox{período}}+SQ_{\hbox{intra}}$$

which in computational formula can be written as:

$$SQ_{\hbox{droga}}=\frac{n_1n_2}{2(n_1+n_2)}\left(\bar{y}_{11.}-\bar{y}_{12.}-\bar{y}_{21.}+\bar{y}_{22.}\right)^2$$

$$SQ_{\hbox{período}}=\frac{n_1n_2}{2(n_1+n_2)}\left(\bar{y}_{11.}-\bar{y}_{12.}+\bar{y}_{21.}-\bar{y}_{22.}\right)^2$$

$$SQ_{\hbox{intra}}=\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}y^2_{ijk}-\sum_{i=1}^{2}\sum_{k=1}^{n_i}\frac{y^2_{i.k}}{2}-\sum_{i=1}^{2}\sum_{j=1}^{2}\frac{y^2_{ij.}}{n_i}+\sum_{i=1}^{2}\frac{y^2_{i..}}{2~n_i}$$

$$SQ_{\hbox{dentre}}=\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}y^2_{ijk}-\sum_{i=1}^{2}\sum_{k=1}^{n_i}\frac{y^2_{i.k}}{2}$$

Where:

$$\bar{y}_{ij.}=\frac{1}{n_i}\sum_{k=1}^{n_i}y_{ijk}\quad\quad y_{i.k}=\sum_{j=1}^{2}y_{ijk}\quad\quad y_{ij.}=\sum_{k=1}^{n_i}y_{ijk}\quad\quad y_{…}=\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}y_{ijk}$$

The number of degrees of freedom in a sum of squares is the number of independent elements in that sum. For example, in the sum of squares $ \sum_{k=1}^{n_1}(\bar{y}_{1.k}-\bar{y}_{…})^2 $, not all elements $ (\bar{y}_{1.1}-\bar{y}_{…}), \cdots, (\bar{y}_{1.n_1}-\bar{y}_{…}) $ are independent as long as $ \sum_{k=1}^{n_1}(\bar{y}_{1.k}-\bar{y}_{…})=0 $In fact, only $ n_1-1 $ of them are independent. In this sense, the respective degrees of freedom associated with each sum of squares are:

Effect Degree of Freedom
carry-over $ 1 $
inter $ n_1+n_2-2 $
drug $ 1 $
period $ 1 $
intra $ n_1+n_2-2 $
Total $ 2(n_1+n_2)-1 $

Table 9.6.2: Degrees of Freedom

Each sum of squares divided by its degree of freedom determines the mean square (QM), that is

$$QM_{\hbox{carry-over}}=\frac{SQ_{\hbox{carry-over}}}{1}$$

$$QM_{\hbox{inter}}=\frac{SQ_{\hbox{inter}}}{n_1+n_2-2}$$

$$QM_{\hbox{droga}}=\frac{SQ_{\hbox{droga}}}{1}$$

$$QM_{\hbox{período}}=\frac{SQ_{\hbox{período}}}{1}$$

$$QM_{\hbox{intra}}=\frac{SQ_{\hbox{intra}}}{n_1+n_2-2}$$

Now let’s calculate the expected mean square values for each of the factors.

To do this, we will denote:

$$\tau_{d[i,j]}=\quad F_R\quad {se}\quad i=j$$

$$\tau_{d[i,j]}=\quad F_T\quad {se}\quad i\neq j$$

$$\lambda_{d[i,j-1]}=\quad R_R\quad{se}\quad i=1\quad{e}\quad j=2$$

$$\lambda_{d[i,j-1]}=\quad R_T\quad{se}\quad i=2\quad{e}\quad j=2$$

First, we calculate the expected value of the $ QM_{{inter}} $, which is given by:

$$E[QM_{\hbox{inter}}]=\frac{1}{n_1+n_2-2}E\left[\frac{1}{2}\sum_{i=1}^{2}\sum_{k=1}^{n_i}y_{i.k}^{2}-\frac{1}{2}\sum_{i=1}^{2}\frac{1}{n_i}y_{i..}^{2}\right]$$

$$=\frac{1}{n_1+n_2-2}\left(\underbrace{E\left[\frac{1} {2}\sum_{i=1}^{2}\sum_{k=1}^{n_i}y_{i.k}^{2}\right]}_{(*)}-\underbrace{E\left[\frac{1}{2}\sum_{i=1}^{2}\frac{1}{n_i}y_{i..}^{2}\right]}_{(**)}\right)$$

Replacing the model information in $ y_{i.k} $ and $ y_{i..} $, we get:

$$(*)=E\left[\frac{1}{2}\sum_{i=1}^{2}\sum_{k=1}^{n_i}\left(\sum_{j=1}^{2}\left(\mu+S_{ik}+\pi_j+\tau_{d[i,j]}+\lambda_{d[i,j-1]}+\varepsilon_{ijk}\right)\right)^2\right]$$

$$=E\left[\frac{1}{2}\sum_{i=1}^{2}\sum_{k=1}^{n_i}\left(2\mu+2S_{ik}+\sum_{j=1}^{2}\pi_j+\sum_{j=1}^{2}\tau_{d[i,j]}+\sum_{j=1}^{2}\lambda_{d[i,j-1]}+\sum_{j=1}^{2}\varepsilon_{ijk}\right)^2\right]$$

$$=E\left[\frac{1}{2}\sum_{i=1}^{2}\sum_{k=1}^{n_i}\left(2^2\mu^2+2^2\mu S_{ik}+2\mu\sum_{j=1}^{2}\tau_{d[i,j]}+2\mu\sum_{j=1}^{2}\lambda_{d[i,j-1]}+2\mu\sum_{j=1}^{2}\varepsilon_{ijk}+2^2\mu S_{ik}^2+2^2S_{ik}^2\right.\right.$$

$$\quad\left.\left.+2S_{ik}\sum_{j=1}^{2}\tau_{d[i,j]}+2S_{ik}\sum_{j=1}^{2}\lambda_{d[i,j-1]}+2S_{ik}\sum_{j=1}^{2}\varepsilon_{ijk}+2\mu\sum_{j=1}^{2}\tau_{d[i,j]}+2S_{ik}\sum_{j=1}^{2}\tau_{d[i,j]}\right.\right.$$

$$\quad\left.\left.+\sum_{j=1}^{2}\tau_{d[i,j]}^2+\sum_{j=1}^{2}\tau_{d[i,j]}\lambda_{d[i,j-1]}+\sum_{j=1}^{2}\tau_{d[i,j]}\varepsilon_{ijk}+2\mu\sum_{j=1}^{2}\lambda_{d[i,j-1]}+2S_{ik}\sum_{j=1}^{2}\lambda_{d[i,j-1]}\right.\right.$$

$$\quad\left.\left.+\sum_{j=1}^{2}\lambda_{d[i,j-1]}\tau_{d[i,j]}+\sum_{j=1}^{2}\lambda_{d[i,j-1]}^2+\sum_{j=1}^{2}\lambda_{d[i,j-1]}\varepsilon_{ijk}+\sum_{j=1}^{2}\varepsilon_{ijk}2\mu+\sum_{j=1}^{2}\varepsilon_{ijk}2S_{ik}\right.\right.$$

$$\quad\left.\left.+\sum_{j=1}^{2}\varepsilon_{ijk}\tau_{d[i,j]}+\sum_{j=1}^{2}\varepsilon_{ijk}\lambda_{d[i,j-1]}+\sum_{j=1}^{2}\varepsilon_{ijk}^2\right)\right]$$

$$=E\left[\left(2\mu^2(n_1+n_2)+4\mu \sum_{i=1}^{2}\sum_{k=1}^{n_i}S_{ik}+2\mu\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}\varepsilon_{ijk}+2\sum_{i=1}^{2}\sum_{k=1}^{n_i}S_{ik}^2+2\sum_{i=1}^{2}\sum_{k=1}^{n_i}S_{ik}\sum_{j=1}^{2}\varepsilon_{ijk}\right.\right.$$

$$\quad\left.\left.+\frac{1}{2}\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}\varepsilon_{ijk}^2\right)\right]$$

$$=2\mu^2(n_1+n_2)+2E\left[\sum_{i=1}^{2}\sum_{k=1}^{n_i}S_{ik}^2\right]+\frac{1}{2}E\left[\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}\varepsilon_{ijk}^2\right]$$

We know that $ E[x^2]=var(x)+E^2[x] $, we also know that $ E[S_{ik}]=0 $ and $ E[\varepsilon_{ijk}]=0 $, like this:

$$=2\mu^2(n_1+n_2)+2var\left(\sum_{i=1}^{2}\sum_{k=1}^{n_i}S_{ik}\right)+\frac{1}{2}var\left(\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}\varepsilon_{ijk}\right)$$

$$=2\mu^2(n_1+n_2)+2(n_1+n_2)\sigma_s^2+(n_1+n_2)\sigma^2$$

Similarly,

$$(**)=E\left[\sum_{i=1}^{2}\frac{1}{2n_i}\left(\sum_{j=1}^{2}\sum_{k=1}^{n_i}\left(\mu+S_{ik}+\pi_j+\tau_{d[i,j]}+\lambda_{d[i,j-1]}+\varepsilon_{ijk}\right)\right)^2\right]$$

$$=2(n_1+n_2)\mu^2+4\sigma_s^2+2\sigma^2$$

Replacing (*) and (**), we get:

$$=\frac{1}{n_1+n_2-2}\left(2\mu^2(n_1+n_2)+2(n_1+n_2)\sigma_s^2+(n_1+n_2)\sigma^2-2(n_1+n_2)\mu^2-\sigma_s^2-\sigma^2\right)$$

$$=\frac{1}{n_1+n_2-2}\left(2(n_1+n_2-2)\sigma_s^2+(n_1+n_2-2)\sigma^2\right)$$

$$=2\sigma_s^2+\sigma^2$$

Now we calculate the expected value of the $ QM_{\hbox{droga}} $.

$$E[QM_{\hbox{droga}}]=\frac{n_1n_2}{2(n_1+n_2)}E[(\overline{y_{11.}}-\overline{y_{12.}}-\overline{y_{21.}}+\overline{y_{22.}})^2]$$

$$=\frac{n_1n_2}{2(n_1+n_2)}E\left[\left(\underbrace{\frac{1}{n_1}\sum_{k=1}^{n_1}y_{11k}}_{(*)}\underbrace{-\frac{1}{n_1}\sum_{k=1}^{n_1}y_{12k}}_{(**)}\underbrace{-\frac{1}{n_2}\sum_{k=1}^{n_2}y_{21k}}_{(***)}\underbrace{+\frac{1}{n_2}\sum_{k=1}^{n_2}y_{22k}}_{(****)}\right)^2\right]$$

Replacing the model information in $ y_{11k} $, $ y_{12k} $, $ y_{21k} $ and $ y_{22k} $, we get:

$$(*)=\frac{1}{n_1}\sum_{k=1}^{n_1}\left(\mu + S_{1k}+\pi_1 + \tau_{d[1,1]}+\lambda_{d[1,1-1]}+\varepsilon_{11k}\right)$$

$$=\frac{1}{n_1}\left(n_1\mu\sum_{k=1}^{n_1}S_1k+n_1\pi_1+n_1\tau_{d[1,1]}+n_1\lambda_{d[1,1-1]}+\sum_{k=1}^{n_1}\varepsilon_{11k}\right)$$

$$=\mu+\frac{1}{n_1}\sum_{k=1}^{n_1}S_1k+\pi_1+\tau_{d[1,1]}+\lambda_{d[1,1-1]}+\frac{1}{n_1}\sum_{k=1}^{n_1}\varepsilon_{11k}$$

Similarly,

$$(**)=-\mu-\frac{1}{n_1}\sum_{k=1}^{n_1}S_1k-\pi_2-\tau_{d[1,2]}-\lambda_{d[1,2-1]}-\frac{1}{n_1}\sum_{k=1}^{n_1}\varepsilon_{12k}$$

$$(***)=-\mu-\frac{1}{n_2}\sum_{k=1}^{n_2}S_2k-\pi_1-\tau_{d[2,1]}-\lambda_{d[2,1-1]}-\frac{1}{n_2}\sum_{k=1}^{n_2}\varepsilon_{21k}$$

$$(****)=\mu+\frac{1}{n_2}\sum_{k=1}^{n_2}S_2k+\pi_2+\tau_{d[2,2]}+\lambda_{d[2,2-1]}+\frac{1}{n_2}\sum_{k=1}^{n_2}\varepsilon_{22k}$$

Replacing $(\ast)$, $(\ast\ast)$, $(\ast\ast\ast)$ and $(\ast\ast\ast\ast)$ we get:

$$=\frac{n_1n_2}{2(n_1+n_2)}E\left[\left(\tau_{d[1,1]}+\lambda_{d[1,1-1]}+\frac{1}{n_1}\sum_{k=1}^{n_1}\varepsilon_{11k}-\tau_{d[1,2]}-\lambda_{d[1,2-1]}-\frac{1}{n_1}\sum_{k=1}^{n_1}\varepsilon_{12k}-\tau_{d[2,1]}\right.\right.$$

$$\quad\left.\left.-\lambda_{d[2,1-1]}-\frac{1}{n_2}\sum_{k=1}^{n_2}\varepsilon_{21k}+\tau_{d[2,2]}+\lambda_{d[2,2-1]}+\frac{1}{n_2}\sum_{k=1}^{n_2}\varepsilon_{22k}\right)^2\right]$$

$$=\frac{n_1n_2}{2(n_1+n_2)}E\left[\left(2(F_R-F_T)+(R_T-R_R)+\frac{1}{n_1}\sum_{k=1}^{n_1}(\varepsilon_{12k}-\varepsilon_{12k})+\frac{1}{n_2}\sum_{k=1}^{n_2}(\varepsilon_{22k}-\varepsilon_{21k})\right)^2\right]$$

$$=\frac{n_1n_2}{2(n_1+n_2)}\left(2^2\left((F_R-F_T)+\frac{(R_T-R_R)}{2}\right)^2+\frac{1}{n_1^2}\left(E\left[\sum_{k=1}^{n_1}\varepsilon_{12k}^2\right]+E\left[\sum_{k=1}^{n_1}\varepsilon_{12k}^2\right]\right)\right.$$

$$\quad\left.+\frac{1}{n_2^2}\left(E\left[\sum_{k=1}^{n_2}\varepsilon_{22k}^2\right]+E\left[\sum_{k=1}^{n_2}\varepsilon_{21k}^2\right]\right)\right)$$

We know that $ E[x^2]=var(x)+E^2[x] $, we also know that $ E[S_{ik}]=0 $ and $ E[\varepsilon_{ijk}]=0 $, like this:

$$=\frac{n_1n_2}{2(n_1+n_2)}\left(2^2\left((F_R-F_T)+\frac{(R_T-R_R)}{2}\right)^2+\frac{1}{n_1^2}\left(var\left(\sum_{k=1}^{n_1}\varepsilon_{12k}\right)+var\left(\sum_{k=1}^{n_1}\varepsilon_{12k}\right)\right)\right.$$

$$\quad\left.+\frac{1}{n_2^2}\left(var\left(\sum_{k=1}^{n_2}\varepsilon_{22k}\right)+var\left(\sum_{k=1}^{n_2}\varepsilon_{21k}\right)\right)\right)$$

$$=\frac{n_1n_2}{2(n_1+n_2)}\left(2^2\left((F_R-F_T)+\frac{(R_T-R_R)}{2}\right)^2+\frac{1}{n_1^2}\left(n_1\sigma^2+n_1\sigma^2\right)+\frac{1}{n_2^2}\left(n_2\sigma^2-n_2\sigma^2\right)\right)$$

$$=\frac{n_1n_2}{2(n_1+n_2)}\left(2^2\left((F_R-F_T)+\frac{(R_T-R_R)}{2}\right)^2+2\sigma^2\left(\frac{1}{n_1}+\frac{1}{n_2}\right)\right)$$

$$=\frac{n_1n_2}{2(n_1+n_2)}\left(2^2\left((F_R-F_T)+\frac{(R_T-R_R)}{2}\right)^2+2\sigma^2\left(\frac{n_1+n_2}{n_1n_2}\right)\right)$$

$$=\frac{2n_1n_2}{(n_1+n_2)}\left((F_R-F_T)+\frac{(R_T-R_R)}{2}\right)^2+\sigma^2$$

For carryover, we calculate the mean square expected value as follows:

$$E[QM_{{carryover}}]=\frac{2n_1n_2}{n_1+n_2}E\left[\left(\overline{y_{1..}}-\overline{y_{2..}}\right)^2\right]$$

$$=\frac{2n_1n_2}{n_1+n_2}E\left[\left(\underbrace{\frac{1}{2n_1}\sum_{k=1}^{n_1}\sum_{j=1}^{2}y_{1jk}}_{(*)}-\underbrace{\frac{1}{2n_2}\sum_{k=1}^{n_2}\sum_{j=1}^{2}y_{2jk}}_{(**)}\right)^2\right]$$

Replacing the model information in $ y_{1jk} $ and $ y_{2jk} $, we get:

$$(*)=\frac{1}{2n_1}\sum_{k=1}^{n_1}\sum_{j=1}^{2}\left(\mu + S_{1k}+\pi_j + \tau_{d[1,j]}+\lambda_{d[1,j-1]}+\varepsilon_{1jk}\right)$$

$$=\frac{1}{2n_1}\left(2n_1\mu+2\sum_{k=1}^{n_1}S_{1k}+n_1\sum_{j=1}^{2}\pi_j+n_1\sum_{j=1}^{2}\tau_{d[1,j]}+n_1\sum_{j=1}^{2}\lambda_{d[1,j-1]}+\sum_{k=1}^{n_1}\sum_{j=1}^{2}\varepsilon_{1jk}\right)$$

$$=\mu+\frac{1}{n_1}\sum_{k=1}^{n_1}S_{1k}+\frac{1}{2}\sum_{j=1}^{2}\pi_j+\frac{1}{2}\sum_{j=1}^{2}\tau_{d[1,j]}+\frac{1}{2}\sum_{j=1}^{2}\lambda_{d[1,j-1]}+\frac{1}{2n_1}\sum_{k=1}^{n_1}\sum_{j=1}^{2}\varepsilon_{1jk}$$

Analogously, we have:

$$(**)=-\mu-\frac{1}{n_2}\sum_{k=1}^{n_2}S_{2k}-\frac{1}{2}\sum_{j=1}^{2}\pi_j-\frac{1}{2}\sum_{j=1}^{2}\tau_{d[2,j]}-\frac{1}{2}\sum_{j=1}^{2}\lambda_{d[2,j-1]}-\frac{1}{2n_2}\sum_{k=1}^{n_2}\sum_{j=1}^{2}\varepsilon_{2jk}$$

Replacing (*) and (**), we get:

$$=\frac{2n_1n_2}{n_1+n_2}E\left[\left(\mu+\frac{1}{n_1}\sum_{k=1}^{n_1}S_{1k}+\frac{1}{2}\sum_{j=1}^{2}\pi_j+\frac{1}{2}\sum_{j=1}^{2}\tau_{d[1,j]}+\frac{1}{2}\sum_{j=1}^{2}\lambda_{d[1,j-1]}+\frac{1}{2n_1}\sum_{k=1}^{n_1}\sum_{j=1}^{2}\varepsilon_{1jk}-\mu\right.\right.$$

$$\quad\left.\left.-\frac{1}{n_2}\sum_{k=1}^{n_2}S_{2k}-\frac{1}{2}\sum_{j=1}^{2}\pi_j-\frac{1}{2}\sum_{j=1}^{2}\tau_{d[2,j]}-\frac{1}{2}\sum_{j=1}^{2}\lambda_{d[2,j-1]}-\frac{1}{2n_2}\sum_{k=1}^{n_2}\sum_{j=1}^{2}\varepsilon_{2jk}\right)^2\right]$$

$$=\frac{2n_1n_2}{n_1+n_2}E\left[\left((R_R-R_T)+\frac{1}{n_1}\sum_{k=1}^{n_1}S_{1k}-\frac{1}{n_2}\sum_{k=1}^{n_2}S_{2k}+\frac{1}{2n_1}\sum_{k=1}^{n_1}\sum_{j=1}^{2}\varepsilon_{1jk}-\frac{1}{2n_2}\sum_{k=1}^{n_2}\sum_{j=1}^{2}\varepsilon_{2jk}\right)^2\right]$$

$$=\frac{2n_1n_2}{n_1+n_2}\left((R_R-R_T)^2+\frac{1}{n_1^2}E\left[\sum_{k=1}^{n_1}S_{1k}^2\right]+\frac{1}{n_2^2}E\left[\sum_{k=1}^{n_2}S_{2k}^2\right]+\frac{1}{2^2n_1^2}E\left[\sum_{k=1}^{n_1}\sum_{j=1}^{2}\varepsilon_{1jk}^2\right]\right.$$

$$\quad\left.+\frac{1}{2^2n_2^2}E\left[\sum_{k=1}^{n_2}\sum_{j=1}^{2}\varepsilon_{2jk}^2\right]\right)$$

We know that $ E[x^2]=var(x)+E^2[x] $, we also know that $ E[S_{ik}]=0 $ and $ E[\varepsilon_{ijk}]=0 $, like this:

$$=\frac{2n_1n_2}{n_1+n_2}\left((R_R-R_T)^2+\frac{1}{n_1^2}var\left(\sum_{k=1}^{n_1}S_{1k}\right)+\frac{1}{n_2^2}var\left(\sum_{k=1}^{n_2}S_{2k}\right)+\frac{1}{2^2n_1^2}var\left(\sum_{k=1}^{n_1}\sum_{j=1}^{2}\varepsilon_{1jk}\right)\right.$$

$$\quad\left.+\frac{1}{2^2n_2^2}var\left(\sum_{k=1}^{n_2}\sum_{j=1}^{2}\varepsilon_{2jk}\right)\right)$$

$$=\frac{2n_1n_2}{n_1+n_2}\left((R_R-R_T)^2+\frac{1}{n_1^2}\left(n_1^2\frac{\sigma_s^2}{n_1}\right)+\frac{1}{n_2^2}\left(n_2^2\frac{\sigma_s^2}{n_2}\right)+\frac{1}{2^2n_1^2}\left(2^2n_1^2\frac{\sigma_s^2}{2n_1}\right)+\frac{1}{2^2n_2^2}\left(2^2n_2^2\frac{\sigma_s^2}{2n_2}\right)\right)$$

$$=\frac{2n_1n_2}{n_1+n_2}\left((R_R-R_T)^2+\sigma_s^2\left(\frac{1}{n_1}+\frac{1}{n_2}\right)+\sigma^2\left(\frac{1}{2n_1}+\frac{1}{2n_2}\right)\right)$$

$$=\frac{2n_1n_2}{n_1+n_2}\left((R_R-R_T)^2+\sigma_s^2\left(\frac{n_1+n_2}{n_1n_2}\right)+\sigma^2\left(\frac{2(n_1+n_2)}{2^2n_1n_2}\right)\right)$$

$$=\frac{2n_1n_2}{n_1+n_2}(R_R-R_T)^2+2\sigma_s^2+\sigma^2$$

For $ QM_{{intra}} $, we calculate:

$$E[QM_{{intra}}]=\frac{1}{n_1+n_2-2}E\left[\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}y_{ijk}^{2}-\frac{1}{2}\sum_{i=1}^{2}\sum_{k=1}^{n_i}y_{i.k}^{2}-\sum_{i=1}^{2}\sum_{j=1}^{2}\frac{1}{n_i}y_{ij.}^{2}+\frac{1}{2}\sum_{i=1}^{2}\frac{1}{n_i}y_{i..}^{2}\right]$$

$$=\frac{n_1n_2}{2(n_1+n_2)}\left[\underbrace{E\left[\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}y_{ijk}^{2}\right]}_{(*)}\underbrace{-\frac{1}{2}E\left[\sum_{i=1}^{2}\sum_{k=1}^{n_i}y_{i.k}^{2}\right]}_{(**)}\underbrace{-E\left[\sum_{i=1}^{2}\sum_{j=1}^{2}\frac{1}{n_i}y_{ij.}^{2}\right]}_{(***)}\underbrace{+\frac{1}{2}E\left[\sum_{i=1}^{2}\frac{1}{n_i}y_{i..}^{2}\right]}_{(****)}\right]$$

Replacing the model information in $ y_{ijk} $, $ y_{i.k} $, $ y_{ij.} $ and $ y_{i..} $, we get:

$$(*)=E\left[\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}(\mu+S_{ik}+\pi_j+\tau_{d[i,j]}+\lambda_{d[i,j-1]}+\varepsilon_{ijk})^2\right]$$

$$=E\left[\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}\left(\mu^2+\mu S_{ik}+\mu\pi_j+\mu\tau_{d[i,j]}+\mu\lambda_{d[i,j-1]}+\mu\varepsilon_{ijk}+S_{ik}\mu+S_{ik}^2+S_{ik}\pi_j+S_{ik}\tau_{d[i,j]}\right.\right.$$

$$\quad\left.\left.+S_{ik}\lambda_{d[i,j-1]}+S_{ik}\varepsilon_{ijk}+\pi_j\mu+\pi_jS_{ik}+\pi_j^2+\pi_j\tau_{d[i,j]}+\pi_j\lambda_{d[i,j-1]}+\pi_j\varepsilon_{ijk}+\tau_{d[i,j]}\mu+\tau_{d[i,j]}S_{ik}\right.\right]$$

$$\quad\left.\left.+\tau_{d[i,j]}\pi_j+\tau_{d[i,j]}^2+\tau_{d[i,j]}\lambda_{d[i,j-1]}+\tau_{d[i,j]}\varepsilon_{ijk}+\lambda_{d[i,j-1]}\mu+\lambda_{d[i,j-1]}S_{ik}+\lambda_{d[i,j-1]}\pi_j\right.\right.$$

$$\quad\left.\left.+\lambda_{d[i,j-1]}\tau_{d[i,j]}+\lambda_{d[i,j-1]}^2+\lambda_{d[i,j-1]}\varepsilon_{ijk}+\varepsilon_{ijk}\mu+\varepsilon_{ijk}S_{ik}+\varepsilon_{ijk}\pi_j+\varepsilon_{ijk}\tau_{d[i,j]}+\varepsilon_{ijk}\lambda_{d[i,j-1]}+\varepsilon_{ijk}^2\right)\right]$$

$$=E\left[\left(2\mu^2(n_1+n_2)+4\mu \sum_{i=1}^{2}\sum_{k=1}^{n_i}S_{ik}+2\mu\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}\varepsilon_{ijk}+2\sum_{i=1}^{2}\sum_{k=1}^{n_i}S_{ik}^2+2\sum_{i=1}^{2}\sum_{k=1}^{n_i}S_{ik}\sum_{j=1}^{2}\varepsilon_{ijk}\right.\right.$$

$$\quad\left.\left.+\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}\varepsilon_{ijk}^2\right)\right]$$

$$=2\mu^2(n_1+n_2)+2\sum_{i=1}^{2}\sum_{k=1}^{n_i}E\left[S_{ik}^2\right]+\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}E\left[\varepsilon_{ijk}^2\right]$$

We know that $ E[x^2]=var(x)+E^2[x] $, we also know that $ E[S_{ik}]=0 $ and $ E[\varepsilon_{ijk}]=0 $, like this:

$$=2\mu^2(n_1+n_2)+2\sum_{i=1}^{2}\sum_{k=1}^{n_i}var\left(S_{ik}\right)+\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}var\left(\varepsilon_{ijk}\right)$$

$$=2\mu^2(n_1+n_2)+2(n_1+n_2)\sigma_s^2+2(n_1+n_2)\sigma^2$$

Similarly,

$$(**)=E\left[\frac{1}{2}\sum_{i=1}^{2}\sum_{k=1}^{n_i}\left(\sum_{j=1}^{2}\left(\mu+S_{ik}+\pi_j+\tau_{d[i,j]}+\lambda_{d[i,j-1]}+\varepsilon_{ijk}\right)\right)^2\right]$$

$$=E\left[\frac{1}{2}\sum_{i=1}^{2}\sum_{k=1}^{n_i}\left(2\mu+2S_{ik}+\sum_{j=1}^{2}\pi_j+\sum_{j=1}^{2}\tau_{d[i,j]}+\sum_{j=1}^{2}\lambda_{d[i,j-1]}+\sum_{j=1}^{2}\varepsilon_{ijk}\right)^2\right]$$

$$=E\left[\frac{1}{2}\sum_{i=1}^{2}\sum_{k=1}^{n_i}\left(2^2\mu^2+2^2\mu S_{ik}+2\mu\sum_{j=1}^{2}\tau_{d[i,j]}+2\mu\sum_{j=1}^{2}\lambda_{d[i,j-1]}+2\mu\sum_{j=1}^{2}\varepsilon_{ijk}+2^2\mu S_{ik}^2+2^2S_{ik}^2\right.\right.$$

$$\quad\left.\left.+2S_{ik}\sum_{j=1}^{2}\tau_{d[i,j]}+2S_{ik}\sum_{j=1}^{2}\lambda_{d[i,j-1]}+2S_{ik}\sum_{j=1}^{2}\varepsilon_{ijk}+2\mu\sum_{j=1}^{2}\tau_{d[i,j]}+2S_{ik}\sum_{j=1}^{2}\tau_{d[i,j]}\right.\right.$$

$$\quad\left.\left.+\sum_{j=1}^{2}\tau_{d[i,j]}^2+\sum_{j=1}^{2}\tau_{d[i,j]}\lambda_{d[i,j-1]}+\sum_{j=1}^{2}\tau_{d[i,j]}\varepsilon_{ijk}+2\mu\sum_{j=1}^{2}\lambda_{d[i,j-1]}+2S_{ik}\sum_{j=1}^{2}\lambda_{d[i,j-1]}\right.\right.$$

$$\quad\left.\left.+\sum_{j=1}^{2}\lambda_{d[i,j-1]}\tau_{d[i,j]}+\sum_{j=1}^{2}\lambda_{d[i,j-1]}^2+\sum_{j=1}^{2}\lambda_{d[i,j-1]}\varepsilon_{ijk}+\sum_{j=1}^{2}\varepsilon_{ijk}2\mu+\sum_{j=1}^{2}\varepsilon_{ijk}2S_{ik}\right.\right.$$

$$\quad\left.\left.+\sum_{j=1}^{2}\varepsilon_{ijk}\tau_{d[i,j]}+\sum_{j=1}^{2}\varepsilon_{ijk}\lambda_{d[i,j-1]}+\sum_{j=1}^{2}\varepsilon_{ijk}^2\right)\right]$$

$$=E\left[\left(2\mu^2(n_1+n_2)+4\mu\sum_{i=1}^{2}\sum_{k=1}^{n_i}S_{ik}+2\mu\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}\varepsilon_{ijk}+2\sum_{i=1}^{2}\sum_{k=1}^{n_i}S_{ik}^2+2\sum_{i=1}^{2}\sum_{k=1}^{n_i}S_{ik}\sum_{j=1}^{2}\varepsilon_{ijk}+\frac{1}{2}\sum_{i=1}^{2}\sum_{j=1}^{2}\sum_{k=1}^{n_i}\varepsilon_{ijk}^2\right)\right]$$

$$=2\mu^2(n_1+n_2)+2\sum_{i=1}^{2}\sum_{k=1}^{n_i}E\left[S_{ik}^2\right]+\frac{1}{2}\sum_{i=1}^{2}\sum_{k=1}^{n_i}E\left[\sum_{j=1}^{2}\varepsilon_{ijk}^2\right]$$

We know that $ E[x^2]=var(x)+E^2[x] $, we also know that $ E[S_{ik}]=0 $ and $ E[\varepsilon_{ijk}]=0 $, like this:

$$=2\mu^2(n_1+n_2)+2\sum_{i=1}^{2}\sum_{k=1}^{n_i}var\left(S_{ik}\right)+\frac{1}{2}\sum_{i=1}^{2}\sum_{k=1}^{n_i}var\left(\sum_{j=1}^{2}\varepsilon_{ijk}\right)$$

$$=2\mu^2(n_1+n_2)+2(n_1+n_2)\sigma_s^2+(n_1+n_2)\sigma^2$$

$$(***)=E\left[\frac{1}{2}\sum_{i=1}^{2}\sum_{j=1}^{2}\left(\sum_{k=1}^{n_i}\left(\mu+S_{ik}+\pi_j+\tau_{d[i,j]}+\lambda_{d[i,j-1]}+\varepsilon_{ijk}\right)\right)^2\right]$$

$$=2(n_1+n_2)\mu^2+4\sigma_s^2+4\sigma^2$$

$$(****)=E\left[\sum_{i=1}^{2}\frac{1}{2n_i}\left(\sum_{j=1}^{2}\sum_{k=1}^{n_i}\left(\mu+S_{ik}+\pi_j+\tau_{d[i,j]}+\lambda_{d[i,j-1]}+\varepsilon_{ijk}\right)\right)^2\right]$$

$$=2(n_1+n_2)\mu^2+4\sigma_s^2+2\sigma^2$$

Replacing $(\ast)$, $(\ast\ast)$, $(\ast\ast\ast)$ and $(\ast\ast\ast\ast)$, we get:

$$=\frac{1}{n_1+n_2-2}\left(2\mu^2(n_1+n_2)+2(n_1+n_2)\sigma_s^2+2(n_1+n_2)\sigma^2-2(n_1+n_2)\mu^2-2(n_1+n_2)\sigma_s^2\right.$$

$$\quad\left.-(n_1+n_2)\sigma^2-2(n_1+n_2)\mu^2-4\sigma_s^2-4\sigma^2+2(n_1+n_2)\mu^2+4\sigma_s^2+2\sigma^2\right)$$

$$=\frac{1}{n_1+n_2-2}\left((n_1+n_2-2)\sigma^2\right)$$

$$=\sigma^2$$

Therefore, the expected value of QM for the factors are:

$$E\left(QM_{\hbox{carry-over}}\right)=\frac{2n_1n_2}{(n_1+n_2)}(R_R-R_T)^2+2\sigma^2_S+\sigma^2$$

$$E\left(QM_{\hbox{inter}}\right)=2\sigma^2_S+\sigma^2$$

$$E\left(QM_{\hbox{droga}}\right)=\frac{2n_1n_2}{(n_1+n_2)}\left[(F_R-F_T)-\frac{(R_R-R_T)}{2}\right]^2+\sigma^2$$

$$E\left(QM_{\hbox{período}}\right)=\frac{2n_1n_2}{(n_1+n_2)}(\pi_1-\pi_2)^2+\sigma^2$$

$$E\left(QM_{\hbox{intra}}\right)=\sigma^2$$

Example 6.2.1

Consider a bioequivalence assay with a sample of $ 24 $ individuals, which was divided into two groups of $ 12 $. Each group received two types of treatment in two different periods.

Individual Formulation Sequence Period Cmax
1 2 T/R 1 5,771229
2 1 R/T 1 5,918942
3 2 T/R 1 5,753858
4 2 T/R 1 5,507472
5 2 T/R 1 5,634815
6 1 R/T 1 5,618185
7 2 T/R 1 5,790462
8 1 R/T 1 5,676459
9 1 R/T 1 5,960286
10 1 R/T 1 5,672687
11 2 T/R 1 5,937668
12 1 R/T 1 5,762966
13 2 T/R 1 5,836
14 1 R/T 1 5,508047
15 1 R/T 1 5,810569
16 2 T/R 1 5,730187
17 1 R/T 1 5,799308
18 2 T/R 1 5,950617
19 1 R/T 1 5,697382
20 2 T/R 1 5,775529
21 1 R/T 1 5,883044
22 2 T/R 1 5,771488
23 2 T/R 1 5,778946
24 1 R/T 1 5,715441
1 1 T/R 2 5,77721
2 2 R/T 2 5,863353
3 1 T/R 2 5,743881
4 1 T/R 2 5,476221
5 1 T/R 2 5,608805
6 2 R/T 2 5,564367
7 1 T/R 2 6,000553
8 2 R/T 2 5,702769
9 2 R/T 2 6,034215
10 2 R/T 2 5,750364
11 1 T/R 2 5,898801
12 2 R/T 2 5,596301
13 1 T/R 2 5,954801
14 2 R/T 2 5,741354
15 2 R/T 2 5,94414
16 1 T/R 2 5,751842
17 2 R/T 2 5,99174
18 1 T/R 2 6,168313
19 2 R/T 2 5,835787
20 1 T/R 2 5,754111
21 2 R/T 2 5,885648
22 1 T/R 2 5,616506
23 1 T/R 2 5,821823
24 2 R/T 2 5,747691

Table 9.6.3: Bioequivalence Test Sample

The statistical model for this planning is

$$y_{ijk} = \mu + S_{ik} + \pi_j + \tau_{d[i,j]} +\lambda_{d[i,j-1]}~+~ \varepsilon_{ijk} ~~~~~\begin{cases}i = 1, \cdots, s~~ \hbox{(Sequência)} \cr j = 1, \cdots, p~~ \hbox{(Período)} \cr k = 1, \cdots,n_i~~ \hbox{(Indivíduo)} \end{cases}$$

Where:

$ y_{ijk} $ represents the response of the kth individual in the ith sequence in the jth period;

$ \mu $ is a general average;

$ S_{ik} $ is the random effect of the kth individual in the sequence $ i $;

$ \pi_j $ is the period effect $ j $, with $ \sum_{j=1}^{p}\pi_j=0 $;

$\tau_{d[i,j]}$ is the direct effect of the treatment administered during the period $j$ of the sequence $i$ (Formulation Effect), with $\sum\tau_{d[i,j]}=0$;

$ \lambda_{d[i,j-1]} $ is the direct effect of the treatment administered during the period $ j-1 $ of the sequence $ i $ (Carry-over Effect), with $ \sum \tau_{d[i,j-1]}=0 $;

$ \varepsilon_{ijk} $ is the random error for the kth individual in the jth period in the ith sequence.

We are interested in testing whether the two formulations are equivalent. Therefore, based on the proposed model, we define the hypotheses as:

$$\begin{cases} H_0: F_R = F_T \cr H_1: F_R \neq F_T \end{cases} ~~~~ \hbox{Para testar o efeito da formulação}$$

Considering the model and the hypotheses presented, we calculated:

$$SQ_{\hbox{carry-over}}=\frac{2*12*12}{(12+12)}\left(5,7784-5,7838\right)^2=0,00035$$

$$SQ_{\hbox{inter}}=1605,05-1604,206926=0,843074$$

$$SQ_{\hbox{droga}}=\frac{12*12}{2(12+12)}\left(5,7519-5,8048-5,7698+5,7977\right)^2=0,001875$$

$$SQ_{\hbox{período}}=\frac{12*12}{2(12+12)}\left(5,7519-5,8048+5,7698-5,7977\right)^2=0,01958592$$

$$SQ_{\hbox{intra}}=1605,20-1605,05-0,001875-0,01958592=0,12853908$$

$$QM_{\hbox{carry-over}}=\frac{0,00035}{1}=0,00035$$

$$QM_{\hbox{inter}}=\frac{0,843074}{12+12-2}=0,03832$$

$$QM_{\hbox{droga}}=\frac{0,001875}{1}=0,001875$$

$$QM_{\hbox{período}}=\frac{0,01958592}{1}=0,01958592$$

$$QM_{\hbox{intra}}=\frac{0,12853908}{12+12-2}=0,0058$$

9.6.3 Estimation of model parameters

The interest of researchers in cross-over studies is to know how similar, different or equivalent the formulations are. The statistical analysis proposed by Westlake (1972 and 1976), Metzler (1974) is the use of confidence intervals for the difference and ratio between the means of the formulations. In this section, we will talk about confidence intervals for the mean and the difference in means.

Confidence Interval for the Mean

Let the model be (neglecting the carry-over effect):

$$ Y_{ijk}=\mu+S_{ik}+\pi_j+\tau_{d[i,j]}+\varepsilon_{ijk}\begin{cases} i=1,\cdots,s\quad \hbox{(Sequência)} \cr j=1,\cdots,p\quad \hbox{(Período)} \cr k=1,\cdots,n_i\quad \hbox{(Indivíduo)} \end{cases}$$

Considering a cross-over design, without replications, for two drugs (T = test; R = reference), we have that each individual is randomly allocated to the RT or TR sequence in two dosing periods. That is, individuals allocated to the RT (TR) sequence receive formulation R (T) in the first dosing period and formulation T (R) in the second dosing period.

Be:

$ \bar{Y}_R=\frac{1}{2}\left(\bar{Y}_{11.}+\bar{Y}_{22.}\right) $ the average referring to the reference treatment

and

$ \bar{Y}_T=\frac{1}{2}\left(\bar{Y}_{21.}+\bar{Y}_{12.}\right) $ the average for the test treatment.

So:

$$E(\bar{Y}_R)=\frac{1}{2}\left(2\mu+\pi_1+\pi_2+2F_R\right)$$

$$var(\bar{Y}_R)=\frac{(\sigma^2_S+\sigma^2)}{4}\left(\frac{1}{n_1}+\frac{1}{n_2}\right)$$

$$E(\bar{Y}_T)=\frac{1}{2}\left(2\mu+\pi_1+\pi_2+2F_T\right)$$

$$var(\bar{Y}_T)=\frac{(\sigma^2_S+\sigma^2)}{4}\left(\frac{1}{n_1}+\frac{1}{n_2}\right)$$

Considering $ \bar{Y}_l $ for $ l=R $ or $ T $ the mean of interest, then we know that $ \quad\dfrac{\bar{Y}_l-E(\bar{Y}_l)}{var(\bar{Y}_l)}\sim N(0,1). $

Being $ E(\bar{Y}_l)=\mu_l $ and $ (\sigma^2_S+\sigma^2) $ estimated by $ QM_{\hbox{intra}} $ , then:

$$T=\dfrac{\bar{Y}_l-\mu_l}{\sqrt{\frac{QM_{\hbox{intra}}}{4}\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}} \sim t_{n_1+n_2-2}.$$

Confidence Interval for Mean Difference

We know that

$$\bar{Y}_T\sim N\left(2\mu+\pi_1+\pi_2+2F_T;\frac{1}{4}(\sigma^2_S+\sigma^2)\left(\frac{1}{n_1}+\frac{1}{n_2}\right)\right)$$

and

$$\bar{Y}_R\sim N\left(2\mu+\pi_1+\pi_2+2F_R;\frac{1}{4}(\sigma^2_S+\sigma^2)\left(\frac{1}{n_1}+\frac{1}{n_2}\right)\right)$$

In this sense,

$$\bar{Y}_T-\bar{Y}_R\sim N\left(F_T-F_R;\frac{1}{2}(\sigma^2_S+\sigma^2)\left(\frac{1}{n_1}+\frac{1}{n_2}\right)\right)$$

We then have to,

$$Z=\frac{\left(\bar{Y}_T-\bar{Y}_R\right)-\left(F_T-F_R\right)}{\sqrt{\frac{(\sigma^2_S+\sigma^2)}{2}\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}}\sim~N(0,1).$$

Let’s consider that $ (\sigma^2_S+\sigma^2) $ can be estimated by $ QM_{{intra}} $. With this,

$$U=\frac{(n_1+n_2-2)QM_{\hbox{intra}}}{(\sigma^2_S+\sigma^2)}\sim\chi^2(n_1+n_2-2)$$

Since Z and U are independent, then

$$T=\frac{Z}{\sqrt{\frac{U}{n_1+n_2-2}}}=\frac{\left(\bar{Y}_T-\bar{Y}_R\right)-\left(F_T-F_R \right)}{\sqrt{\frac{QM_{\hbox{intra}}}{2}\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}} \sim t(n_1+n_2-2)$$

From there, setting a value $ \alpha $ such that, $ 0 \ < \ 1-\alpha \ < \ 1 $, we can find a value $ t_{\frac{\alpha}{2}} $ such that $ P\left(-t_{\frac{\alpha}{2}} \ < \ T \ < \ t_{\frac{\alpha}{2}}\right)=1-\alpha $.

Therefore, the confidence interval for $ (F_T-F_R) $, with significance level $ \alpha $, is given by:

$IC[(F_T-F_R) ; \gamma] = \left[\left(\bar{Y}_T-\bar{Y}_R \right)-t_{\frac{\alpha}{2}}\sqrt{\frac{QM_{\hbox{intra}}}{2}\left(\frac{1}{n_1}+\frac{1}{n_2}\right)} \ < \ \left(F_T-F_R\right) \ < \ (\bar{Y}_T-\bar{Y}_R)+t_{\frac{\alpha}{2}}\sqrt{\frac{QM_{\hbox{intra}}}{2}\left(\frac{1}{n_1}+\frac{1}{n_2}\right)}\right]. $

Example 6.3.1

Returning to Example 1.2.1.

We calculate the confidence interval for $ \mu_l $.

For $ l = R, T $ we have to:

  • For $ \mu_R $.

We know that $ \bar{y}_R=5,7748 $,$ n_1=12 $,$ n_2=12 $,$ QM_{\hbox{intra}}=0,005842685 $ and for $ \alpha = 10 \char37 $ we have to $ t_{(\frac{\alpha}{2},22)}=1,7171 $. So the range is

$$\left(5,7480;5,8016\right)$$

  • For $ \mu_T $.

We know that $ \bar{y}_T=5,7873 $,$ n_1=12 $,$ n_2=12 $,$ QM_{\hbox{intra}}=0,005842685 $ and for $ \alpha=10 \char37 $ we have to $ t_{(\frac{\alpha}{2},22)}=1,7171 $. So the range is

$$\left(5,7605;5,8141\right)$$

Now we calculate the confidence interval for $ (F_T-F_R) $.

We know that $ \bar{y}_T=5,7873 $,$ \bar{y}_R=5,7748 $,$ n_1=12 $,$ n_2=12 $,$ QM_{\hbox{intra}}=0,005842685 $ and for $ \alpha=10 \char37 $ we have to $ t_{(\frac{\alpha}{2},22)}=1,7171 $. So the range is

$$\left(-0,0254;0,0504\right)$$

9.6.4 Statistical Analysis

Specifically, we are interested in testing the following hypotheses about the effects of factors:

Objective Hypothesis
effect of the Period $\begin{cases}H_0: \pi_1 = \pi_2 \cr H_1: \pi_1 \neq \pi_2 \end{cases}$
Effect of the Formulation $ \begin{cases} H_0: F_R = F_T \cr H_1: F_R \neq F_T \end{cases} $
carry-over effect $\begin{cases}H_0: R_R = R_T \cr H_1: R_R \neq R_T \end{cases}$

Table 9.6.4: Hypotheses about the effects of factors

We will show how these hypotheses are tested using analysis of variance. To determine the test statistic, we will observe that

$$SQ_{\hbox{entre}}=SQ_{\hbox{carry-over}}+SQ_{\hbox{inter}}$$

and

$$SQ_{\hbox{dentro}}=SQ_{\hbox{droga}}+SQ_{\hbox{período}}+SQ_{\hbox{intra}}$$

with that,

$$\frac{SQ_{\hbox{entre}}}{2(2\sigma^2_S+\sigma^2)}=\frac{SQ_{\hbox{carry-over}}}{2(2\sigma^2_S+\sigma^2)}+\frac{SQ_{{inter}}}{2(2\sigma^2_S+\sigma^2)} \tag{1}$$

and

$$\frac{SQ_{\hbox{dentro}}}{\sigma^2}=\frac{SQ_{\hbox{droga}}}{\sigma^2}+\frac{SQ_{\hbox{período}}}{\sigma^2}+\frac{SQ_{\hbox{intra}}}{\sigma^2} \tag{2}$$

So, under $ H_0 $ we have to

$$\chi^2_{n_1+n_2-1}=\chi^2_{1}+\chi^2_{n_1+n_2-2}\tag{3}$$

and

$$\chi^2_{n_1+n_2}=\chi^2_{1}+\chi^2_{1}+\chi^2_{n_1+n_2-2} \tag{4}$$

Therefore, the sum of squares in Equation (1) divided by $ 2(2\sigma^2_S+\sigma^2) $ and the sum of squares of Equation (2) divided by $ \sigma^2 $ has a chi-square distribution with $ n_1+n_2-1 $ and $ n_1+n_2 $ degrees of freedom, respectively. Furthermore, each portion of Equations (1) and (2) also has a chi-square distribution with degrees of freedom expressed in Equations (4) and (5), respectively. Using Cochram’s theorem, we verify that the chi-square distributions expressed on the right side of Equation (3) are independent, the same occurs in Equation (4). Therefore, the statistic to test the carry over effect,

$$F=\frac{\frac{SQ_{\hbox{carry-over}}}{2(2\sigma^2_S+\sigma^2)}}{\frac{SQ_{\hbox{inter}}}{2(2\sigma^2_S+\sigma^2)(n_1+n_2-2)}}=\frac{QM_{\hbox{carry-over}}}{QM_{\hbox{inter}}} \sim F(1;n_1+n_2-2)$$

has a Fisher-Snedecor distribution with $ 1 $ degree of freedom in the numerator and $ n_1+n_2-2 $ degrees of freedom in the denominator.

The critical region (RC) of the F test is given by

$ RC=(F\in\Re^+|Fgt;F_c) $.

Therefore, using the number of degrees of freedom of the numerator and denominator, we can, considering a level of significance $ \alpha $ find the value of $ F_c $ in the F-Snedecor distribution table. The figure below shows the critical region of the test.

Figura9.1.5

Figure 9.6.1: Quantile of the F-Snedecor distribution.

Note: The test $ F $ for the averages of the drug and period factors it develops in the same way, however, we must note that in the denominator of the statistic $ F $ we should use $ SQ_{\hbox{intra}} $ instead of $ SQ_{\hbox{inter}} $.

The statistical test for the equality of means hypothesis is summarized in the table. This table is called the analysis of variance table.

Factor Degrees of Freedom Sum of Squares Medium Squares F
between
carry-over $1$ $SQ_{\text{carry-over}}$ $QM_{\text{carry-over}}$ $\dfrac{QM_{\text{carry-over}}}{QM_{\text{inter}}}$
inter $n_1 + n_2 - 2$ $SQ_{\text{inter}}$ $QM_{\text{inter}}$
inside
drug $1$ $SQ_{\text{droga}}$ $QM_{\text{droga}}$ $\dfrac{QM_{\text{droga}}}{QM_{\text{intra}}}$
period $1$ $SQ_{\text{período}}$ $QM_{\text{período}}$ $\dfrac{QM_{\text{período}}}{QM_{\text{intra}}}$
intra $n_1 + n_2 - 2$ $SQ_{\text{intra}}$ $QM_{\text{intra}}$
Total $2(n_1 + n_2) - 1$ $SQT$

Table 9.6.5: Analysis of Variance Table (ANOVA).

Example 1.4.1:

Returning to Example 1.2.1.

Calculating the test statistics we have:

$$F_0=\frac{0,00035}{0,03832}=0,01$$

$$F_0=\frac{0,001875}{0,0058}=0,321$$

$$F_0=\frac{0,01958592}{0,0058}=3,35$$

Replacing the results found in the ANOVA table, we have:

Factor Degrees of Freedom Sum of Squares Medium Squares F
between
carry-over 1 0,00035 0,00035 0,01
inter 22 0,843074 0,03832
inside
drug 1 0,001875 0,001875 0,321
period 1 0,01958592 0,01958592 3,35
intra 22 0,12853908 0,0058
Total 47

Table 9.6.6: ANOVA Table

Last modified 13.10.2026: ajuste das numerações (e4440012)
↑