gremlin

R package for mixed-effects model REML incorporating Generalized Inverses (so, with some mental gymnastics: GREMLIN).

See the latest developments:

Overview of main branches:

To install gremlin:

Examples

gremlinR

library(gremlin)
library(nadiv)  #<-- needed for creating inverse relatedness matrices

# Set up a subset of data for the example
tmpw <- warcolak[1:(72*10), ]  #<-- only use 10 units for poor young gremlin
tmpw$ID <- as.factor(as.character(tmpw$ID))
tmpw$IDD <- tmpw$ID

# Create generalized inverse matrices
Ainv <- makeAinv(tmpw[, 1:3])$Ainv
Dinv <- makeD(tmpw[, 1:3])$Dinv
  Dinv@Dimnames[[1]] <- as.character(tmpw$ID)

# Basic model structure is as follows:
## Fixed effects of sex
## ID  = autosomal additive genetic variance term
## IDD = autosomal dominance genetic variance term
system.time(grAD <- gremlinR(trait1 ~ sex-1,
    random = ~ ID + IDD,
    ginverse = list(ID = Ainv, IDD = Dinv),
    data = tmpw,
    maxit = 25, v = 2, vit = 1))

nrow(tmpw)
summary(grAD)