knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir=normalizePath('../'))

Comparing two models

Read this pdf about the lmekin function.

library(coxme)
require(nlme)

fit1 <- lme(effort~Type, random= ~ 1|Subject,data=ergoStool,
            method="ML")
fit2 <- lmekin(effort ~ Type + (1|Subject), data=ergoStool,
               method="ML")
print(fit1)
print(fit2)

Kinship Matrix

Note that when there are kinship or ibd matrices, the coxme routine uses the matrix labels to match the proper row/col to the proper subject

require(kinship2)
load("data/gaw.rda")
gped <- with(gdata, pedigree(id, father, mother, sex=sex, famid=famid))
kmat <- kinship(gped)

plot(gped[9])

gfit1 <- lmekin(age ~ q1 + (1|id), data=gdata, varlist=kmat*-0.1)


yangjl/quantgen documentation built on May 4, 2019, 2:29 p.m.