# \donttest{
## One sample robust Hotelling test
data(ForgedBankNotes)
samplemean <- apply(ForgedBankNotes, 2, mean)
res = FRBhotellingS(ForgedBankNotes, mu0=samplemean,R=99)
plot(res)
## Note that the test rejects the hypothesis that the true mean equals the
## sample mean; this is due to outliers in the data (i.e. the robustly estimated
## center apparently significantly differs from the non-robust sample mean.
## It is clear from the scaled simultaneous confidence limits that the rejection
## of the hypothesis is due to the differences in variables Bottom and Diagonal
## For comparison, the hypothesis would be accepted if only the first three
## variables were considered:
res = FRBhotellingS(ForgedBankNotes[,1:3], mu0=samplemean[1:3],R=99)
plot(res)
## Two sample robust Hotelling test
data(hemophilia, package="rrcov")
res <- FRBhotellingMM(cbind(AHFactivity, AHFantigen) ~ gr, data=hemophilia, R=99)
plot(res)
## From the confidence limits it can be seen that the significant difference
## is mainly caused by the AHFactivity variable.
## the red line on the histogram indicates the test statistic value in the original
## sample (it is omitted if the statistic exceeds 100)
# }
Run the code above in your browser using DataLab