Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

h2.jags

Heritability estimation based on genomic relationship matrix using JAGS


Description

Heritability estimation based on genomic relationship matrix using JAGS

Usage

h2.jags(y,x,G,eps=0.0001,sigma.p=0,sigma.r=1,parms=c("b","p","r","h2"),...)

Arguments

y

outcome vector

x

covariate matrix

G

genomic relationship matrix

eps

a positive diagonal perturbation to G

sigma.p

initial parameter values

sigma.r

initial parameter values

parms

monitored parmeters

...

parameters passed to jags, e.g., n.chains, n.burnin, n.iter

Details

This function performs Bayesian heritability estimation using genomic relationship matrix.

Value

The returned value is a fitted model from jags().

References

Zhao JH, Luan JA, Congdon P (2018). Bayesian linear mixed models with polygenic effects. J Stat Soft 85(6):1-27

Author(s)

Jing Hua Zhao

Examples

## Not run: 
require(gap.datasets)
set.seed(1234567)
meyer <- within(meyer,{
    y[is.na(y)] <- rnorm(length(y[is.na(y)]),mean(y,na.rm=TRUE),sd(y,na.rm=TRUE))
    g1 <- ifelse(generation==1,1,0)
    g2 <- ifelse(generation==2,1,0)
    id <- animal
    animal <- ifelse(!is.na(animal),animal,0)
    dam <- ifelse(!is.na(dam),dam,0)
    sire <- ifelse(!is.na(sire),sire,0)
})
G <- kin.morgan(meyer)$kin.matrix*2
library(regress)
r <- regress(y~-1+g1+g2,~G,data=meyer)
r
with(r,h2G(sigma,sigma.cov))
eps <- 0.001
y <- with(meyer,y)
x <- with(meyer,cbind(g1,g2))
ex <- h2.jags(y,x,G,sigma.p=0.03,sigma.r=0.014)
print(ex)

## End(Not run)

gap

Genetic Analysis Package

v1.2.3-1
GPL (>= 2)
Authors
Jing Hua Zhao and colleagues with inputs from Kurt Hornik and Brian Ripley
Initial release
2021-4-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.