regresfast.Rd
Takes a matrix of voxels and a vector of behavior and runs fast regressions for each voxel. Covariates can be defined (i.e. age) to find the effect of each voxel on behavior within the context of other predictive factors.
regresfast(X, y, covariates, hascovar = FALSE)
X | matrix of voxlels (columns) for all subjects (rows). |
---|---|
y | vector of behavioral scores. |
covariates | matrix with one or more columns. Must be of same length as behavior. This variable should always be set, and the next argument can tell if covariates should be used or not. |
hascovar | logical to tell whether covariates should be used. |
List with:
statistic
- regression t-score
n
- number of subjects
kxfm
- degrees of freedom.
set.seed(1234) lesmat = matrix(rbinom(40,1,0.2), ncol=2) set.seed(1234) behavior = rnorm(20) test = LESYMAP::regresfast(lesmat, behavior, as.matrix(behavior), hascovar=FALSE) test$statistic[,1] # 0.6915683 1.1434760#> [1] 0.6915683 1.1434760test$kxmat # 2#> [1] 2