Description Usage Arguments Details Value See Also Examples
Drop random effects from a mixed effects model formula
1 | drop_randfx(form)
|
form |
a formula object |
form
is divided into its individual terms, any term containg a vertical
bar (|
) is removed, before form
is updated and returned.
In case form
has no random effect terms, form
is returned
unmodified. In case all effects are random, only the intercept is retained.
In any case the response variable(s) are kept as is.
A formula object
1 2 3 4 5 6 7 | f1 <- Reaction ~ (1 + Days | Subject)
f2 <- Reaction ~ (1 | mygrp/mysubgrp) + (1 | Subject)
f3 <- Reaction ~ x1 + x2 + (1 + Days | Subject)
f4 <- Reaction ~ x1 * x2 + (1 | mygrp/mysubgrp) + (1 | Subject)
f5 <- Reaction ~ x1 + x2
sapply(list(f1, f2, f3, f4, f5), drop_randfx)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.