Learn R Programming

QTLRel (version 0.2-10)

qtlVar: QTL Variance

Description

Estimate variance in a quantitative trait induced by QTL.

Usage

qtlVar(lrt,prdat,simulation=FALSE,nsim=25)

Arguments

lrt
a data frame (a, d, ...), where 'a' and 'd' are respectively additive and dominance effects.
prdat
a 3-D array that provides probabilities of genotypes "AA", "AB" and "BB". If prDat is an object of genoProb, then prdat can be prDat$pr.
simulation
whether to use simulations to estimate the variance explained by QTL.
nsim
number of simulations to perform if simulation is TRUE.

Value

  • A vector displaying the estimated variance at each loci.

See Also

scanOne and genoProb

Examples

Run this code
data(miscEx)

# impute missing genotypes
gdtmp<- gdatF8
   gdtmp<- replace(gdtmp,is.na(gdtmp),0)
# rung 'genoProb'
prDat<- genoProb(gdat=gdtmp, gmap=gmapF8, step=Inf,
   gr=8, method="Haldane", verbose=TRUE)
# estimate variance components
o<- estVC(y=pdatF8$bwt, x=pdatF8$sex, v=list(AA=gmF8$AA,DD=gmF8$DD,
	HH=NULL, AD=NULL, MH=NULL, EE=diag(length(pdatF8$bwt))))

# genome scan
pv.hk<- scanOne(y=pdatF8$bwt, x=pdatF8$sex, prdat=prDat, vc=o)

# run 'qtlVar'
qef<- NULL
for(n in 1:length(llk.hk$par))
   qef<- rbind(qef,llk.hk$par[[n]][c("a","d")])
   qef<- as.data.frame(qef)
qtlVar(qef,prDat$pr)[1:3]

Run the code above in your browser using DataLab