Learn R Programming

gap (version 1.1-1)

LDkl: LD statistics for two multiallelic markers

Description

LD statistics for two multiallelic loci. For two diallelic makers, the familiar $r^2$ has standard error seX2.

Usage

LDkl(n1=2,n2=2,h,n,optrho=2,verbose=FALSE)

Arguments

n1
number of alleles at marker 1
n2
number of alleles at marker 2
h
a vector of haplotype frequencies
n
number of haplotypes
optrho
type of contingency table association, 0=Pearson, 1=Tschuprow, 2=Cramer (default)
verbose
detailed output of individual statistics

Value

  • The returned value is a list containing:
  • n1the number of alleles at marker 1
  • n2the number of alleles at marker 2
  • hthe haplotype frequency vector
  • nthe number of haplotypes
  • DpD'
  • VarDpvariance of D'
  • Dijtabletable of Dij
  • VarDijtabletable of variances for Dij
  • Dmaxtabletable of Dmax
  • Dijptabletable of Dij'
  • VarDijptabletable of variances for Dij'
  • X2tabletable of Chi-squares (based on Dij)
  • ptabletable of p values
  • x2the Chi-squared statistic
  • seX2the standard error of x2/n
  • rhothe measure of association
  • seRthe standard error of rho
  • optrhothe method for calculating rho
  • klinfothe Kullback-Leibler information

References

Bishop YMM, Fienberg SE, Holland PW (1975) Discrete Multivariate Analysis -- Theory and Practice, The MIT press

Cramer H (1946) Mathematical Methods of Statistics. Princeton Univ. Press

Zapata C, Carollo C, Rodriquez S (2001) Sampleing variance and distribution of the D' measure of overall gametic disequilibrium between multiallelic loci. Ann. Hum. Genet. 65: 395-406

Zhao, JH (2004). 2LD, GENECOUNTING and HAP: Computer programs for linkage disequilibrium analysis. Bioinformatics 20:1325-1326

See Also

LD22

Examples

Run this code
# two examples in the C program 2LD:
# two SNPs as in 2by2.dat
# this can be compared with output from LD22

h <- c(0.442356,0.291532,0.245794,0.020319)
n <- 481*2
t <- LDkl(2,2,h,n)
t

# two multiallelic markers as in kbyl.dat
# the two-locus haplotype vector is in file "kbyl.dat"

filespec <- file.path(.path.package("gap"),"tests/kbyl.dat")
h <- scan(filespec,skip=1)
t <- LDkl(9,5,h,213*2,verbose=TRUE)

Run the code above in your browser using DataLab