Learn R Programming

qtl (version 1.70)

addcovarint: Add QTL x covariate interaction to a multiple-QTL model

Description

Try adding all QTL x covariate interactions, one at a time, to a multiple QTL model, for a given set of covariates.

Usage

addcovarint(cross, pheno.col=1, qtl, covar=NULL, icovar, formula,
            method=c("imp","hk"), model=c("normal", "binary"),
            verbose=TRUE, pvalues=TRUE, simple=FALSE, tol=1e-4,
            maxit=1000, require.fullrank=FALSE)

Value

An object of class addcovarint, with results as in the drop-one-term analysis from fitqtl. This is a data frame (given class "addcovarint", with the following columns: degrees of freedom (df), Type III sum of squares (Type III SS), LOD score(LOD), percentage of variance explained (%var), F statistics (F value), and P values for chi square (Pvalue(chi2)) and F distribution (Pvalue(F)).

Note that the degree of freedom, Type III sum of squares, the LOD score and the percentage of variance explained are the values comparing the full to the sub-model with the term dropped. Also note that for imputation method, the percentage of variance explained, the the F values and the P values are approximations calculated from the LOD score.

QTL x covariate interactions already included in the input formula are not tested.

Arguments

cross

An object of class cross. See read.cross for details.

pheno.col

Column number in the phenotype matrix which should be used as the phenotype. One may also give a character string matching a phenotype name. Finally, one may give a numeric vector of phenotypes, in which case it must have the length equal to the number of individuals in the cross, and there must be either non-integers or values < 1 or > no. phenotypes; this last case may be useful for studying transformations.

qtl

An object of class qtl, as output from makeqtl.

covar

A matrix or data.frame of covariates. These must be strictly numeric.

icovar

Vector of character strings indicating the columns in covar to be considered for QTL x covariate interactions.

formula

An object of class formula indicating the model to be fitted. (It can also be the character string representation of a formula.) QTLs are referred to as Q1, Q2, etc. Covariates are referred to by their names in the data frame covar.

method

Indicates whether to use multiple imputation or Haley-Knott regression.

model

The phenotype model: the usual model or a model for binary traits

verbose

If TRUE, will print a message if there are no interactions to test.

pvalues

If FALSE, p-values will not be included in the results.

simple

If TRUE, don't include p-values or sums of squares in the summary.

tol

Tolerance for convergence for the binary trait model.

maxit

Maximum number of iterations for fitting the binary trait model.

require.fullrank

If TRUE, give LOD=0 when covariate matrix in the linear regression is not of full rank.

Author

Karl W Broman, broman@wisc.edu

Details

The formula is used to specified the model to be fit. In the formula, use Q1, Q2, etc., or q1, q2, etc., to represent the QTLs, and the column names in the covariate data frame to represent the covariates.

We enforce a hierarchical structure on the model formula: if a QTL or covariate is in involved in an interaction, its main effect must also be included.

References

Haley, C. S. and Knott, S. A. (1992) A simple regression method for mapping quantitative trait loci in line crosses using flanking markers. Heredity 69, 315--324.

Sen, Ś. and Churchill, G. A. (2001) A statistical framework for quantitative trait mapping. Genetics 159, 371--387.

See Also

addint, fitqtl, makeqtl, scanqtl, refineqtl, addqtl, addpair

Examples

Run this code
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 <- subset(fake.f2, ind=1:50)
fake.f2 <- calc.genoprob(fake.f2, step=2, err=0.001)
qtl <- makeqtl(fake.f2, qc, qp, what="prob")

# use the sex phenotype as the covariate
covar <- data.frame(sex=fake.f2$pheno$sex)

# try all possible QTL x sex interactions, one at a time
addcovarint(fake.f2, pheno.col=1, qtl, covar, "sex", y~Q1+Q2+Q3,
            method="hk")

Run the code above in your browser using DataLab