rem: Random effect matrices

View source: R/rem.R

remR Documentation

Random effect matrices

Description

Construct matrices associated with random effects.

Usage

rem(formula,data)

Arguments

formula

A formula of the form: ~ Z | G1/.../Gk + ..., corresponding to random effects Z*G_i + Z*G_{ij} + ... in a mixed effect model. If Z=1 as in most cases, then it can be ~ G1/.../Gk + ...

data

A data frame that contains all the variables in the formula.

Value

A list of matrices that are associated with random effects.

Examples

## Not run: 
# make-up example
dat<- data.frame(
   group=c("A","A","A","A","A","A","B","B","B","B"),
   sex=c("F","F","F","M","M","M","F","F","M","M"),
   pass=c("Y","N","N","Y","Y","Y","Y","N","N","Y"),
   z=1:10)

# random effect pass, group and sex, where sex is nested
# within group:
# y_{ijk} = x_{ij}*b + group_i + sex_{ij} + z*pass_{ij}
#           + e_{ijk}
rem(~ group/sex + z|pass,data=dat)

## End(Not run)

QTLRel documentation built on Aug. 9, 2023, 1:07 a.m.

Related to rem in QTLRel...