markallenthornton / MatlabTFCE

Standalone MATLAB implementation of permutation TFCE correction
MIT License
42 stars 21 forks source link

independent t-test variance normalisation for group 2 #5

Closed iancharest closed 5 years ago

iancharest commented 5 years ago

Hi Mark,

thanks for your code. Just a quick thought, in matlab_tfce_ttest_independent.m line 42:

truestat = (mean(imgs1,4)-mean(imgs2,4))./sqrt(var(imgs1,0,4)/nsub1+var(imgs2,0,4)/nsub1);

shouldn't this be

truestat = (mean(imgs1,4)-mean(imgs2,4))./sqrt(var(imgs1,0,4)/nsub1+var(imgs2,0,4)/nsub2);

this same line is correct when you implement it in the permutation test (line 77):

rstats = (mean(rimgs1,2)-mean(rimgs2,2))./sqrt(var(rimgs1,0,2)/nsub1+var(rimgs2,0,2)/nsub2);

ian

markallenthornton commented 5 years ago

You're quite right - I've merged your pull request. Thanks for the catch!