ilr.predict: Predict from ilr output

View source: R/bigLMStats.R

ilr.predictR Documentation

Predict from ilr output

Description

This function computes a prediction given ilr output.

Usage

ilr.predict(ilrResult, dataFrame, voxmats, myFormula)

Arguments

ilrResult

This output form ilr

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

the predicted matrix.

Author(s)

BB Avants.

See Also

ilr

Examples


set.seed(1500)
nsub <- 100
trte <- sample(1:nsub)[1:70]
covarIn <- rnorm(nsub)
mat <- replicate(nsub, rnorm(nsub))
mat2 <- replicate(nsub, rnorm(nsub))
outcomeAtVox <- mat[, 2]
# also try myform = " vox ~ covar + vox2 "
myform <- "outcome ~ covar + vox + vox2"
df <- data.frame(outcome = outcomeAtVox, covar = covarIn)
result <- ilr(df[trte, ], list(vox = mat[trte, ], vox2 = mat2[trte, ]), myform)
df2 <- data.frame(covar = covarIn[-trte])
pred <- ilr.predict(result, df2, list(vox = mat[-trte, ], vox2 = mat2[-trte, ]), myform)
max(cor(pred, outcomeAtVox[-trte]))


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