Description Usage Arguments Value Author(s) References Examples
This creates an indicator matrix from several columns.
1 |
... |
the columns to bag |
prefix |
a prefix for the column names |
levels |
levels shared among all columns |
a n*p indicator matrix
1 2 3 4 5 6 7 8 9 10 11 12 | df2 <- structure(list(Dx1 = c("231", "231", "001", "245", "231", "001",
"231", "001", "231", "001", "001", "245", "001", "231", "245",
"245", "001", "231", "245", "001"), Dx2 = c("001", "001", "001",
"001", "001", "001", "001", "234", "001", "234", "001", "001",
"001", "001", "001", "777", "777", "234", "001", "234"), Dx3 = c("456",
"001", "444", "444", "001", "001", "444", "001", "001", "001",
"444", "001", "444", "456", "456", "444", "444", "456", "001",
"456")), class = "data.frame", row.names = c(NA, -20L))
Y <- 1:nrow(df2)
m <- lm(Y~bag(Dx1, Dx2, Dx3), df2)
summary(m)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.