Last data update: 2014.03.03

R: Exact tests for Linkage Disequilibrium and Hardy-Weinberg...
LDtests-packageR Documentation

Exact tests for Linkage Disequilibrium and Hardy-Weinberg Equilibrium

Description

Exact tests for Linkage Disequilibrium (LD) and Hardy-Weinberg Equilibrium (HWE). - 2-sided LD tests based on different measures of LD (Kulinskaya and Lewin 2008) - 1-sided Fisher's exact test for LD - 2-sided Haldane test for HWE (Wiggington 2005) - 1-sided test for inbreeding - conditional p-values proposed in Kulinskaya (2008) to overcome the problems of asymetric distributions (for both LD and HWE)

Details

Package: LDtests
Type: Package
Version: 1.0
Date: 2008-06-07
License: GPL

LD2sided.pvals calculates LD p-values for the input table Fisher1sided calculates Fisher's 1-sided p-values for LD for the input table HWE2sided calculates HWE p-values for the input table LD2sided.tables calculates LD p-values for an entire null distribution HWE2sided.table calculates HWE p-values for an entire null distribution

Author(s)

Alex Lewin Maintainer: Alex Lewin <a.m.lewin@imperial.ac.uk>

References

Kulinskaya and Lewin 2008

Examples

ctable <- c(4,5,1,20)
LD2sided.tables(ctable)
LD2sided.pvals(ctable)$pval.Fish
Fisher1sided(ctable)$pval.Fish 
HWE2sided.table(maf=0.17,n=100)
geno <- c(20,73,7)
HWE2sided(geno)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(LDtests)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/LDtests/LDtests.package.Rd_%03d_medium.png", width=480, height=480)
> ### Name: LDtests-package
> ### Title: Exact tests for Linkage Disequilibrium and Hardy-Weinberg
> ###   Equilibrium
> ### Aliases: LDtests-package LDtests
> ### Keywords: htest
> 
> ### ** Examples
> 
> ctable <- c(4,5,1,20)
> LD2sided.tables(ctable)

 LD measures for all possible 2x2 tables:
  n11 n12 n21 n22  Prob     LR      r     D'  delta      Q
1   0   9   5  16 0.143  3.981 -0.293 -1.000 -0.562 -1.000
2   1   8   4  17 0.378  0.304 -0.098 -0.333 -0.176 -0.306
3   2   7   3  18 0.336  0.274  0.098  0.143  0.167  0.263
4   3   6   2  19 0.124  2.368  0.293  0.429  0.474  0.652
5   4   5   1  20 0.019  6.628  0.488  0.714  0.750  0.882
6   5   4   0  21 0.001 14.668  0.683  1.000  1.000  1.000

 Orderings of 2x2 tables for different LD measures:
         X1 X2  X3 X4  X5 X6
Fish     1  2   0  3   4  5 
LR       2  1   3  0   4  5 
|r|     (1  2) (0  3)  4  5 
|D'|     2  1   3  4  (0  5)
|delta|  2  1   3  0   4  5 
|Q|      2  1   3  4  (0  5)

 P-values for all possible 2x2 tables:
  n11 obs n12 obs n21 obs n22 obs pval.Fish pval.LR pval.r pval.Dprime
1       0       9       5      16     0.286   0.162  0.286       0.144
2       1       8       4      17     1.000   0.664  1.000       0.664
3       2       7       3      18     0.622   1.000  1.000       1.000
4       3       6       2      19     0.143   0.286  0.286       0.286
5       4       5       1      20     0.019   0.019  0.019       0.162
6       5       4       0      21     0.001   0.001  0.001       0.144
  pval.delta pval.Q pval.cond
1      0.162  0.144     0.274
2      0.664  0.664     1.000
3      1.000  1.000     1.000
4      0.286  0.286     0.299
5      0.019  0.162     0.041
6      0.001  0.144     0.002
> LD2sided.pvals(ctable)$pval.Fish
[1] 0.01945181
> Fisher1sided(ctable)$pval.Fish 
[1] 0 1 2 3 4 5
[1] 0.01945181
> HWE2sided.table(maf=0.17,n=100)
   no. het pval.inbred pval.Hald pval.cond
1        0      0.0000    0.0000    0.0000
2        2      0.0000    0.0000    0.0000
3        4      0.0000    0.0000    0.0000
4        6      0.0000    0.0000    0.0000
5        8      0.0000    0.0000    0.0000
6       10      0.0000    0.0000    0.0000
7       12      0.0000    0.0000    0.0000
8       14      0.0000    0.0000    0.0000
9       16      0.0001    0.0001    0.0002
10      18      0.0011    0.0011    0.0019
11      20      0.0071    0.0071    0.0125
12      22      0.0337    0.0337    0.0593
13      24      0.1171    0.1507    0.2058
14      26      0.2991    0.4735    0.5258
15      28      0.5689    1.0000    1.0000
16      30      0.8256    0.7303    1.0000
17      32      0.9664    0.2915    0.4045
18      34      1.0000    0.0674    0.0780
> geno <- c(20,73,7)
> HWE2sided(geno)
$pval.cond
[1] 0.01248399

$pval.H
[1] 0.007101873

$pval.inbreed
[1] 0.007101873

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>