82 Equivalence and Noninferiority Tests
> mu3_est <- mean(X3)
> mu_est <- c(mu1_est,mu2_est,mu3_est)
> mu_est
[1] 99.47725 33.12300 99.27825
> mu0 <- c(100,32,99)
> mu0
[1] 100 32 99
> diff <- mu_est - mu0
> diff
[1] -0.52275 1.12300 0.27825
> n <- length(X1)
> n
[1] 40
> T2 <- n*t(diff)%*% cmatinv%*% diff
> T2
[,1]
[1,] 4908.197
> k <- 3
> Fstat <- (n-k)*T2/((n-1)*k)
> Fstat
[,1]
[1,] 1552.165
> delta <- c(3,2,3)
> nct <- n*t(delta)%*%cmatinv%*%delta
> nct
[,1]
[1,] 2664.248
> Fcrit <- qf(0.95,k,n-k,nct)
> Fcrit
[1] 1371.96
Since Fstat > Fcrit, we fail to reject H
0
, concluding that the mean vector is
not equivalent to μ
0
.
The function t(X) in R returns the transpose of the matrix (or vector) X.