ilr.predict | R Documentation |
This function computes a prediction given ilr
output.
ilr.predict(ilrResult, dataFrame, voxmats, myFormula)
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. |
the predicted matrix.
BB Avants.
ilr
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]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.