-
Notifications
You must be signed in to change notification settings - Fork 2
/
dbs_hypo_test.m
43 lines (42 loc) · 2.16 KB
/
dbs_hypo_test.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function [s, t, p] = dbs_hypo_test(setmat, label, hypotest, direction)
% DBS_HYPO_TEST Set the hypothesis testing
% ================================================================================================================
% [ INPUTS ]
% setmat = 3-D matrix which consists of a set of 2-D matrices from multiple subjects.
% A size of setmat should be [N by N by M].
% N: the number of nodes.
% M: the number of subjects
%
% label = 1-D vector containing a list of labels
% with a value 0 (group 1) or 1 (group 2), indicating in which group each subject is included (for hypoTest = 0 or 1)
% or with individual measures of behavioral performance from each subjects for correlation (for hypoTest = 2)
%
% hypoTest = type of test (default = 0).
% 0: two-sample paired t-test (ttest)
% 1: two-sample unpaired t-test (ttest2) (assumping the same variance for the two groups)
% 2: correlation analysis (corr)
%
% direction
% 0: g1 = g2 (two-tail)
% 1: g1 > g2 (one-tail)
% -1: g2 < g1 (one-tail)
% ----------------------------------------------------------------------------------------------------------------
% [ OUTPUTS ]
% s, t, p
% ----------------------------------------------------------------------------------------------------------------
% Last update: Aug 30, 2016.
%
% Copyright 2016. Kwangsun Yoo (K Yoo), PhD
% E-mail: rayksyoo@gmail.com / raybeam@kaist.ac.kr
% Laboratory for Cognitive Neuroscience and NeuroImaging (CNI)
% Department of Bio and Brain Engineering
% Korea Advanced Instititue of Science and Technology (KAIST)
% Daejeon, Republic of Korea
% ================================================================================================================
if hypotest == 0
[t, p] = dbs_pairT_matrix (setmat(:,:,label==0) , setmat(:,:,label==1), direction); s = t;
elseif hypotest == 1
[t, p] = dbs_unpairT_matrix (setmat(:,:,label==0) , setmat(:,:,label==1), direction); s = t;
elseif hypotest == 2
[s, t, p] = dbs_corr_matrix (setmat, label, direction);
end