hotel2T2: Hotelling's multivariate version of the 2 sample t-test for...

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

View source: R/hotel2T2.R

Description

Hotelling's test for testing the equality of two Euclidean population mean vectors.

Usage

1
hotel2T2(x1, x2, a = 0.05, R = 999, graph = FALSE)

Arguments

x1

A matrix containing the Euclidean data of the first group.

x2

A matrix containing the Euclidean data of the second group.

a

The significance level, set to 0.05 by default.

R

If R is 1 no bootstrap calibration is performed and the classical p-value via the F distribution is returned. If R is greater than 1, the bootstrap p-value is returned.

graph

A boolean variable which is taken into consideration only when bootstrap calibration is performed. IF TRUE the histogram of the bootstrap test statistic values is plotted.

Details

Multivariate analysis of variance assuming equality of the covariance matrices. The p-value can be calculated either asymptotically or via bootstrap.

Value

A list including:

mesoi

The two mean vectors.

info

The test statistic, the p-value, the critical value and the degrees of freedom of the F distribution (numerator and denominator). This is given if no bootstrap calibration is employed.

pvalue

The bootstrap p-value is bootstrap is employed.

note

A message informing the user that bootstrap calibration has been employed.

runtime

The runtime of the bootstrap calibration.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <[email protected]> and Giorgos Athineou <[email protected]>

References

Everitt B. (2005). An R and S-Plus Companion to Multivariate Analysis p. 139-140. Springer.

See Also

james, maov, el.test2, comp.test

Examples

1
2
3
4
hotel2T2( as.matrix(iris[1:25, 1:4]), as.matrix(iris[26:50, 1:4]) )
hotel2T2( as.matrix(iris[1:25, 1:4]), as.matrix(iris[26:50, 1:4]), R = 1 )
james( as.matrix(iris[1:25, 1:4]), as.matrix(iris[26:50, 1:4]) )
james( as.matrix(iris[1:25, 1:4]), as.matrix(iris[26:50, 1:4]), R = 1 )

Example output

$mesoi
         Sepal.Length Sepal.Width Petal.Length Petal.Width
Sample 1        5.028       3.480        1.460       0.248
Sample 2        4.984       3.376        1.464       0.244

$pvalue
[1] 0.883

$mesoi
         Sepal.Length Sepal.Width Petal.Length Petal.Width
Sample 1        5.028       3.480        1.460       0.248
Sample 2        4.984       3.376        1.464       0.244

$info
      test    p-value   critical   numer df   denom df 
 0.2693994  0.8961307  2.5787392  4.0000000 45.0000000 

$note
[1] "Bootstrap calibration"

$mesoi
         Sepal.Length Sepal.Width Petal.Length Petal.Width
Sample 1        5.028       3.480        1.460       0.248
Sample 2        4.984       3.376        1.464       0.244

$pvalue
[1] 0.906

$runtime
   user  system elapsed 
  0.133   0.003   0.138 

$note
[1] "James test"

$mesoi
         Sepal.Length Sepal.Width Petal.Length Petal.Width
Sample 1        5.028       3.480        1.460       0.248
Sample 2        4.984       3.376        1.464       0.244

$info
              test            p-value         correction corrected.critical 
         1.1494375          0.9119979          1.1664380         11.0668476 

Compositional documentation built on March 18, 2018, 1:57 p.m.