-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathstats_coh_ttest_v2.m
59 lines (38 loc) · 1.67 KB
/
stats_coh_ttest_v2.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
clear all
clc
close all
addpath /autofs/cluster/transcend/fahimeh/fm_functions/Mines/
sim_dir='/autofs/cluster/transcend/fahimeh/fmm/resources/Simulations/';
%POOL=parpool('local',20);
%NoiseLevelr=[1 .065];
NoiseLevelr=[0.4 1];
X{1} =[7 1.5;8 1.5];
X{2} =[0 0;0 0];
nsubj=8;
%NoiseLevelr_cond1=0.;
icond=1;
jitter_noise=X{icond};
fcond1=[sim_dir 'coherence/data_subj_coherence_occipital_frontal_cond' num2str(icond) '_noiserest' num2str(NoiseLevelr(icond)) '_nsubj' ...
num2str(nsubj) '_' num2str(jitter_noise(1,1)) num2str(jitter_noise(1,2)) num2str(jitter_noise(2,1)) num2str(jitter_noise(2,2)) '.mat'];
cond1=load(fcond1);
icond=2;
jitter_noise=X{icond};
fcond2=[sim_dir 'coherence/data_subj_coherence_occipital_frontal_cond' num2str(icond) '_noiserest' num2str(NoiseLevelr(icond)) '_nsubj' ...
num2str(nsubj) '_' num2str(jitter_noise(1,1)) num2str(jitter_noise(1,2)) num2str(jitter_noise(2,1)) num2str(jitter_noise(2,2)) '.mat'];
cond2=load(fcond2);
time=cond1.time;
freq=cond1.freq;
occipital=cond1.occipital;
frontal=cond1.frontal;
tag='71.581.5_0000';
for iLabel1=1:length(occipital)
for iLabel2=1:length(frontal)
[iLabel1 iLabel2]
G1=squeeze(cond1.data_subj(:,iLabel1,iLabel2,:,:));
G2=squeeze(cond2.data_subj(:,iLabel1,iLabel2,:,:));
[h,p,ci,stats]=ttest(G1,G2);
save([sim_dir 'coherence/stats/stats_ttest_coh_' occipital{iLabel1} '_' frontal{iLabel2} '_noiserest' num2str(NoiseLevelr(1)) '_' num2str(NoiseLevelr(2)) ...
'_nsubj' num2str(nsubj) '_' tag '.mat'],'p','stats','time','freq','occipital','frontal','X','NoiseLevelr');
end
end
%delete(POOL);