| re2uncorr | R Documentation |
lme4 and similar packages (e.g. glmmTMB) have an issue where correlations between factor random slopes are not dropped, even if using the double-bar syntax or diag to diagonalize the random-effects formula. re2uncorr works around this issue by explicitly converting factor random slopes to numerics, which do not suffer from this problem.
re2uncorr(formula, data, drop = TRUE)
formula |
The lme4 formula. |
data |
The data. |
drop |
Logical indicating whether constant, non-intercept columns should be dropped. Default |
To ensure that the various buildmer functions (e.g. buildmer, buildglmmTMB) correctly apply marginality constraints between fixed effects and random-effect terms, the fixed effects are renamed using the same name-mangling scheme that is automatically applied to the random effects. To ensure that the mangled names will be grouped together, instead of passing the returned formula, use the returned termlist with a dep argument. See the description of the dep argument in buildmerControl.
A list containing a new formula (has a dependent variable but loses track of what terms belong together in a single block), a buildmer term list (lacks the dependent variable but represents what terms belong together), and a new data set.
library(buildmer)
re <- re2uncorr(f1 ~ vowel*timepoint*following +
(vowel*timepoint*following|participant) + (timepoint|word),vowels)
model <- buildmer(re$formula,re$data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.