FRBhotellingMM {FRB} | R Documentation |
Robust one-sample and two-sample Hotelling test using the MM-estimator and the Fast and Robust Bootstrap.
FRBhotellingMM(Xdata, Ydata=NULL, mu0 = 0, R = 999, conf = 0.95, method = c("pool", "HeFung"), control=MMcontrol(...), ...)
Xdata |
a matrix or data-frame |
Ydata |
an optional matrix or data-frame in case of a two-sample test |
mu0 |
an optional vector of data values (or a single number which will be repeated p times) indicating the
true value of the mean (does not apply in case of the two-sample test). Default is the null vector mu0=0 . |
R |
number of bootstrap samples. Default is R=999 . |
conf |
confidence level for the simultaneous confidence intervals. Default is conf=0.95 . |
method |
for the two-sample Hotelling test, indicates the way the common covariance matrix is estimated:
"pool" = pooled covariance matrix, "HeFung" = using the He and Fung method . |
control |
a list with control parameters for tuning the MM-estimate and its computing algorithm,
see MMcontrol (). |
... |
allows for specifying control parameters directly instead of via control |
The classical Hotelling test for testing if the mean equals a certain value or if two means
are equal is modified into a robust one through substitution of the empirical estimates
by the MM-estimates of location and scatter. The MM-estimator, using Tukey's biweight function, is tuned by default to have
a breakdown point of 50% and 95% location efficiency. This could be changed through the control
argument if desired.
The MM-estimator is computed by a call to MMest_loccov
() or twosampleMM
(), in case of one- and two-sample
tests respectively. These functions first perform the fast-S algorithm (see Sest_loccov
() or twosampleS
())
and do the M-part by reweighted least squares iteration. See MMcontrol
for some adjustable tuning parameters regarding the algorithm.
The fast and robust bootstrap is used to mimic the distribution of the test statistic under the null hypothesis. For instance, the 5% critical value for the test is given by the 95% quantile of the recalculated statistics.
Robust simultaneous confidence intervals for linear combinations of the center are developed similarly to the classical case
(Johnson and Wichern, 1988, page 239). The value CI
is a (p x 2) matrix with the confidence intervals for each element
of the center. It consists of two rows, the first being the lower bound and the second the upper bound.
For the two-sample Hotelling test we assume that the samples have an underlying distribution with the same covariance matrix.
This covariance matrix can be estimated in two different ways using the pooled covariance matrix or the two-sample
estimator of He and Fung (He and Fung 2000), and argument method
defaults to the first option.
For more details see Roelant et al. (2008).
In the two-sample version, the null hypothesis always states that the two means are equal. For the one-sample version, the default
null hypothesis is that the mean equals zero, but the hypothesized value can be changed and specified through argument mu0
.
See print.FRBhot
for details on the output.
An object of class FRBhot
, which is a list containing the following components:
pvalue |
p-value of the robust one or two-sample Hotelling test, determined by the fast and robust bootstrap |
teststat |
the value of the robust test statistic. |
teststat.boot |
the bootstrap recalculated values of the robust test statistic. |
Mu |
center of the sample in case of one-sample Hotelling test |
Mu1 |
center of the first sample in case of the two-sample Hotelling test |
Mu2 |
center of the second sample in case of the two-sample Hotelling test |
Sigma |
covariance of one-sample or common covariance matrix in the case of two samples |
CI |
bootstrap simultaneous confidence intervals for each component of the center |
conf |
a copy of the conf argument |
data |
the names of the Xdata and possibly Ydata object |
meth |
a character string giving the estimator that was used |
Ella Roelant and Gert Willems
print.FRBhot
, FRBhotellingS
, MMcontrol
## One sample robust Hotelling test data(delivery) delivery.x <- delivery[,1:2] FRBhotellingMM(delivery.x) ## Two sample robust Hotelling 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] #using the pooled covariance matrix to estimate the common covariance matrix FRBhotellingMM(x,y,method="pool") #using the estimator of He and Fung to estimate the common covariance matrix FRBhotellingMM(x,y,method="HeFung")