LDkl: LD statistics for two multiallelic markers

View source: R/2ld.R

LDklR Documentation

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:

  • n1 the number of alleles at marker 1.

  • n2 the number of alleles at marker 2.

  • h the haplotype frequency vector.

  • n the number of haplotypes.

  • Dp D'.

  • VarDp variance of D'.

  • Dijtable table of Dij.

  • VarDijtable table of variances for Dij.

  • Dmaxtable table of Dmax.

  • Dijptable table of Dij'.

  • VarDijptable table of variances for Dij'.

  • X2table table of Chi-squares (based on Dij).

  • ptable table of p values.

  • x2 the Chi-squared statistic.

  • seX2 the standard error of x2/n.

  • rho the measure of association.

  • seR the standard error of rho.

  • optrho the method for calculating rho.

  • klinfo the Kullback-Leibler information.

Note

adapted from 2ld.c.

Author(s)

Jing Hua Zhao

References

\insertRef

bishop75gap

\insertRef

cramer46gap

\insertRef

zapata01gap

\insertRef

zhao04gap

See Also

LD22

Examples

## Not run: 
# 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"
# The data is now available from 2ld in Haplotype-Analysis

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

## End(Not run)


gap documentation built on Sept. 11, 2024, 5:36 p.m.