regresfast: Fast linear regressions

Description Usage Arguments Value Author(s) Examples

View source: R/RcppExports.R

Description

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.

Usage

1
regresfast(X, y, covariates, hascovar = FALSE)

Arguments

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.

Value

List with:

Author(s)

Dorian Pustina

Examples

1
2
3
4
5
6
7
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
test$kxmat # 2

neuroconductor/LESYMAP documentation built on May 28, 2020, 7:27 p.m.