if (FALSE) {
# 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)
}
Run the code above in your browser using DataLab