Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

add.terms

Add terms to a formula


Description

Add terms to a formula

Usage

add.terms(formula, add)

Arguments

formula

The formula to add terms to.

add

A vector of terms to add. To add terms nested in random-effect groups, use ‘(term|group)’ syntax if you want to add an independent random effect (e.g. ‘(olderterm|group) + (term|group)’), or use ‘term|group’ syntax if you want to add a dependent random effect to a pre-existing term group (if no such group exists, it will be created at the end of the formula).

Value

The updated formula.

Examples

library(buildmer)
form <- Reaction ~ Days + (1|Subject)
add.terms(form,'Days|Subject')
add.terms(form,'(0+Days|Subject)')
add.terms(form,c('many','more|terms','to|terms','(be|added)','to|test'))

buildmer

Stepwise Elimination and Term Reordering for Mixed-Effects Regression

v1.9
FreeBSD
Authors
Cesko C. Voeten [aut, cre] (<https://orcid.org/0000-0003-4687-9973>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.