lmer: Fit Linear Mixed-Effects Models

Description Usage Arguments Details Value Slots Constraints See Also Examples

Description

lmer performs mixed model on FLTable objects.

Usage

1
2
## S3 method for class 'FLMix'
residuals(formula, data = list(), ...)

Arguments

formula

A symbolic description of model to be fitted

data

An object of class FLTable.

Details

The DB Lytix function called is FLLinMixedModel. The mixed model extends the linear model by allowing correlation and heterogeneous variances in the covariance matrix of the residuals. Fit a linear mixed-effects model (LMM) to data, FLLinMixedModel estimates the coefficients and covariance matrix of the mixed model via the expectations.

Value

lmer returns an object of class FLMix or FLMixUDT

Slots

results

cache list of results computed

table

Input data object

Constraints

DBLytix currently supports one Fixed and upto 2 Random Effect variables with intercept. For non-categorical Fixed Effect, only one Random Effect is supported. Specify if Fixed Effect is categorical using categoricalFixedEffect logical input to the function. The intercept coefficient returned is the mean value for different Random Effects.

See Also

lmer for R reference implementation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## One Random Effect.
fltbl  <- FLTable(getTestTableName("tblMixedModel"), "ObsID")
colnames(fltbl) <- tolower(colnames(fltbl))
flmod <- lmer(yval ~ fixval + (1 | ranval), data = fltbl)
flpred <- predict(flmod)
## One Categorical Fixed Effect and Two Random Effects.
fltbl  <- FLTable(getTestTableName("tblMixedModelInt"), "ObsID")
colnames(fltbl) <- tolower(colnames(fltbl))
flmod <- lmer(yval ~ fixval + (1 | ranval1) + (1 | ranval2 ), fltbl, categoricalFixedEffect=TRUE)
flpred <- predict(flmod)
## One Categorical Fixed Effect and One Random Effect.
flmod <- lmer(yval ~ fixval + (1 | ranval1), data = fltbl, categoricalFixedEffect=TRUE)
flpred <- predict(flmod)

Fuzzy-Logix/AdapteR documentation built on May 6, 2019, 5:07 p.m.