Last chance! 50% off unlimited learning
Sale ends in
T2.test(x, ...)
## S3 method for class 'default':
T2.test(x, y = NULL, mu = 0, conf.level = 0.95, method=c("c", "mcd"), ...)
## S3 method for class 'formula':
T2.test(formula, data, subset, na.action, \dots)
lhs ~ rhs
where lhs
is a numeric data frame or matrix giving the observations and rhs
a factor
with two levels giving the corresponding groups.model.frame
) containing the variables in the
formula formula
. By default the variables are taken from
environment(for
NA
s. Defaults to
getOption("na.action")
(currently only "na.rm" used)"htest"
containing the following components:CovMcd
## One-sample robust test
data(delivery)
delivery.x <- delivery[,1:2]
T2.test(delivery.x, method="mcd")
## Two-sample robust 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])
T2.test(x,y, method="mcd") ## error - not yet implemented
Run the code above in your browser using DataLab