Learn R Programming

⚠️There's a newer version (1.0.1) of this package.Take me there.

gremlin

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

Cite as:

If your use of the gremlin package contributes to a publication, please cite the package as (and feel free to let me know!):

Wolak, M.E. 2018. gremlin: R package for mixed-effects model REML incorporating generalized Inverses. Version Insert version here. Zenodo http://doi.org/10.5281/zenodo.1476565.

See the latest developments:

Overview of main branches:

  • master branch is the most recent production version (often the same as what is available from the R CRAN mirrors)
  • devel branch is a preview of the next release which should be functional and error/bug free, but proceed with caution

To install gremlin:

  • From GitHub:
    library(devtools)
    
    # Install `master` branch
    install_github("matthewwolak/gremlin")
    
    # Install `devel` branch
    install_github("matthewwolak/gremlin", ref = "devel")

Examples

gremlinR

  • Estimating autosomal additive and dominance genetic variances
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)

Copy Link

Version

Install

install.packages('gremlin')

Monthly Downloads

611

Version

0.1.0.1

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Matthew Wolak

Last Published

April 9th, 2019

Functions in gremlin (0.1.0.1)

gremlin-package

Mixed-Effects REML Incorporating Generalized Inverses
gremlinR

Mixed-effect modeling functions.
residuals.gremlin

Residuals of class ‘gremlin’
stTrans

Transformation of starting parameters.
Mrode11

Weight gain data.
summary.gremlin

Gremlin model summary.
anova.gremlin

anova() for gremlin objects
tr

Matrix trace methods.
nobs.gremlin

Number of observations in data from gremlin model fit objects
logLik.gremlin

Methods to extract log-likelihood and information criterion of a gremlin model.
vech2matlist

Vector to list of matrices.