plot.FRBhot: Plot Method for Objects of class 'FRBhot'

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/plotFRBhot.R

Description

Plot function for FRBhot objects: plots the bootstrap histogram of the null distribution, and the simultaneous confidence limits (scaled)

Usage

1
2
## S3 method for class 'FRBhot'
plot(x,...)

Arguments

x

an R object of class FRBhot, typically created by FRBhotellingS or FRBhotellingMM

...

potentially more arguments

Details

This generic plot function presents two graphs. The first (top panel) is a histogram representing the test statistics in the bootstrap samples, which estimate the null distribution. A red line indicates the test statistic in the original sample (but is not shown when this value exceeds 100).

The second (bottom panel) displays the simultaneous confidence intervals based on the same bootstrap result. The intervals are scaled such that they all have the same length. Furthermore, in case of the one-sample test the intervals are shown relative to the hypothesized value mu0. Such visualization is meant to easily recognize the extent to which each variable is responsible for the overall deviation from the hypothesized value.

Author(s)

Gert Willems, Ella Roelant and Stefan Van Aelst

References

See Also

FRBhotellingS, FRBhotellingMM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## 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)
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)

FRB documentation built on May 29, 2017, 5:45 p.m.

Related to plot.FRBhot in FRB...