ilr: Efficiently compute an image-based linear regression model...

View source: R/bigLMStats.R

ilrR Documentation

Efficiently compute an image-based linear regression model (ilr)

Description

This function simplifies calculating p-values from linear models in which there is a similar formula that is applied many times with a change in image-based predictors. Image-based variables are stored in the input matrix list. They should be named consistently in the input formula and in the image list. If they are not, an error will be thrown. All input matrices should have the same number of rows and columns.

Usage

ilr(dataFrame, voxmats, myFormula)

Arguments

dataFrame

This data frame contains all relevant predictors except for the matrices associated with the image variables.

voxmats

The named list of matrices that contains the changing predictors.

myFormula

This is a character string that defines a valid regression formula.

Value

A list of different matrices that contain names derived from the formula and the coefficients of the regression model.

Author(s)

BB Avants.

Examples


set.seed(1500)
nsub <- 100
outcome <- rnorm(nsub)
covar <- rnorm(nsub)
mat <- replicate(nsub, rnorm(nsub))
mat2 <- replicate(nsub, rnorm(nsub))
myform <- " outcome ~ covar + vox "
df <- data.frame(outcome = outcome, covar = covar)
result <- ilr(df, list(vox = mat), myform)
print(names(result))
print(rownames(result$pValue))
myform <- " vox2 ~ covar + vox "
df <- data.frame(outcome = outcome, covar = covar)
result <- ilr(df, list(vox = mat, vox2 = mat2), myform)
print(names(result))
print(rownames(result$pValue))


stnava/ANTsR documentation built on April 16, 2024, 12:17 a.m.