Print

Print


Dear Freek
Yes, that all looks OK, and then you should write:

BMA=spm_dcm_peb_bmc(PEB(1));

If this isn’t working, you are welcome to send me a reproducible test case. This means that I should be able to run the code and reproduce the error. If that means sending large data files, please don’t CC the mailing list.

Best
Peter

From: Freek ten Doesschate <[log in to unmask]>
Sent: 04 February 2019 09:11
To: Zeidman, Peter <[log in to unmask]>
Cc: [log in to unmask]
Subject: Re: [SPM] Fwd: Between-subject effects in PEB model

Dear Peter,

I attached a zipped folder with my latest code.

I tried using curly brackets. however, the PEB file is a structure, therefore it doesn’t allow indexing with curly brackets. So I get this error message:


>> BMA=spm_dcm_peb_bmc(PEB{1});
Brace indexing is not supported for variables of this type.


Thanks for your help, again!

Best,
Freek

Op ma 28 jan. 2019 om 11:26 schreef Zeidman, Peter <[log in to unmask]<mailto:[log in to unmask]>>:
Dear Freek

Thank you, it seems to run fine now!

Great.

I added 2 covariates in the model (i.e., the mean and a between group difference) and I performed the analysis on 20 subjects. However, when I review the model it shows a window that says ‘1 covariates’ and ‘1 subjects’. Also, when I check the dropdown menu, I can only select “second-level effect - covariate 1”.

So are these the results from all 20 subjects? Or just of 1 of them? And is the between group difference also estimated? Why can’t I review its effects?

Something has gone wrong – which I suspect, given your previous question, is to do with your use of curly vs round brackets. You should see 20 subjects in the GUI and the drop-down menu should let you choose between the group mean and the group difference. Please could  you share your latest code and files, if you haven’t resolved this yet?

Best
Peter


Op ma 7 jan. 2019 om 12:39 schreef Zeidman, Peter <[log in to unmask]<mailto:[log in to unmask]>>:
Dear Freek
Further to my previous message, your problems occurred because you had the output of spm_dcm_peb the wrong way around. It should be:

[PEB,BMC]    = spm_dcm_peb(GCM,M,field);

The variables BMC and PEB were switched in your code.

Let me know if you have another questions.
Peter

From: Freek ten Doesschate <[log in to unmask]<mailto:[log in to unmask]>>
Sent: 03 January 2019 10:18
To: Zeidman, Peter <[log in to unmask]<mailto:[log in to unmask]>>
Cc: [log in to unmask]<mailto:[log in to unmask]>
Subject: Re: [SPM] Fwd: Between-subject effects in PEB model

Dear Peter,

Thanks for your response. I tried running the commands as you suggested and it runs fine untill step 8. Then I run into the same kind of error. Below I pasted the commands that I used and the errors that I encouter. I also attached the PEB model on which I try to run these commands.

I checked whether my SPM is up to date and this seems to be the case (version 7487).

Best,
Freek


When I run the 'BMA=spm_dcm_peb_bmc(PEB)’ command, I get:

>> BMA=spm_dcm_peb_bmc(PEB)
Error using spm_dcm_peb_bmc (line 102)
Please provide a single PEB model


So I also tried running it with only the first PEB model, like this:

>> BMA=spm_dcm_peb_bmc(PEB(1))
Dot indexing is not supported for variables of this type.

Error in spm_dcm_bmr_all (line 94)
if isstruct(DCM.M.pC), DCM.M.pC = diag(spm_vec(DCM.M.pC)); end

Error in spm_dcm_peb_bmc (line 111)
    [BMA,BMR,bma]  = spm_dcm_bmr_all(PEB);

Op wo 2 jan. 2019 om 12:37 schreef Zeidman, Peter <[log in to unmask]<mailto:[log in to unmask]>>:
Dear Freek


1. specify GLM for each subject

2. estimate GLM

3. specify a full DCM for each subject

4. estimate DCM

5. create a group DCM file (GCM)

6. run spm_dcm_fit on all models

7. run spm_dcm_bmr on the fitted models

8. run spm_dcm_peb on the reduced GCM file, including the design matrix with a mean regressor and the between group effect (1 for patients, 1 for healthy controls)

This mainly looks fine. Here are some minor corrections and clarifications:


1. specify GLM for each subject

2. estimate GLM

3. specify a full DCM for each subject

4. estimate DCM

5. create a group DCM file (GCM)

6. run spm_dcm_fit on all models

7. run spm_dcm_bmr on the fitted models (no need for this step)

87. run spm_dcm_peb on the reduced first column of the GCM file, which contains each subject’s full DCM. Include in the PEB design matrix a mean regressor and the between group effect (1 for patients, and minus 1 for healthy controls) which are then mean-centered, i.e.: X(:,2:end) = X(:,2:end) – mean(X(:,2:end));

8. run BMA=spm_dcm_peb_bmc(PEB) on the output of step 7.

9. Review the results using spm_dcm_peb_review(BMA);


Now the problem is, that I am not sure how to get to the between group difference in posterior probabilities from here.

See the extra step of launching the review window, above (the bar charts give you the effect sizes and probabilities).

I have tried a few things:


1.      review the PEB model from step 8. It gives an error saying: 'Please estimate this PEB model before reviewing’

That shouldn’t ever happen – it suggests that the input into the review function wasn’t a PEB model?


2.      run spm_dcm_peb_bmc on the output from step 8 ( BMA = spm_dcm_peb_bmc(PEB(1)) ). It gives an error saying: 'Dot indexing is not supported for variables of this type.’

The function is performing an automatic search over reduced models. It’s possible that all parameters were switched off during the search, which caused the error. To make sure there isn’t a more mundane explanation, please could you try updating to the latest SPM version and see if you still get this problem?


3.      not estimating the DCM in step 4. But then the bayesian model reduction gives an error.

Yes you did need to estimate them.


4.      in step 8, run spm_dcm_bmc_peb (instead of spm_dcm_peb) and then run spm_dcm_peb_bmc. This works fine when I got only the group mean as a regressor, however when I add the group difference as a regressor I get an error while running spm_dcm_bmc_peb. I attached the error in the ‘error_spm_dmc_bmc_peb.txt’ file and the script that I used in 'dcm_peb.m’.

This function does something different – it looks for the best mixture of first level models and second level covariates to explain the data. This doesn’t seem to be what you want at the moment.

Best
Peter