MCMCgrm: Mixed modeling with genetic relationship matrices

Description Usage Arguments Details Value References Author(s) Examples

View source: R/MCMCgrm.R

Description

Mixed modeling with genomic relationship matrix. This is appropriate with relationship matrix derived from family structures or unrelated individuals based on whole genome data.

Usage

1
MCMCgrm(model,prior,data,GRM,eps=0,n.thin=10,n.burnin=3000,n.iter=13000,...)

Arguments

model

statistical model

prior

a list of priors for parameters in the model above

data

a data.frame containing outcome and covariates

GRM

a relationship matrix

eps

a small number added to the diagonal of the a nonpositive definite GRM

n.thin

thinning parameter in the MCMC

n.burnin

the number of burn-in's

n.iter

the number of iterations

...

other options as appropriate for MCMCglmm

Details

The function was created to address a number of issues involving mixed modelling with family data or population sample with whole genome data. First, the implementaiton will shed light on the uncertainty involved with polygenic effect in that posterior distributions can be obtained. Second, while the model can be used with the MCMCglmm package there is often issues with the specification of pedigree structures but this is less of a problem with genetic relationship matrices. We can use established algorithms to generate kinship or genomic relationship matrix as input to the MCMCglmm function. Third, it is more intuitive to specify function arguments in line with other packages such as R2OpenBUGS, R2jags or glmmBUGS. In addition, our experiences of tuning the model would help to reset the input and default values.

Value

The returned value is an object as generated by MCMCglmm.

References

Hadfield JD (2010). MCMC Methods for multi-response generalized linear mixed models: The MCMCglmm R Package, J Stat Soft 33(2):1-22, http://www.jstatsoft.org/v33/i02/.

Author(s)

Jing Hua Zhao

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
### with kinship
 
# library(kinship) 
# fam <- with(l51,makefamid(id,fid,mid))
# s <-with(l51, makekinship(fam, id, fid, mid))
# K <- as.matrix(s)*2   

### with gap

s <- kin.morgan(l51)
K <- with(s,kin.matrix*2)
prior <- list(R=list(V=1, nu=0.002), G=list(G1=list(V=1, nu=0.002)))
m <- MCMCgrm(qt~1,prior,l51,K)
save(m,file="l51.m")
pdf("l51.pdf")
plot(m)
dev.off()

## End(Not run)

Example output

gap version 1.1-17

                       MCMC iteration = 0

                       MCMC iteration = 1000

                       MCMC iteration = 2000

                       MCMC iteration = 3000

                       MCMC iteration = 4000

                       MCMC iteration = 5000

                       MCMC iteration = 6000

                       MCMC iteration = 7000

                       MCMC iteration = 8000

                       MCMC iteration = 9000

                       MCMC iteration = 10000

                       MCMC iteration = 11000

                       MCMC iteration = 12000

                       MCMC iteration = 13000
png 
  2 

gap documentation built on May 29, 2017, 9:09 p.m.