Skip to content

Commit

Permalink
changed indexedByEpochs
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanHaufe committed Nov 2, 2012
1 parent 3af3f5f commit f75e4fe
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 18 deletions.
4 changes: 2 additions & 2 deletions demos/demo_analysis_ga_ERPs.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@
% three different but almost equivalent ways to make statistics about class differences
epos_diff{isub} = proc_classmeanDiff(epo, 'Stats', 1);
epos_r{isub} = proc_rSquareSigned(epo, 'Stats', 1);
% epos_auc{isub} = proc_aucValues(epo, 'Stats', 1);
epos_auc{isub} = proc_aucValues(epo, 'Stats', 1);

end

% grand average
epo_av = proc_grandAverage(epos_av, 'Average', 'INVVARweighted', 'Stats', 1, 'Bonferroni', 1, 'Alphalevel', 0.01);
epo_r = proc_grandAverage(epos_r, 'Average', 'INVVARweighted', 'Stats', 1, 'Bonferroni', 1, 'Alphalevel', 0.01);
epo_diff = proc_grandAverage(epos_diff, 'Average', 'INVVARweighted', 'Stats', 1, 'Bonferroni', 1, 'Alphalevel', 0.01);
% epo_auc = proc_grandAverage(epos_auc, 'Average', 'INVVARweighted', 'Stats', 1, 'Bonferroni', 1, 'Alphalevel', 0.01);
epo_auc = proc_grandAverage(epos_auc, 'Average', 'INVVARweighted', 'Stats', 1, 'Bonferroni', 1, 'Alphalevel', 0.01);

mnt = mnt_setElectrodePositions(epo_av.clab);
mnt= mnt_setGrid(mnt, grd);
Expand Down
30 changes: 15 additions & 15 deletions demos/demo_convert_CenterSpellerMVEP_datasets.m
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
files = {
{'VPibq_10_09_24', 'calibration_CenterSpellerMVEP_VPibq'}
{'VPiac_10_10_13', 'calibration_CenterSpellerMVEP_VPiac'}
{'VPibs_10_10_20', 'calibration_CenterSpellerMVEP_VPibs'}
{'VPibt_10_10_21', 'calibration_CenterSpellerMVEP_VPibt'}
{'VPfat_10_10_27', 'calibration_CenterSpellerMVEP_VPfat'}
{'VPibu_10_10_28', 'calibration_CenterSpellerMVEP_VPibu'}
{'VPibv_10_11_02', 'calibration_CenterSpellerMVEP_VPibv'}
{'VPibw_10_11_04', 'calibration_CenterSpellerMVEP_VPibw'}
{'VPibx_10_11_10', 'calibration_CenterSpellerMVEP_VPibx'}
{'VPiby_10_11_12', 'calibration_CenterSpellerMVEP_VPiby'}
{'VPice_10_12_17', 'calibration_CenterSpellerMVEP_VPice'}
{'VPgdf_11_06_09', 'calibration_CenterSpellerMVEP_VPgdf'}
{'VPicv_11_06_10', 'calibration_CenterSpellerMVEP_VPicv'}
{'VPgdg_11_06_22', 'calibration_CenterSpellerMVEP_VPgdg'}
{'VPibe_11_06_16', 'calibration_CenterSpellerMVEP_VPibe'}
{'VPiba_11_06_23', 'calibration_CenterSpellerMVEP_VPiba'}
% {'VPiac_10_10_13', 'calibration_CenterSpellerMVEP_VPiac'}
% {'VPibs_10_10_20', 'calibration_CenterSpellerMVEP_VPibs'}
% {'VPibt_10_10_21', 'calibration_CenterSpellerMVEP_VPibt'}
% {'VPfat_10_10_27', 'calibration_CenterSpellerMVEP_VPfat'}
% {'VPibu_10_10_28', 'calibration_CenterSpellerMVEP_VPibu'}
% {'VPibv_10_11_02', 'calibration_CenterSpellerMVEP_VPibv'}
% {'VPibw_10_11_04', 'calibration_CenterSpellerMVEP_VPibw'}
% {'VPibx_10_11_10', 'calibration_CenterSpellerMVEP_VPibx'}
% {'VPiby_10_11_12', 'calibration_CenterSpellerMVEP_VPiby'}
% {'VPice_10_12_17', 'calibration_CenterSpellerMVEP_VPice'}
% {'VPgdf_11_06_09', 'calibration_CenterSpellerMVEP_VPgdf'}
% {'VPicv_11_06_10', 'calibration_CenterSpellerMVEP_VPicv'}
% {'VPgdg_11_06_22', 'calibration_CenterSpellerMVEP_VPgdg'}
% {'VPibe_11_06_16', 'calibration_CenterSpellerMVEP_VPibe'}
% {'VPiba_11_06_23', 'calibration_CenterSpellerMVEP_VPiba'}
};

Fs = 100; % new sampling rate
Expand Down
7 changes: 6 additions & 1 deletion fileio/file_loadMatlab.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,18 @@
%% Check for absolute paths:
%% For Unix systems, absolute paths start with '\'.
%% For Windoze, identify absolute paths by the ':' (e.g., H:\some\path).
fullname= [opt.Path filesep file];

if (isunix && (file(1)==filesep)) || (ispc && (file(2)==':')),
if ~isdefault.Path,
warning('opt.Path is ignored, since file is given with absolute path');
end
opt.Path= '';
fullname = file;
end
fullname= [opt.Path filesep file];


% keyboard

if ismember('*', file),
[filepath, filename]= fileparts(fullname);
Expand Down
3 changes: 3 additions & 0 deletions processing/proc_aucValues.m
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
fv_aucval.x= reshape(fv_aucval.x, sz(1:end-1));
fv_aucval.x = (fv_aucval.x-0.5)*2;
if opt.Stats
fv_aucval.indexedByEpochs = {'p', 'sgnlogp', 'se'};
fv_aucval.se = 2*repmat(sqrt((0.25 + (sum(sum(fv.y'))-2)*(1/12))./prod(sum(fv.y'))), sz(1:end-1));
fv_aucval.p = reshape(fv_aucval.p, sz(1:end-1));
fv_aucval.sgnlogp = reshape(fv_aucval.sgnlogp, sz(1:end-1));
Expand All @@ -107,6 +108,7 @@
if ~isempty(opt.Alphalevel)
fv_aucval.alphalevel = opt.Alphalevel;
fv_aucval.sigmask = fv_aucval.p < opt.Alphalevel;
fv_aucval.indexedByEpochs = {fv_aucval.indexedByEpochs{:}, 'sigmask'};
end
end

Expand All @@ -115,3 +117,4 @@
end
fv_aucval.y= 1;
fv_aucval.yUnit= 'auc';
fv_aucval.indexedByEpochs = {};
4 changes: 4 additions & 0 deletions processing/proc_average.m
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
end

if opt.Stats,
out.indexedByEpochs = {'p', 'sgnlogp', 'se'};
out.se = reshape(out.se, [sz(1:end-1) nClasses]);
out.p = reshape(out.p, [sz(1:end-1) nClasses]);
if opt.Bonferroni
Expand All @@ -170,6 +171,9 @@
if ~isempty(opt.Alphalevel)
out.alphalevel = opt.Alphalevel;
out.sigmask = out.p < opt.Alphalevel;
out.indexedByEpochs = {out.indexedByEpochs{:}, 'sigmask'};
end
end

out.indexedByEpochs = {};

3 changes: 3 additions & 0 deletions processing/proc_classmeanDiff.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@

fv_diff.x = reshape(mean(fv.x(:,c1),2)-mean(fv.x(:,c2),2), sz(1:end-1));
if opt.Stats
fv_diff.indexedByEpochs = {'p', 'sgnlogp', 'se'};
[h, p, ci, stats] = ttest2(fv.x(:,c1)', fv.x(:,c2)', [], [], 'equal');
fv_diff.se = reshape(sqrt(stats.sd.^2/N1 + stats.sd.^2/N2), sz(1:end-1));
fv_diff.p = reshape(p, sz(1:end-1));
Expand All @@ -115,8 +116,10 @@
if ~isempty(opt.Alphalevel)
fv_diff.alphalevel = opt.Alphalevel;
fv_diff.sigmask = fv_diff.p < opt.Alphalevel;
fv_diff.indexedByEpochs = {fv_diff.indexedByEpochs{:}, 'sigmask'};
end
end

fv_diff.y= 1;
fv_diff.className= {sprintf('%s - %s', fv.className{1:2})};
fv_diff.indexedByEpochs = {};
4 changes: 4 additions & 0 deletions processing/proc_rValues.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
fv_rval.x= rval;

if opt.Stats
fv_rval.indexedByEpochs = {'p', 'sgnlogp', 'se'};
iV= reshape(iV, [sz(1:end-1) 1]);
fv_rval.se = 1./sqrt(iV);
fv_rval.p = reshape(2*normal_cdf(-abs(atanh(fv_rval.x(:))), zeros(size(fv_rval.x(:))), fv_rval.se(:)), size(fv_rval.x));
Expand All @@ -133,6 +134,7 @@
if ~isempty(opt.Alphalevel)
fv_rval.alphalevel = opt.Alphalevel;
fv_rval.sigmask = fv_rval.p < opt.Alphalevel;
fv_rval.indexedByEpochs = {fv_rval.indexedByEpochs{:}, 'sigmask'};
end
end

Expand All @@ -141,3 +143,5 @@
end
fv_rval.y= 1;
fv_rval.yUnit= 'r';


0 comments on commit f75e4fe

Please sign in to comment.