Learn R Programming

merTools (version 0.2.1)

averageObs: Find the average observation for a merMod object

Description

Extract a data frame of a single row that represents the average observation in a merMod object. This function also allows the user to pass a series of conditioning argument to calculate the average observation conditional on other characteristics.

Usage

averageObs(merMod, varList = NULL)

Arguments

merMod
a merMod object
varList
optional, a named list of conditions to subset the data on

Value

a data frame with a single row for the average observation, but with full factor levels. See details for more.

Details

Each character and factor variable in the data.frame is assigned to the modal category and each numeric variable is collapsed to the mean. Currently if mode is a tie, returns a "." Uses the collapseFrame function.