Dear Shrikanth
You are correct that the LOO tool requires at least two columns in the design matrix - it expects an intercept, followed by a between-subjects effect (e.g., group assignment or a continuous variable). It will assess the model's performance in predicting the between-subjects effect for left-out subjects.
Can you explain more about what you mean by wanting to check your effects are "stable across subjects"?
Best
Peter
-----Original Message-----
From: SPM (Statistical Parametric Mapping) <[log in to unmask]> On Behalf Of Shrikanth Kulashekhar
Sent: 17 August 2021 13:06
To: [log in to unmask]
Subject: [SPM] DCM leave one out cross validation design matrix issue
Dear SPM community,
I am using SPM version 7771 to perform a leave one out cross validation analysis. I want to test if the significant between-subjects effects I find are stable across subjects. I get an error related to the design matrix M.X, since I am only interested within the group, my M.X is a columns of ones which leads to an error.
The design matrix I tried is:
% Specify PEB model settings
M = struct();
M.alpha = 1;
M.beta = 16;
M.hE = 0;
M.hC = 1/16;
M.Q = 'single';
% Specify design matrix for N subjects
M.X = ones(N,1);
% Choose field
field = {'A','B'};
[qE,qC,Q] = spm_dcm_loo(GCM,M,field);
I get the following error:
Index in position 2 exceeds array bounds (must not exceed 1).
Error in spm_dcm_ppd (line 88)
bC = var(X(:,iX))*4;
Error in spm_dcm_loo (line 82)
[Ep,Cp,P] = spm_dcm_ppd(DCM(i),DCM(j,1),M.X(i,:),M.X(j,:),field);
Error in loo_PEB_5REG_subjects_peb (line 38) [qE,qC,Q] = spm_dcm_loo(GCM,M,field);
How can I proceed with this error? Kindly advice.
Thank you.
Shrikanth
|