-
Notifications
You must be signed in to change notification settings - Fork 0
/
r_LOCVoiSizePSCPerSession.m
126 lines (67 loc) · 2.2 KB
/
r_LOCVoiSizePSCPerSession.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
%%% ======= BRAIN VOYAGER SCRIPT ======= %%%
%%% ======= BrainTrain Analysis ======== %%%
%%% ==================================== %%%
% Add folders to path
addpath('utils');
addpath('data');
addpath('functions');
%% ------------------------------------
% Load data
load('nfasd_roiglm_results.mat');
load('ROIsize.mat');
load('psc.mat');
%% ------------------------------------
% Settings Structure
configs = struct();
rData = struct();
configs.numPats = 15;
configs.numSessions = 5;
configs.numRuns = 5;
configs.patsIdxs = {'01','02','03','04','05','06','07','08','09','10','11','12','13','14','15'};
configs.SessIdxs = {'_S1','_S2','_S3','_S4','_S5'};
configs.colorsPerSess = copper(configs.numSessions);
%% ------------------------------------
% Data re-org
for s = 1:length(configs.SessIdxs)
sessIdx = configs.SessIdxs{s};
% Get rows for the sessIdx
r_rows = find(contains(sessionPerPatient, sessIdx ) );
% re-organize data per session
r_ROIsizePerSession (:,s) = ROIsizePerSession (r_rows, : );
end
%% ------------------------------------
% Data PSC re-org
for s = 1:length(configs.SessIdxs)
sessIdx = configs.SessIdxs{s};
% Get rows for the sessIdx
r_rows = find(contains(sessionPerPatient, sessIdx ) );
% re-organize data per session
r_PSCPerSession (:,s) = psc (r_rows, 1 );
end
%% ------------------------------------
r_boxPlot(r_ROIsizePerSession)
% Stat analysis
[p, tbl, stats ] = anova1(r_ROIsizePerSession);
fprintf('ANOVA, ROI size per Session - %.3f.\n', p);
%%
% Repeated measures ANOVA
[anovatblROIperSession] = reapMeasAnovaPerSession(r_ROIsizePerSession)
%% -------------------------------------
% PSC localizer persession
r_boxPlot(r_PSCPerSession)
% Stat analysis
[p, tbl, stats ] = anova1(r_PSCPerSession);
fprintf('ANOVA, PSC LOC per Session - %.3f.\n', p);
lm = fitlm( 1:5,mean(r_PSCPerSession),'linear')
figure,
lm.plot
%%
% Repeated measures ANOVA
[anovatblPSCLocPerSess] = reapMeasAnovaPerSession(r_PSCPerSession);
%%
t_PSC = mean(r_PSCPerSession);
sessionIdx = 1:5;
tbl = table(sessionIdx',t_PSC');
mdl = fitlm(tbl);
fprintf(' p-val of linear regression is %f.\n', mdl.coefTest)
plot(mdl);