Computes an SPM{t} field testing, at every node, the slope of a linear
regression of the waveform on a continuous predictor. The node-wise statistic
is the ordinary least-squares slope t-value (identical to
summary(lm(y ~ predictor)) at that node), and field-level significance
uses the same random-field-theory threshold as spmTTest() with
df = n - 2.
Value
A list of class "spm_result" (test_type = "regression")
with the t field, RFT threshold, significant clusters,
pointwise p_values, df, fwhm, resel_count, and
the fitted slope/intercept fields.
Examples
set.seed(1)
pred <- rnorm(20)
data <- matrix(rnorm(100 * 20), nrow = 100)
data[40:60, ] <- data[40:60, ] + outer(rep(1.5, 21), pred) # slope 30% window
spmRegression(data, pred)
#> SPM Analysis Result
#> ==================
#> Test type: regression
#> Time points: 100
#> Alpha: 0.050
#> Threshold: 4.374
#> FWHM (smoothness): 2.24
#> Resel count: 44.12
#>
#> Significant clusters: 4
#> Cluster 1: [40-40] extent=1, p=0.0114
#> Cluster 2: [42-44] extent=3, p=0.0000
#> Cluster 3: [46-57] extent=12, p=0.0000
#> Cluster 4: [59-60] extent=2, p=0.0001