data(fake.f2)
# take out several QTLs and make QTL object
qc <- c(1, 8, 13)
qp <- c(26, 56, 28)
fake.f2 <- subset(fake.f2, chr=qc)
fake.f2 <- calc.genoprob(fake.f2, step=2, err=0.001)
qtl <- makeqtl(fake.f2, qc, qp, what="prob")
# fit model with 3 interacting QTLs interacting
# (performing a drop-one-term analysis)
lod <- fitqtl(fake.f2, pheno.col=1, qtl, formula=y~Q1*Q2*Q3, method="hk")
summary(lod)
## Not run:
# # fit an additive QTL model
# lod.add <- fitqtl(fake.f2, pheno.col=1, qtl, formula=y~Q1+Q2+Q3, method="hk")
# summary(lod.add)
#
# # fit the model including sex as an interacting covariate
# Sex <- data.frame(Sex=pull.pheno(fake.f2, "sex"))
# lod.sex <- fitqtl(fake.f2, pheno.col=1, qtl, formula=y~Q1*Q2*Q3*Sex,
# cov=Sex, method="hk")
# summary(lod.sex)
#
# # fit the same with an additive model
# lod.sex.add <- fitqtl(fake.f2, pheno.col=1, qtl, formula=y~Q1+Q2+Q3+Sex,
# cov=Sex, method="hk")
# summary(lod.sex.add)
#
# # residuals
# residuals <- attr(lod.sex.add, "residuals")
# plot(residuals)
# ## End(Not run)
Run the code above in your browser using DataLab