s-news
[Top] [All Lists]

[no subject]

you could try the following:

# Hotelling's Test
# x is your data in a two columns matrix
n <- dim(x)[1]
p <- dim(x)[2]
x.bar <- as.matrix(colMeans(x))
m0 <- as.matrix(c(0,0))
S <- var(x)
g <-
(n/(n-1))*((n-p)/p)*t(x.bar-m0)%*%solve(S)%*%(x.bar-m0)
p.value <- 1-pf(g, p, n-p)
# Null Hypothesis: x.bar==m0
# Alternative Hypothesis: x.bar!=m0
p.value

I hope this helps.

Best,
Dimitris


<Prev in Thread] Current Thread [Next in Thread>
  • [no subject], Unknown <=