Description Usage Arguments Value Author(s) See Also Examples
Reads a formula and derives pertinent information from iData object to create and iDesign
object.
1 2 |
formula |
Object of class |
iData |
Object of class |
subset |
A logical or numeric vector indicating which observations to include. |
weights |
An optional vector of ‘prior weights’ to be used in the fitting process. Should be NULL or a numeric vector. |
na.action |
If |
control |
A list of parameters for controlling the fitting process. See |
Returns an iDesign object.
Zachary P. Christensen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ilist <- getANTsRData("population")
mask <- getMask(ilist[[1]])
imat <- imageListToMatrix(ilist, mask)
iGroup1 <- iGroup(imat, "pop1", mask, modality = "T1")
ilist <- lappend(ilist, ilist[[1]])
imat <- imageListToMatrix(ilist, mask)
iGroup2 <- iGroup(imat, "pop2", mask, modality = "T1")
demog <- data.frame(id = c("A", "B", "C", NA),
age = c(11, 7, 18, 22), sex = c("M", "M", "F", "F"))
bool1 <- c(TRUE, TRUE, TRUE, FALSE)
bool2 <- c(TRUE, TRUE, TRUE, TRUE)
# create iData object that holds demographics info
mydata <- iData(list(iGroup1, iGroup2), c(bool1, bool2), demog)
z <- iFormula(iGroup1 ~ age, mydata)
# quick function for mean with custom defaults
myfunc <- function(x) {
mean(x, trim = .1)
}
z <- iFormula(iGroup1 ~ age, mydata, myfunc)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.