ilr | R Documentation |
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.
ilr(dataFrame, voxmats, myFormula)
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. |
A list of different matrices that contain names derived from the formula and the coefficients of the regression model.
BB Avants.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.