-
Notifications
You must be signed in to change notification settings - Fork 19
Hi Benedikt,
We are using the unfolding toolbox to extract betas in a fully between-subject experimental design. We are interested in two types of events per subject (blinks and steps). The design matrix for unfolding consist of the following:
cfg = [];
cfg.timelimits = [-0.5, 2];
cfg.eventtypes = { 'blink', 'step' };
cfg.formula = {'y ~ 1', 'y ~ 1' };
We unfolded the data with the following lines:
EEG_uf = uf_designmat(EEG,cfg); % create design matrix
EEG_uf = uf_timeexpandDesignmat(EEG_uf,cfg); % time-expand design matrix
% threshold value
winrej= [];
winrej = uf_continuousArtifactDetect(EEG_uf,'amplitudeThreshold',80);
EEG_uf = uf_continuousArtifactExclude(EEG_uf,struct('winrej',winrej));
EEG_uf = uf_glmfit(EEG_uf,cfg);
ufresult = uf_condense(EEG_uf);
We expect two intercepts, one for each event. This is what we got but the plot for blinks seems to have spikes instead of a ERP wave, and the one for steps is flat (see attached image).
The plot seems to have taken values from the betas (65 channels625 time step2 events) in ufresult, which was a series of zeros with only four columns that had actual values.
We wanted to ask if the design matrix that we had was correct and what would have caused the betas to be spikes?
Thanks and have a good day!
All reactions
Replies: 6 comments 3 replies
Hey!
indeed this is very strange. Can you do:
- plot a single channel manually (e.g.
plot(ufresult.beta(65,:,:)) - If this doesnt look "good", can you plot
uf_plotDesignmatrix
I could think that this is a bug in plotting similar to #93 ; which is an upstream bug in ggram, which is not fixed.
Cheers, Bene
All reactions
Thanks for the comment Bene.
Actually we tried your suggestions and we got the below image:
unfold_newplot
Also we ploted the designMatrix and it seems to look ok:
designmatrix_plot
We think its not a ploting issue. It looks like the unfolding gives mostly zero values (see attached).
beta_results
All reactions
- did you plot the same channel, because that channel is negative, in the uf_plotParam it is positive.
- can you plot the designmatrix after timeexpansion:
uf_plotDesignmat(EEG1,'timeexpand',1)
3)can you plot a single channel of the continuous signalplot(EEG.data(65,:))?
What does the last plot show?
All reactions
Hi Bene, again thanks a lot for you time :)
-
It was a different channel that's why it was negative. This channel with the uf_plotParam is negative as well.
-
The design matrix after timeexpansion plot is below"
designmatrix_plot_timeexpand -
We also plotted channel 65 of the EEG continuous signal:
eegdata_chan65
This plot shows a continuous signal. So we don't understand why after unfolding it doesn't look continuous anymore.
Looking forward to your comments.
Cheers,
Enru and Armand
All reactions
Tricky!
1)Can you leave out the if amplitude cleaning thingy?
2) it is strange that the xdc plot doesn't show any values, there should be staircase like patterns. Could you look into the EEG.unfold.xdc matrix and check that there are lots of 1's in there?
All reactions
Hi Bene,
What do you mean by the amplitude cleaning thingy?
For the xdc matrix, we retrieved a 1000*1000 matrix because it exceeds the Matlab space, and it seems to be all zeros (image below)
Do you think the issue is with the design matrix or the data that we feed into the unfolding toolbox?
If you would like to take a look, we can send you the scripts and a dataset.
Thanks :)
All reactions
I meant this bit
winrej= [];
winrej = uf_continuousArtifactDetect(EEG_uf,'amplitudeThreshold',80);
EEG_uf = uf_continuousArtifactExclude(EEG_uf,struct('winrej',winrej));
If you can send me an EEG including the unfold-struct, I can debug it easier :)
All reactions
Hi Bene,
So the good news is that the threshold amplitude was the cause. We run the unfold first without rejection and seems to work (figure below).
But it looks a bit noisy so we tried again with various thresholds and up to 250 was removing a lot of data. Then, we tried a amplitude threshold of 1000 (arbitrary) and the data looks cleaner.
Do you see a problem of using such high amplitude threshold or do you have any suggestions of which threshold to use? Would you still want me to send you a dataset?
Many thanks again for the great help.
Cheers,
Enru and Armand
All reactions
-
🎉 1
what amplitude threshold to use is very study specific (also e.g. do you want to keep/remove blinks, what's your filter settings etc.). So I cannot give any advice except to think of what the artefacts are, that you want to remove by the thresholding procedure.