Home > marsbar > @mardo_2 > compute_contrasts.m

compute_contrasts

PURPOSE ^

compute and return results of contrast statistics

SYNOPSIS ^

function [marsS] = compute_contrasts(marsDe, Ic)

DESCRIPTION ^

 compute and return results of contrast statistics
 FORMAT marsS = compute_contrasts(marsDe, Ic)
 
 marsDe     - design object
 Ic         - indices into contrast structure

 Output
 marsS      - statistic result structure

 For the 'con', 'stat' 'P' 'Pc' fields below, the results are matrices
 with one row per contrast, one column per ROI estimated

 The statistics results structure has fields
 'con'      - contrast value (numerator of t statistic, or ESS for F)
 'stat'     - t or F statistic value
 'P'        - uncorrected P value
 'Pc'       - P values corrected for number of ROIs
 'MVres'    - multivariate results structure with fields
              'y_pre'    - predicted temporal response
              'y_obs'    - observerd temporal response
              'Pf'       - probabability for last (rank of subspace)
                           eigenvalues  
              'u'        - principle components
              'ds'       - component weights (diag(S))
              'df'       - degrees of freedom for Pf              
 'columns'  - names of regions
 'rows'     - cell array of structs, one per contrast calculated,
              with fields:
              'name'  - contrast name
              'stat'  - statistic type (T|F)

 $Id$

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [marsS] = compute_contrasts(marsDe, Ic)
0002 % compute and return results of contrast statistics
0003 % FORMAT marsS = compute_contrasts(marsDe, Ic)
0004 %
0005 % marsDe     - design object
0006 % Ic         - indices into contrast structure
0007 %
0008 % Output
0009 % marsS      - statistic result structure
0010 %
0011 % For the 'con', 'stat' 'P' 'Pc' fields below, the results are matrices
0012 % with one row per contrast, one column per ROI estimated
0013 %
0014 % The statistics results structure has fields
0015 % 'con'      - contrast value (numerator of t statistic, or ESS for F)
0016 % 'stat'     - t or F statistic value
0017 % 'P'        - uncorrected P value
0018 % 'Pc'       - P values corrected for number of ROIs
0019 % 'MVres'    - multivariate results structure with fields
0020 %              'y_pre'    - predicted temporal response
0021 %              'y_obs'    - observerd temporal response
0022 %              'Pf'       - probabability for last (rank of subspace)
0023 %                           eigenvalues
0024 %              'u'        - principle components
0025 %              'ds'       - component weights (diag(S))
0026 %              'df'       - degrees of freedom for Pf
0027 % 'columns'  - names of regions
0028 % 'rows'     - cell array of structs, one per contrast calculated,
0029 %              with fields:
0030 %              'name'  - contrast name
0031 %              'stat'  - statistic type (T|F)
0032 %
0033 % $Id$
0034 
0035 SPM = des_struct(marsDe);
0036 xCon = SPM.xCon;
0037   
0038 if nargin < 2
0039   Ic = 1:length(xCon);
0040 end
0041 
0042 %- results
0043 [marsS.con marsS.stat, marsS.P, marsS.Pc] = ...
0044     pr_stat_compute(SPM, Ic);
0045 marsS.MVres = pr_stat_compute_mv(SPM, Ic);
0046 
0047 marsS.columns = region_name(SPM.marsY);
0048 for i = 1:length(Ic)
0049   marsS.rows{i}.name = xCon(Ic(i)).name;
0050   marsS.rows{i}.stat = xCon(Ic(i)).STAT;
0051 end
0052   

Generated on Wed 11-May-2022 16:26:09 by m2html © 2003-2019