-
Notifications
You must be signed in to change notification settings - Fork 2
/
erfosc_corr_age.m
44 lines (34 loc) · 1020 Bytes
/
erfosc_corr_age.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
erf_osc_datainfo;
%% get power at maximum channel and peak frequency.
k=1;
for subj=allsubs
tmp{k} = load(sprintf('/project/3011085.02/results/freq/sub-%03d/sub-%03d_pow.mat', subj, subj));
k=k+1;
end
for k=1:32
peakFreq(k) = tmp{k}.peakFreq_gamma;
ratio_broadband(k) = tmp{k}.gamRatio; % mean power increase over channel and frequency
powRatio{k} = tmp{k}.powRatio;
end
for k=1:32
f(k) = find(powRatio{k}.freq==peakFreq(k));
ratio_maxchan(k) = max(powRatio{k}.powspctrm(:,f(k))); % power at max channel at peak frequency
end
ratio_maxchan_GA = mean(ratio_maxchan);
%% get reaction times
k=1;
for subj=allsubs
load(sprintf('/project/3011085.02/results/behavior/sub-%03d/sub-%03d_rt.mat', subj, subj));
RT{k} = rt;
clear rt;
k=k+1;
end
for k=1:32
rt(k,1)=mean(RT{k});
end
%% correlations with age.
load('/project/3011085.02/analysis/age.mat');
age(badsubjects)=[]; % get rid of the bad subject
[r pval] = corr(age, rt);
[r pval] = corr(age, ratio_maxchan');
[r pval] = corr(age, peakFreq');