Description Usage Arguments Details Value Examples
This functions serves as a constructor for an object of the class
pim.environment
. In most cases, calling this function directly
is not necessary.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | new.pim.env(data, ...)
## S4 method for signature 'missing'
new.pim.env(data, ...)
## S4 method for signature 'environment'
new.pim.env(
data,
compare = "unique",
env = parent.frame(),
vars = NULL,
classes = NULL,
...
)
## S4 method for signature 'list'
new.pim.env(data, compare = "unique", vars = NULL, ...)
## S4 method for signature 'data.frame'
new.pim.env(data, compare = "unique", vars = NULL, ...)
## S4 method for signature 'ANY'
new.pim.env(data, ...)
|
data |
a data frame, a list or an environment containing the data for a probabilistic index model. |
... |
extra parameters for construction of the poset, like
the argument |
compare |
a character vector, matrix or list that defines how the
set of pseudo observations (poset) should be constructed.
if set to |
env |
an environment that is the parent environment of the object. |
vars |
An optional character vector with the names of the variables
that should be included in the pim environment. Note that the
variable names should be found in the object passed to argument |
classes |
An optional character vector with the classes of the
variables in the environment, given in the same order as
the argument |
This function is called during the preparation of the model matrix for a pim. The resulting object is used to evaluate the formula of a pim, and stores information on how this is done.
Note that the parent of the environment is actually the
pim.poset
object in the poset
slot.
The parent you set using the env
argument,
is the parent of the pim.poset
object. This ensures that
when a formula is evaluated in the pim.environment
it
will use a suitable search path to find all functions and objects.
an object of the class pim.environment
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | new.pim.env() # Creates an empty object
# Starting from a data frame
data(DysData)
env1 <- new.pim.env(DysData)
env2 <- new.pim.env(DysData, compare=NULL)
poset(env2)
env3 <- new.pim.env(DysData, compare="all")
poset(env3)
data(FEVData)
env4 <- new.pim.env(FEVData, vars=c('Age','Sex'))
ls(env4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.