Description Usage Arguments Details Value Examples
A simple model environment creator function working off matrices for input and response. This is much simpler and more limited than formula-based environments, but faster and easier to use, if only matrices are allowed as input.
1 2 |
designMatrix |
design matrix of input |
responseMatrix |
matrix of responses |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
na.action |
a function which indicates what should happen when the data
contain |
other |
an optional named list of additional formulae. |
... |
currently not used |
ModelEnvMatrix
returns an object of class
ModelEnv-class
- a high level object for storing
data improving upon the capabilities of simple data matrices.
Funny things may happen if the inpiut and response matrices do not have
distinct column names and the data new data are supplied via the
get
and set
slots.
An object of class ModelEnv-class
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ### use Sepal measurements as input and Petal as response
data(iris)
me <- ModelEnvMatrix(iris[,1:2], iris[,3:4])
me
### extract data from the ModelEnv object
dim(me@get("designMatrix"))
summary(me@get("responseMatrix"))
### subsets and missing values
iris[1,1] <- NA
me <- ModelEnvMatrix(iris[,1:2], iris[,3:4], subset=1:5, na.action=na.omit)
## First case is not complete, so me contains only cases 2:5
me
me@get("designMatrix")
me@get("responseMatrix")
## use different cases
me@set(data=iris[10:20,])
me@get("designMatrix")
## these two should be the same
stopifnot(all.equal(me@get("responseMatrix"), as.matrix(iris[10:20,3:4])))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.