Commit 4e5d3052 authored by Meryem Ayse Yucel's avatar Meryem Ayse Yucel
Browse files

Update hmrR_GLM.m

Calculates and outputs contrast t/p only when nCond>1
parent 02c6def0
Loading
Loading
Loading
Loading
+14 −12
Original line number Diff line number Diff line
@@ -657,6 +657,7 @@ for iBlk=1:length(data_y)
                        %
                        
                        % GLM stats for contrast between conditions, given a c_vector exists
                        if nCond > 1
                            if (sum(abs(c_vector)) ~= 0) && (size(c_vector,2) == nCond)
                                
                                if ~exist('cv_extended') == 1
@@ -670,6 +671,7 @@ for iBlk=1:length(data_y)
                                tval_contrast(:,lstML(iCh),conc) = cv_extended * foo(:,lstML(iCh),conc)./sqrt(cv_extended * (pinvA*pinvA') * yvar(:,lstML(iCh),conc) * cv_extended');
                                pval_contrast(:,lstML(iCh),conc) = 1-tcdf(abs(tval_contrast(:,lstML(iCh),conc)),(size(y,1)-1));
                            end
                        end
                        %
                        
                        
@@ -790,7 +792,7 @@ for iBlk=1:length(data_y)
        hmrstats.pval = pval;
        hmrstats.ml = ml;
        % GLM stats for contrast between conditions, if c_vector exists
        if (sum(abs(c_vector)) ~= 0) && (size(c_vector,2) == nCond)
        if (sum(abs(c_vector)) ~= 0) && (size(c_vector,2) == nCond) && nCond>1
            hmrstats.tval_contrast = tval_contrast;
            hmrstats.pval_contrast = pval_contrast;
            hmrstats.contrast = c_vector;