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

term_contain

Determine which Terms Contain a Term


Description

The definition of containment follows from the SAS documentation on "The Four Types of Estimable Functions".

Usage

term_contain(term, factors, dataClasses, term_names)

Arguments

term

character; name of a model term and one of term_names.

factors

the result of attr(terms_object, "factors").

dataClasses

the result of attr(terms(model, fixed.only=FALSE), "dataClasses"). Note that fixed.only=FALSE is only needed for merMod objects, but does no harm for lm objects.

term_names

the result of attr(terms_object, "term.labels").

Details

Containment is defined for two model terms, say, F1 and F2 as: F1 is contained in F2 (F2 contains F1) if

  1. F1 and F2 involve the same continuous variables (if any)

  2. F2 involve more factors than F1

  3. All factors in F1 (if any) are part of F2

The intercept, though not really a model term, is defined by SAS to be contained in all factor terms, but it is not contained in any effect involving a continuous variable.

Value

a logical vector indicating for each term in term_names if it contains term.


lmerTest

Tests in Linear Mixed Effects Models

v3.1-3
GPL (>= 2)
Authors
Alexandra Kuznetsova [aut], Per Bruun Brockhoff [aut, ths], Rune Haubo Bojesen Christensen [aut, cre], Sofie Pødenphant Jensen [ctb]
Initial release

We don't support your browser anymore

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