Learn R Programming

cape (version 2.0.2)

kinship.on.the.fly: Kinship correction for genotype and phenotype.

Description

This function calculates corrected genotype, phenotype, and covariate values using previously calculated kinship matrices.

Usage

kinship.on.the.fly(kin.mats, geno, chr1 = NULL, chr2 = NULL, phenoV, covarV = NULL)

Arguments

kin.mats
The list of kinship matrices calculated by kinship.
geno
The genotype matrix.
chr1
Kinship matrices are calculated in a leave-one-out or leave-two-out manner, i.e. the chromosome(s) on which the markers being tested are located are left out of the kinship correction. This argument indicates the chromosome on which one marker of the marker pair resides. It indicates which kinship matrix to use for the data correction. If chr2 == chr1, the leave-one-out kinship matrix for that chromosome will be used. Otherwise, the leave-two-out kinship matrix is used. If both chr1 and chr2 are NULL, the kinship matrix for the entire genome will be used.

chr2
Kinship matrices are calculated in a leave-one-out or leave-two-out manner, i.e. the chromosome(s) on which the markers being tested are located are left out of the kinship correction. This argument indicates the chromosome on which one marker of the marker pair resides. It indicates which kinship matrix to use for the data correction. If chr2 == chr1, the leave-one-out kinship matrix for that chromosome will be used. Otherwise, the leave-two-out kinship matrix is used. If both chr1 and chr2 are NULL, the kinship matrix for the entire genome will be used.
phenoV
The phenotype vector to be corrected by the appropriate kinship matrix.
covarV
The covariate vector to be corrected by the appropriate kinship matrix.

Value

Returns a list of data corrected using the appropriate kinship matrix. The elements of the list are as follows:
err.cov
The error covariance matrix from the calculation.
corrected.pheno
The kinship-corrected phenotype values.
corrected.geno
The kinship-corrected genotype values.
corrected.covar
The kinship-corrected covariate values.

See Also

kinship