model_terms_clme: Create model matrices for 'clme'

Description Usage Arguments Value Note See Also Examples

View source: R/utilities.r

Description

Parses formulas to creates model matrices for clme.

Usage

1

Arguments

formula

a formula defining a linear fixed or mixed effects model. The constrained effect(s) must come before any unconstrained covariates on the right-hand side of the expression. The first ncon terms will be assumed to be constrained.

data

data frame containing the variables in the model.

Value

A list with the elements:

Y response variable
X1 design matrix for constrained effect
X2 design matrix for covariates
P1 number of constrained coefficients
U matrix of random effects
formula the final formula call (automatically removes intercept)
dframe the dataframe containing the variables in the model
REidx an element to define random effect variance components
REnames an element to define random effect variance components

Note

The first term on the right-hand side of the formula should be the fixed effect with constrained coefficients. Random effects are represented with a vertical bar, so for example the random effect U would be included by Y ~ X1 + (1|U).

The intercept is removed automatically. This is done to ensure that parameter estimates are of the means of interest, rather than being expressed as a mean with offsets.

See Also

CLME-package clme

Examples

1
2
data( rat.blood )
model_terms_clme( mcv ~ time + temp + sex + (1|id) , data = rat.blood )

CLME documentation built on July 8, 2020, 5:49 p.m.