Learn R Programming

CLME (version 2.0-4)

model_terms_clme: Create model matrices for clme

Description

Parses formulas to creates model matrices for clme.

Usage

model_terms_clme(formula, data, ncon = 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.
ncon
the number of variables in formula that are constrained.

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

See Also

CLME-package clme

Examples

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

Run the code above in your browser using DataLab