Commit 709fe654 authored by Meryem Ayse Yucel's avatar Meryem Ayse Yucel
Browse files

GLM tval

Putting a check: if no tval calculated, skip generating hmrstats enteries.
parent e8e56ea9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -802,22 +802,28 @@ for iBlk=1:length(data_y)
 % stats struct
    if glmSolveMethod == 1 % for OLS
        % GLM stats for each condition
        if exist('tval')
        hmrstats.beta_label = beta_label;
        hmrstats.tval = tval;
        hmrstats.pval = pval;
        hmrstats.ml = ml;
        end
    else                   % for iWLS
        if exist('tstat')
        hmrstats.beta_label = beta_label;
        hmrstats.tval = tstat;
        hmrstats.pval = pval;
        hmrstats.ml = ml;
        end
    end
    
    % GLM stats for contrast between conditions, if c_vector exists
    if (sum(abs(c_vector)) ~= 0) && (size(c_vector,2) == nCond) && nCond>1
        if exist('tval_contrast')
        hmrstats.tval_contrast = tval_contrast;
        hmrstats.pval_contrast = pval_contrast;
        hmrstats.contrast = c_vector;
        end
    end
    
end
+18 −12
Original line number Diff line number Diff line
@@ -789,24 +789,30 @@ for iBlk=1:length(data_y)
    yR_blks{iBlk}   = yR;
    
   % stats struct
    if glmSolveMethod == 1 %  for OLS only for now
    if glmSolveMethod == 1 % for OLS
        % GLM stats for each condition
        if exist('tval')
        hmrstats.beta_label = beta_label;
        hmrstats.tval = tval;
        hmrstats.pval = pval;
        hmrstats.ml = ml;
        end
    else                   % for iWLS
        if exist('tstat')
        hmrstats.beta_label = beta_label;
        hmrstats.tval = tstat;
        hmrstats.pval = pval;
        hmrstats.ml = ml;
        end
    end
    
    % GLM stats for contrast between conditions, if c_vector exists
    if (sum(abs(c_vector)) ~= 0) && (size(c_vector,2) == nCond) && nCond>1
        if exist('tval_contrast')
        hmrstats.tval_contrast = tval_contrast;
        hmrstats.pval_contrast = pval_contrast;
        hmrstats.contrast = c_vector;
        end
    elseif glmSolveMethod == 2 %  for AR 
                % GLM stats for each condition 
        hmrstats.beta_label = beta_label;
        hmrstats.tval = tval;
        hmrstats.pval = pval;
        hmrstats.ml = ml;        
    end
    
end
 No newline at end of file
+7 −1
Original line number Diff line number Diff line
@@ -906,22 +906,28 @@ for iBlk=1:length(data_y)
   % stats struct
    if glmSolveMethod == 1 % for OLS
        % GLM stats for each condition
        if exist('tval')
        hmrstats.beta_label = beta_label;
        hmrstats.tval = tval;
        hmrstats.pval = pval;
        hmrstats.ml = ml;
        end
    else                   % for iWLS
        if exist('tstat')
        hmrstats.beta_label = beta_label;
        hmrstats.tval = tstat;
        hmrstats.pval = pval;
        hmrstats.ml = ml;
        end
    end
    
    % GLM stats for contrast between conditions, if c_vector exists
    if (sum(abs(c_vector)) ~= 0) && (size(c_vector,2) == nCond) && nCond>1
        if exist('tval_contrast')
        hmrstats.tval_contrast = tval_contrast;
        hmrstats.pval_contrast = pval_contrast;
        hmrstats.contrast = c_vector;
        end
    end
    
end