drop_randfx: Drop random effects

Description Usage Arguments Details Value See Also Examples

View source: R/drop_effects.R

Description

Drop random effects from a mixed effects model formula

Usage

1

Arguments

form

a formula object

Details

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.

Value

A formula object

See Also

drop_pattern

Examples

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)

AkselA/R-ymse documentation built on March 21, 2020, 9:52 a.m.