PsPM
PsPM copied to clipboard
PsPM GLM for PS: exclude_missing settings
Summary
The feature of automatically excluding trials with missing data over a cut-off is not working as expected. After model inversion, the algorithm will do save data missing percentage of each trial in the output datafiles, but the information of whether any trial should be excluded is incorrect and exclusion of those trials with a missing percentage over the cut-off set in the model is not done automatically.
Example:
model = struct();
model.modelspec = {'ps_fc'};
model.modelfile = 'output datafile';
model.datafile = 'pupil size data with all trials of one participant';
model.norm = 0;
options = struct('overwrite', 1);
model.timeunits = 'markers';
model.timing = 'timing data, basically it contains timing.names{icondition} with trial names and timing.onsets{icondition} with condition names';
options.exclude_missing.segment_length = 10;
options.exclude_missing.cutoff = 0.5;
model.nuisance = nuisance_fn; % this is optional
mdl = pspm_glm(model, options);
This will produce an output datafile, containing a vector called "glm".
In this file, glm.stats_missing contains missing percentage of each trial with segment length of 10 s; glm.stats_exclude contains whether a trial should be excluded or not (data incorrect; always showed me 1 to exclude trials even though that missing data in that trial is not over 50%); glm.stats_exclude_names contains trials names of those should be excluded, same issue as glm.stats_exclude.
What we want to implement:
- correct the information in glm.stats_exclude and glm.stats_exclude_names
- fix the bug by making PsPM automatically exclude those trials should be excluded (for example, change glm.stats of these trials to be NaN)
- (not 100% sure) would it be a good idea to still save the original stats in glm? so users know the estimates of those excluded trials as well.
Technical Info
- PsPM version: 5.1.1
- MATLAB version: 2018b