-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathrasterstattest.m
32 lines (22 loc) · 969 Bytes
/
rasterstattest.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
function rastplotstat(rasters,fsigma,twind_one,twin_two)
%raster averaging, stat test on two regions and plot
convrasters=NaN(size(rasters,1),stop-start+1);
for rast=1:sum(~isnantrial{cnp})
convrasters(rast,:)=fullgauss_filtconv(rasters(rast,start-fsigma:stop+fsigma),fsigma,0);
end
% convrasters=convrasters(:,fsigma+1:end-fsigma);
% convrasters=convrasters(:,1000:1200);
% lowconvrasters=convrasters./10;
% closeconvrasters=convrasters./1.1;
%
% [t df pvals] = statcond({convrasters closeconvrasters}, 'method', 'perm', 'naccu', 2000); mean(pvals)
convrasters=nanmean(convrasters).*1000;
plot(convrasters,'k');
lowconvrasters=convrasters;
lowconvrasters(1000:1100)=lowconvrasters(1000:1100)./2;
closeconvrasters=convrasters;
closeconvrasters(1000:1010)=closeconvrasters(1000:1010)-0.01;
hold on
plot(lowconvrasters,'r');
plot(closeconvrasters,'b');
[t df pvals] = statcond({convrasters closeconvrasters}, 'method', 'perm', 'naccu', 2000); mean(pvals)