Description Usage Arguments Details Value See Also Examples
View source: R/nauf_trms_fr_x_z.R
nauf_model.matrix
creates a model matrix which employs
nauf_contrasts
for unordered factors.
1 | nauf_model.matrix(object = NULL, data = NULL, ...)
|
object |
A |
data |
A |
... |
Further arguments to be passed to |
Exactly what happens depends on the values of object
and data
.
The following possibilities are evaluated in the order listed:
All arguments besides object
are
ignored, and the information in object
is used to create the model
matrix.
All arguments besides data
are ignored,
and the information in data
is used to create the model matrix.
nauf_model.frame
is called with formula = object
and data = data
, passing along any additional arguments in
...
(including ncs_scale
). Then the model matrix is
created using the information in the resulting
nauf.frame
.
An error is returned.
A fixed effects model matrix that implements
nauf_contrasts
. Unlike the default
model.matrix
method, the model matrix does not have a
contrasts
attribute, since multiple sets of contrasts may be
required for some unordered factors.
nauf_contrasts
for a description of the contrasts
applied to unordered factors, nauf_model.frame
for creating a
model frame with nauf
contrasts, and nauf_glFormula
for obtaining both fixed effects and random effects model matrices.
1 2 3 4 5 6 7 8 9 10 11 | dat <- plosives
dat$spont[dat$dialect == "Valladolid"] <- NA
form <- intdiff ~ voicing * dialect * spont +
(1 + voicing * spont | speaker) + (1 + dialect | item)
sobj <- standardize(form, dat)
mf <- nauf_model.frame(sobj$formula, sobj$data)
## the following all result in the same model matrix
mm1 <- nauf_model.matrix(mf)
mm2 <- nauf_model.matrix(form, mf) # 'form' ignored
mm3 <- nauf_model.matrix(sobj$formula, sobj$data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.