Multiple Hypothesis Testing - degrees of freedom problem

ivkica08

Banned
Joined
Jun 9, 2014
Messages
1
I need to do Multiple Hypothesis Testing, and i don't know how to calculate degrees of freedom of the test.


Here is the code from Matlab:


control=[57 86 114 139 172; 60 93 123 146 177; 52 77 111 144 185;
49 67 100 129 164; 56 81 104 121 151; 46 70 102 131 153; 51 71 94 110 141;
63 91 112 130 154; 49 67 90 112 140;57 82 110 139 169]


mi_kapa = mean ( control )
S_kapa = cov( control )


X= mvnrnd ( mi_kapa , S_kapa ,10)


sigmaX =cov(X)


s= size ( control );
n=s(1 ,1);
p=s(1 ,2);


V= sigmaX *(n -1)


m=5;
L =20* rand (5 ,5);
sigma0 =L* transpose (L)


[lc ,p]= chol (sigma0 ,'lower')


eig ( sigma0 )


df=5*5-5;% this is wrong -> degrees of freedom



lambda_2_n=det(inv(sigma0)*V)/((1/p)*trace(inv(sigma0)*V))^p;
lambda=(lambda_2_n)^(n/2)


stat =-n*log( lambda ) % and this is wrong, does formula have to be stat=-2*log(lambda)?


pv=1-chi2cdf(stat,df)


Please help :)
 
Top