Displaying 1 result from an estimated 1 matches for "hotellingst2".
2008 Mar 16
1
stats/debugging question hotelling t-sq
...radiation
y = x[26:45,1:10]
x = x[2:25,1:10]
p = ncol(x); p
nx = nrow(x); nx
ny = nrow(y); ny
n = nx+ny; n
# (t(x)-colMeans(x)) %*% t(t(x)-colMeans(x))
T2 = nx*ny/n * t(colMeans(x)-colMeans(y)) %*% solve( (
(nx-1)*cov(x)+(ny-1)*cov(y) )/( n-2 ) ) %*% (colMeans(x)-colMeans(y));
T2
library(ICSNP)
HotellingsT2(y,x)
http://en.wikipedia.org/wiki/Hotelling's_T-square_distribution
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/60962.html