# TwoSamplesHT2: Two Independent Samples Hotelling T^2 Test In MVTests: Multivariate Hypothesis Tests

 TwoSamplesHT2 R Documentation

## Two Independent Samples Hotelling T^2 Test

### Description

`TwoSamplesHT2` function computes Hotelling T^2 statistic for two independent samples and gives confidence intervals.

### Usage

``````TwoSamplesHT2(data, group, alpha = 0.05, Homogenity = TRUE)
``````

### Arguments

 `data` a data frame. `group` a group vector consisting of 1 and 2 values. `alpha` Significance Level that will be used for confidence intervals. default=0.05 `Homogenity` a logical argument. If sample covariance matrices are homogeneity,then `Homogenity=TRUE`. Otherwise `Homogenity=FALSE` The homogeneity of covariance matrices can be investigated with `BoxM` function.

### Details

This function computes two independent samples Hotelling T^2 statistics that is used to test whether two population mean vectors are equal to each other. When `H0` is rejected, this function computes confidence intervals for all variables to determine variable(s) affecting on rejection decision. Moreover, when covariance matrices are not homogeneity, the approach proposed by D. G. Nel and V. D. Merwe (1986) is used.

### Value

a list with 8 elements:

 `HT2` The value of Hotelling T^2 Test Statistic `F` The value of F Statistic `df` The F statistic's degree of freedom `p.value` p value `CI` The lower and upper limits of confidence intervals obtained for all variables `alpha` The alpha value using in confidence intervals `Descriptive1` Descriptive Statistics for the first group `Descriptive2` Descriptive Statistics for the second group

### Author(s)

Hasan BULUT <hasan.bulut@omu.edu.tr>

### References

Rencher, A. C. (2003). Methods of multivariate analysis (Vol. 492). John Wiley & Sons.

Tatlidil, H. (1996). Uygulamali Cok Degiskenli Istatistiksel Yontemler. Cem Web.

D.G. Nel & C.A. Van Der Merwe (1986) A solution to the multivariate behrens fisher problem, Communications in Statistics:Theory and Methods, 15:12, 3719-3735

### Examples

``````
data(iris)
G<-c(rep(1,50),rep(2,50))
# When covariances matrices are homogeneity
results1 <- TwoSamplesHT2(data=iris[1:100,1:4],group=G,alpha=0.05)
summary(results1)
# When covariances matrices are not homogeneity
results2 <- TwoSamplesHT2(data=iris[1:100,1:4],group=G,Homogenity=FALSE)
summary(results2)
``````

MVTests documentation built on Nov. 3, 2023, 5:11 p.m.