Switch to unified view

a b/Semantic Features/ttestScript.m
1
%ttesting
2
3
%test for significance. 1. This whole bloody process revolves around
4
%negatives so its easy to get turned around in the naming or meaning. 2.
5
%I'm including all 3 t-tests because you will get confused, and looking at
6
%the results of all 3 options saves a lot of time remembering what method
7
%does what you want. 3. Depending one how strong your results are, you might want a different one anyhow 
8
9
%We want to do a one tail test. We only care if the ws is better or equal
10
%to rt (for now) vs ws being worse than rt. Therefore null hypothesis will
11
%be that wsAcc >= rtAcc (> comes from the one tail and exclusion).
12
%Alternative hypothesis will be wsAcc < rtAcc 
13
%'tail', 'left' Set the alternative hypothesis to be that the population mean of x is less than the population mean of y.
14
%make x = wsAcc and y = rtAcc
15
%Accepting the null hypothesis is success (Answer = 0. p >= 0.05)
16
%Rejecting the null hypothesis is failure (Meaning that wsAcc < rtAcc)
17
18
19
for i = 1:numCategories
20
    pwsMultiEnsNotGreater(i) =  isNotGreaterTTest(wsMultiEnsPred(:,i), rtEnsPred(:,i), Yaverage(:,i), Yaverage(:,i)); %low p means greater
21
    
22
    pwsMultiEnsNotLess(i) = isNotLessTTest(wsMultiEnsPred(:,i), rtEnsPred(:,i), Yaverage(:,i), Yaverage(:,i)); %low p means less than, high P means not less than (possibly equal)
23
    pwsMultiEnsNotEqual(i) = isNotSameTTest(wsMultiEnsPred(:,i), rtEnsPred(:,i), Yaverage(:,i), Yaverage(:,i)); %low p means unequal, high p means they're the same
24
end
25
26
27
wsMultiEnsImprovement = wsMultiEnsSuccess - rtEnsSuccess;
28
[wsMultiEnsImprovement;pwsMultiEns;pwsMultiEns<0.05];
29
30
%T test notes:
31
%Three types of t tests
32
%One Sample - If we already have a known (Iron Clad) value from other experiments and
33
%want to know if this experiment produced a differing result. - Nope
34
%Paired Two Sample - if you are testing the same guys but after changing
35
%something. Is this us? Same photos, different processing.
36
%Independant Two Sample - Probably us?
37
%a = Yes or no. uselsess
38
%b = probability they are the same. Lower is better. Less that 0.05 is good
39
%c = Confidence Interval. 
40
%d = tstat, the raw T value. df Degrees of Freedom. sd - standar deviation.