Hi Darren,
Yes, the tests against zero are the factor-level's scores against the mean over all levels; and you beat me to it, great :) You could alternatively add this after line 39 in teg_report.m, maybe handy for output:
tyr = myr ./ seyr;
fprintf([prestr '\t\tt_cells = [']);
for ib = 1:length(tyr),
fprintf([num2str(tyr(ib))]);
if ib < length(myr),
fprintf(', ');
else
fprintf(']\n');
end;
end;
I think I answered my own question after studying the code some more. I'm posting what I did in case anyone else is looking to do the same.
Below the line:
[dum, expanded0] = teg_inner_recode_raw(M_corr, NM, cellsets, iPred);
I added:
[dum_raw, ~] = teg_inner_recode_raw(M_raw, NM, cellsets, iPred);
dum_raw gives the means of the raw scores in each level, averaged across other factors. You'll have to make dum_raw a global variable to do further analysis (I'm not sure why).
Then I added the following before the final 'end' call:
disp('t-test vs true 0')
for level=1:size(dum_raw,2)
[~,p,CI,stat]=ttest(dum_raw(:,level));
disp([num2str(level) ': ' 't(' num2str(stat.df) ')=' num2str(stat.tstat) ', p= ' num2str(p) ' (CI=' num2str(CI(1)) ' to ' num2str(CI(2)) ')'])
end
This provides t-statistics for each level of each factor with a test value of 0. Of course you could also do any other stats you like with dum_raw.
Hopefully all this checks out with the way the code is written. Thomas, please let me know if it looks incorrect.
-Darren
Hi Thomas,
Thank you for the quick response.
I was able to replicate the Post-hoc vs 0 tests by doing paired-samples t-tests between a factor's mean and each of it's levels. Is that in fact what your test does?
What I need is to see if each level of a factor is significantly different than the test value 0 (or any other given test value). This would essentially be the same as a simple one-sample t-test of each level against 0. I believe this could be done by modifying your current Post-hoc vs 0 test so that the factor's overall mean is replaced with a vector of 0's, correct?
Could you suggest how/where I could modify the code in order to do this?
Thank you,
Darren
Hi Thomas,
Thanks for the great code.
Can you explain how the Post-hoc test vs 0 is created in the output?
I'm working on a 3 x 4 rmANOVA with all positive data, however Post-hoc test vs 0 reports a negative t-score for the fourth level of the second factor. I can't figure out why this would be if it's doing a test of positive values against 0.
Running a normal t-test in matlab (2-tailed default) returns a positive (significant) value.
I'm hoping I can get this working as I need it to in order to save countless exports to SPSS.
Thanks in advance,
-Darren
Comment only