lm4d: Voxelwise linear models

Description Usage Arguments Value Author(s) See Also Examples

Description

This is a wrapper function for lm.mp to handle 3D image responses.

Usage

1
lm4d(arr4d, formula, store.fitted = FALSE)

Arguments

arr4d

a 4-dimensional response array, where the first 3 dimensions refer to spatial coordinates and the last dimension corresponds to different images.

formula, store.fitted

see lm.mp.

Value

An object of class "lm.mp", with two changes. (1) If store.fitted = TRUE, the fitted values are given as a 4-dimensional array. (2) A call component is included.

Author(s)

Lei Huang huangracer@gmail.com, Yin-Hsiu Chen enjoychen0701@gmail.com, and Philip Reiss phil.reiss@nyumc.org

See Also

lm.mp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(test)
d4 = test$d4
x = test$x
lmobj = lm4d(d4, ~x)

# Convert d4 to a matrix, and confirm that lm.mp() gives the same results as lm4d()
d4.2 = d4
dim(d4.2) = c(prod(dim(d4)[1:3]), dim(d4)[4])
Y = t(d4.2)
lmobj2 = lm.mp(Y, ~x)
all.equal(lmobj$coef, lmobj2$coef)

vows documentation built on May 2, 2019, 9:26 a.m.