grouping.levels {influence.ME}R Documentation

Returns the levels of a grouping factor in a mixed effects regression model

Description

Helper function returning all the levels of a grouping factor in a mixed effects regression model. This is used in combination with the influence.ME function, the divide long runs into multiple shorter ones.

Usage

grouping.levels(model, group)

Arguments

model Mixed effects model of class 'mer'
group Grouping factor of 'model' of which the levels are returned

Details

Please note that at times different results may be obtained by using nesting.levels(), compared with deriving the levels of the grouping factor directly from the (original) data. This is because nesting.levels() only extracts the nesting levels that were de facto used in the model. Due to missing values, this may diverge from those present in the actual data.

Value

Returns a character vector containing all the names / labels of levels of the grouping factor.

Author(s)

Rense Nieuwenhuis, Ben Pelzer, Manfred te Grotenhuis

References

http://www.ru.nl/mt/ic/downloads/

Examples

 # Penicillin data originates from the lme4 package.
 model <- lmer(diameter ~ (1|plate) + (1|sample), Penicillin)

 grouping.levels(model, "plate")
 grouping.levels(model, "sample")

[Package influence.ME version 0.6.1 Index]