Description Usage Arguments Details Value Examples
mspec_empty()
, mspec_add()
, mspec_rmv()
, and mspec_sub()
are
functions that can be used to create model fitting specifications.
mspec_describe()
is a function that helps clarify model specifications
and facilitates interactive work.
1 2 3 4 5 6 7 8 9 10 11 |
name |
(character value). The label that will be used to describe this model specification |
... |
A set of variable names (separated by commas) that will be used to adjust estimates in fitted models when this specification is applied. The values may be supplied with or without quotation marks around the variable names (e.g., 'x' or x). |
parent |
This parameters if only used for |
Use mspec_empty()
to create a generic unadjusted specification.
Use mspec_add()
, mspec_rmv()
, and mspec_sub()
to create descendant
model specifications, and use mspec_describe()
to summarize the structure
of the model specifications in a concise manner that accounts for
their dependencies (see examples).
mspec_empty()
returns an unadjusted model specification.
mspec_new()
returns a model specification
mspec_add()
, mspec_rmv()
returns a model specification with the
designated control variables added or removed from the parent
model specification.
mspec_sub()
returns a model specification with the designated
control variables (left hand side of the =
) replaced by
variable names supplied by the user (right hand side of the =
)
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 | # Make an unadjusted model
m0 <- mspec_empty("Model 0")
# mspec_describe(mspec) is the same as print(mspec)
mspec_describe(m0)
print(m0)
# Model 1 includes adjustment for sex and class
m1 <- mspec_add(m0, name = "Model 1", sex, pclass)
m1
# Model 2a = model 1 + no. of siblings/spouses
m2a <- mspec_add(m1, name = 'Model 2a', sibsp)
m2a
# Model 2b = model 1 + no. of parents/children
m2b <- mspec_add(m1, name = 'Model 2b', parch)
m2b
# Model 3 = model 1, swapping out class for ticket fare
m3 <- mspec_sub(m1, name = 'Model 3', pclass = fare)
m3
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.