Commit 47525d52 authored by Julius Welzel's avatar Julius Welzel

corrected z-scoring.m

parent 94fa3f3d
......@@ -36,7 +36,7 @@ old = (SUBJ>=80);
young = (SUBJ<80);
%% Zscore data over all participants only for MI trials
z_top = zscore(nanmean(m_rERD_trial,3),[],1);
z_top = zscore(nanmean(m_rERD_trial(:,:,MI_trials),3),[],2);
top_old = mean(z_top(old,:));
top_young = mean(z_top(young,:));
......@@ -133,7 +133,7 @@ scatter([surf_young{:}],x_values,2,c_young)
legend([p1 p2],{'OLD','YOUNG'})
title ({'Surface Area of highest 50% ERD','All trials each group'})
% save_fig(gcf,PATHOUT_TOPODIFF,'surf_area_ERD_st','fontsize',15,'figsize',[0 0 35 25]);
save_fig(gcf,PATHOUT_TOPODIFF,'surf_area_ERD_st','fontsize',15,'figsize',[0 0 35 25]);
%% only 3D topoplots over both groups with topoplot
......@@ -222,18 +222,27 @@ for g = 1:length(gd)
end
%}
maps_st = zscore(nanmean(m_rERD_trial,3),[],1);
maps_st = zscore(nanmean(m_rERD_trial(:,:,MI_trials),3),[],2);
for s = 1:length(SUBJ)
if SUBJ(s)<50;c_map = c_y_map;else;c_map = c_o_map;end;
area_z_t_avg(s,:) = inter_area(cfg.chanlocs,maps_st(s,:),24,SUBJ(s),PATHOUT_TOPODIFF,c_map);
area_z_t_avg(s,:) = inter_area(cfg.chanlocs,maps_st(s,:),48,SUBJ(s),PATHOUT_TOPODIFF,c_map);
end
[m_a_old se_a_old] = mean_SEM(area_z_t_avg(old,:)');
[m_a_young se_a_young] = mean_SEM(area_z_t_avg(young,:)');
AO = shadedErrorBar(1:24,m_a_old,se_a_old,'lineprops',{'-','Color',c_old,'LineWidth',2})
shadedErrorBar(1:size(area_z_t_avg,2),m_a_old,se_a_old,'lineprops',{'-','Color',c_old,'LineWidth',2})
hold on
AY = shadedErrorBar(1:24,m_a_young,se_a_young,'lineprops',{'-','Color',c_young,'LineWidth',2})
AO = plot(1:size(area_z_t_avg,2),m_a_old,'-','Color',c_old,'LineWidth',2)
hold on
shadedErrorBar(1:size(area_z_t_avg,2),m_a_young,se_a_young,'lineprops',{'-','Color',c_young,'LineWidth',2})
hold on
AY = plot(1:size(area_z_t_avg,2),m_a_young,'-','Color',c_young,'LineWidth',2)
xlabel 'Z-Score map [Z]'
ylabel 'Area [u]'
xticks([1 size(area_z_t_avg,2)/2 size(area_z_t_avg,2)])
xticklabels({'max Z','0','min Z'})
legend ([AO,AY],{'Old','Young'})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment