COXMEG-package: Cox Mixed-Effects Models for Genome-Wide Association Studies

coxmeg-packageR Documentation

Cox Mixed-Effects Models for Genome-Wide Association Studies

Description

Fast algorithms for fitting a Cox mixed-effects model for e.g., genome-wide association studies. See Liang He and Alexander Kulminski (2020) <doi: 10.1534/genetics.119.302940>.

Details

coxmeg is an R package for efficiently conducting GWAS of age-at-onset traits using a Cox mixed-effects model. coxmeg introduces a fast estimation algorithm for general sparse relatedness matrices including but not limited to block-diagonal pedigree-based matrices. coxmeg also introduces a fast and powerful score test for fully dense relatedness matrices, accounting for both population stratification and family structure. In addition, coxmeg can handle positive semidefinite relatedness matrices. Compared to coxme, coxmeg substantially improves the computational efficiency for estimating or testing genetic effects by using a variance component estimated once from a null model, and introducing fast algorithms, including inexact newton methods, preconditioned conjugate gradient methods and stochastic Lanczos quadrature.

Author(s)

Liang He, Stephanie Gogarten

Maintainer: Liang He <lianghe@health.sdu.dk>

References

He, L., & Kulminski, A. M. (2020). Fast algorithms for conducting large-scale GWAS of age-at-onset traits using cox mixed-effects models. Genetics, 215(1), 41-58.

Examples

library(Matrix)
library(MASS)
library(coxmeg)

## simulate a block-diagonal relatedness matrix
tau_var <- 0.2
n_f <- 100
mat_list <- list()
size <- rep(10,n_f)
offd <- 0.5
for(i in 1:n_f)
{
   mat_list[[i]] <- matrix(offd,size[i],size[i])
   diag(mat_list[[i]]) <- 1
}
sigma <- as.matrix(bdiag(mat_list))
n <- nrow(sigma)

## simulate random effexts and outcomes
x <- mvrnorm(1, rep(0,n), tau_var*sigma)
myrates <- exp(x-1)
y <- rexp(n, rate = myrates)
cen <- rexp(n, rate = 0.02 )
ycen <- pmin(y, cen)
outcome <- cbind(ycen,as.numeric(y <= cen))

## fit the Cox mixed-effects model
re = coxmeg(outcome,sigma,type='bd',order=1,detap='diagonal')
re


coxmeg documentation built on Jan. 13, 2023, 5:07 p.m.