## One-sample classical test
data(delivery)
delivery.x <- delivery[,1:2]
T2.test(delivery.x)
## One-sample robust test
data(delivery)
delivery.x <- delivery[,1:2]
T2.test(delivery.x, method="mcd")
## Two-sample classical test
data(hemophilia)
grp <-as.factor(hemophilia[,3])
x <- hemophilia[which(grp==levels(grp)[1]),1:2]
y <- hemophilia[which(grp==levels(grp)[2]),1:2]
T2.test(x,y)
## or using the formula interface
T2.test(as.matrix(hemophilia[,-3])~hemophilia[,3])
if (FALSE) {
## Two-sample robust test
T2.test(x,y, method="mcd") ## error - not yet implemented
}
Run the code above in your browser using DataLab