Regions of interest#
Specifying regions of interest (ROIs) restricts statistical inferences to sub-regions of the domain. The test statistic is still computed at all domain points, but inferences pertain only to the specified region(s). In spm1d ROIs are supported for all univariate and multivariate procedures and for all inference methods.
ROIs must be defined in an a priori manner. It is invalid to measure data, look at the data and then choose an ROI based on what you see. ROIs should instead be specified based on some a priori rationale such as previously published results or pilot results.
ROI analysis can be conducted in spm1d using the inference method’s roi keyword argument as follows:
Q = y0.shape[1] # Q: number of domain points
roi = np.arange( Q ) >= 0.7 * Q # (Q,) boolean array that is True over the final 30% of the domain
ti = spm1d.stats.ttest_paired( y1, y0 ).inference( 0.05, roi=roi )
Note that not specifying an ROI is equivalent to specifying an ROI that spans the whole domain. Thus ti0 and ti1 are equivalent in the example below.
roi = np.full( Q, True ) # (Q,) boolean array spanning the entire domain
ti0 = spm1d.stats.ttest_paired( y1, y0 ).inference( 0.05 )
ti1 = spm1d.stats.ttest_paired( y1, y0 ).inference( 0.05, roi=roi )
print( ti0 == ti1 ) # yields True
How ROIs affect results#
The critical threshold decreases. When the ROI is smaller than the whole domain it contains fewer resels. Under the null hypothesis the test statistic maximum \(z_\max\) within the region is then lower and so is the critical threshold \(z_c\). This has various effects on the inference methods’ results. In general \(z_c\) and p-values decrease for smaller ROIs.
Nothing outside the ROI is tested. The test statistic is masked outside the region. No clusters are formed there and the point-level p-values are undefined there. Any effects outside the ROI must be disregarded and not reported.
Using ROIs honestly#
An ROI embodies a hypothesis and must therefore be chosen before data are examined. Choosing an ROI after looking at effect sizes or test statistics represents an invalid, ad hoc use of ROIs.
When several disjoint regions are combined into a single boolean ROI array, the combination of regions is treated as a single search region whose resel count is the sum of the regions’ resel counts. SPM’s use of smoothness estimates for this disjoint ROI case has been numerically validated elsewhere.