mur: Mass Univariate Regression.

View source: R/mur.R

murR Documentation

Mass Univariate Regression.

Description

Fit a linear regression model at each vertex of a 3D atlas. Inputs of the function are a NxC matrix X modeling an effect under study (N = number of subjects, C = number of variables + intercept term), a NxV imaging matrix Y containing the values of a 3D phenotype at each atlas vertex (V = number of vertices in the 3D mesh), and an array (extract) containg the positions of variables in X of which extract the informations of interest. The output is a Vx(3xlength(extract)) matrix containing the regression coefficient, its related t-statistic and the p-value at each vertex of the computational model for each variable specifiec in extract.

Usage

mur(X, Y, extract)

Arguments

X

is the design matrix. Number of rows = number of subjects in the study, number of columns = number of vertices in the atlas. Numerical varable must be normalized to 0-mean and unit-standard deviation. Categorical variables must be coded using dummy coding. The first column should contain the intercept (all 1s).

Y

is the imaging matrix. Number of rows = N. Number of columns = V.

extract

is an array expressing which covariates in X you want to extract.

Examples

extract <- c(1,3) #extract the first and third covariate.
result <- mur(X, Y, extract)
betas <- result[,1]
tstatistics <- result[,2]
pvalues <- result[,3]

UK-Digital-Heart-Project/mutools3D documentation built on April 7, 2024, 8:04 a.m.