my name is Laura and I am working as a PostDoc in Markus Ploner´s lab in Munich. Currently, we are analyzing the relationships between painful stimuli of different intensity, brain activity and electrodermal activity by means of mediation analysis. For this analysis, we need to extract single-trial beta estimates of our SCRs to enter them into the mediation model.
So far, we computed a GLM with one regressor per trial (n = 60), using the SCRF with time derivative (SCRF1 in PsPM), as explained in your publication in Biological Psychology (2013). If we assume correctly, the glm.stats output gives us two single-trial beta weights (one for the canonical response (bf1) and one for the time derivative (bf2)), as well as a constant term. However, we are not quite sure how to combine both estimates - can you help us out and tell us how to reconstruct the single-trial beta estimates adjusted for the time derivative from the glm.stats output?
Thank you a lot in advance for considering,
kind regards,
Laura
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
please apologise my late reply; I've been on holidays.
You're right about the meaning of the numbers in glm.stats. The most convenient way of combining them is to use the contrast manager with "reconstructed" as data type. As contrast, you can then define the intercept for single conditions, i.e. a "1" for the trial of interest and a "0" for all other trials. See chapter 12.14 and 12.15 in the Manual.
Hope this helps
Dominik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I created a batch now where I build contrasts with "reconstructed" as datatype. I added 60 contrast vectors (one for every trial), with a "1" for the trial of interest, and "0" for the remaining 59 trials.
However, when I try to run the batch, I get following error message:
Running job #1
Running 'First-Level Contrasts'
Loading data ...
Writing contrasts to /mypath/PsPM/Results/GLM_SingleTrialEstimates_SingleSubjects/GLM_SingleTrialEstimates_vp03.mat
Failed 'First-Level Contrasts'
Undefined function 'mtimes' for input arguments of type 'cell'.
In file "/mypath/PsPM3.1/scr_con1.m" (v701), function "scr_con1" at line 140.
In file "/mypath/PsPM3.1/scr_cfg/scr_cfg_run_contrast1.m" (v124), function "scr_cfg_run_contrast1" at line 26.
The following modules did not run:
Failed: First-Level Contrasts
If the problem can be fixed without modifying the job, the computation can be resumed by running
cfg_util('cont',1)
from the MATLAB command line.
I don´t have any idea what I am doing wrong - but maybe it is very obvious for you? I attached the file I am trying to load to this message.
Thanks a lot in advance for your input,
kind regards,
Laura
you discovered a bug - thank you very much! Apparently not many people have been using the contrast functions with reconstructed responses.
I attach a bugfix for PsPM 3.1.1 that should replace the respective function in your PsPM installation. Let me know if you need this for any other version, or if it doesn't work for you. It will be included in the next revision as well.
you are very welcome =). And thank you a lot for the fix - it worked for us and the script ran without any errors. Now we see an additional field ("glm.con") in our output, which should contain the reconstructed responses.
However, I should let you know that I can let the batch run only once every time - if I try it again with the same data files as input, they are not just overwritten, but the old error message appears again. So something is still not working 100% properly...
Thanks again,
kind regards,
Laura
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just tried to reproduce the error you described. After reproducing the prior bug I had to remove the field 'recon' in the glm struct of the model file, to create the reconstructed responses without any error. After that I was unable to reproduce the latter problem. Could it be that a malformed recon field in the glm struct may cause the error you described above? If so I would recommend to iterate through all the model files, remove the field 'recon' and then re-run the response reconstruction. If not, could you export the buggy batch (as mat or script) for me so I can try it on my workstation?
best
Tobias
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dear Dominik,
my name is Laura and I am working as a PostDoc in Markus Ploner´s lab in Munich. Currently, we are analyzing the relationships between painful stimuli of different intensity, brain activity and electrodermal activity by means of mediation analysis. For this analysis, we need to extract single-trial beta estimates of our SCRs to enter them into the mediation model.
So far, we computed a GLM with one regressor per trial (n = 60), using the SCRF with time derivative (SCRF1 in PsPM), as explained in your publication in Biological Psychology (2013). If we assume correctly, the glm.stats output gives us two single-trial beta weights (one for the canonical response (bf1) and one for the time derivative (bf2)), as well as a constant term. However, we are not quite sure how to combine both estimates - can you help us out and tell us how to reconstruct the single-trial beta estimates adjusted for the time derivative from the glm.stats output?
Thank you a lot in advance for considering,
kind regards,
Laura
Hi Laura
please apologise my late reply; I've been on holidays.
You're right about the meaning of the numbers in glm.stats. The most convenient way of combining them is to use the contrast manager with "reconstructed" as data type. As contrast, you can then define the intercept for single conditions, i.e. a "1" for the trial of interest and a "0" for all other trials. See chapter 12.14 and 12.15 in the Manual.
Hope this helps
Dominik
Dear Dominik,
thank you for your helpful reply!
I created a batch now where I build contrasts with "reconstructed" as datatype. I added 60 contrast vectors (one for every trial), with a "1" for the trial of interest, and "0" for the remaining 59 trials.
However, when I try to run the batch, I get following error message:
Running job #1
Running 'First-Level Contrasts'
Loading data ...
Writing contrasts to /mypath/PsPM/Results/GLM_SingleTrialEstimates_SingleSubjects/GLM_SingleTrialEstimates_vp03.mat
Failed 'First-Level Contrasts'
Undefined function 'mtimes' for input arguments of type 'cell'.
In file "/mypath/PsPM3.1/scr_con1.m" (v701), function "scr_con1" at line 140.
In file "/mypath/PsPM3.1/scr_cfg/scr_cfg_run_contrast1.m" (v124), function "scr_cfg_run_contrast1" at line 26.
The following modules did not run:
Failed: First-Level Contrasts
If the problem can be fixed without modifying the job, the computation can be resumed by running
cfg_util('cont',1)
from the MATLAB command line.
I don´t have any idea what I am doing wrong - but maybe it is very obvious for you? I attached the file I am trying to load to this message.
Thanks a lot in advance for your input,
kind regards,
Laura
Hi Laura
you discovered a bug - thank you very much! Apparently not many people have been using the contrast functions with reconstructed responses.
I attach a bugfix for PsPM 3.1.1 that should replace the respective function in your PsPM installation. Let me know if you need this for any other version, or if it doesn't work for you. It will be included in the next revision as well.
Dominik
Dear Dominik,
you are very welcome =). And thank you a lot for the fix - it worked for us and the script ran without any errors. Now we see an additional field ("glm.con") in our output, which should contain the reconstructed responses.
However, I should let you know that I can let the batch run only once every time - if I try it again with the same data files as input, they are not just overwritten, but the old error message appears again. So something is still not working 100% properly...
Thanks again,
kind regards,
Laura
Thanks for the feedback - long delay due to summer period. We are working on this issue now!
Dominik
Hi Laura
I just tried to reproduce the error you described. After reproducing the prior bug I had to remove the field 'recon' in the glm struct of the model file, to create the reconstructed responses without any error. After that I was unable to reproduce the latter problem. Could it be that a malformed recon field in the glm struct may cause the error you described above? If so I would recommend to iterate through all the model files, remove the field 'recon' and then re-run the response reconstruction. If not, could you export the buggy batch (as mat or script) for me so I can try it on my workstation?
best
Tobias