Last data update: 2014.03.03

R: Tables of p-values and Linkage Disequilibrium measures for...
LD2sided.tablesR Documentation

Tables of p-values and Linkage Disequilibrium measures for all 2x2 tables possible under the null distribution.

Description

This function calculates p-values and Linkage Disequilibrium measures for all possible 2x2 contingency tables consistent with the margins of the input observed contingency table. See LD2sided.pvals for details of the Linkage Disequilibrium measures and tests used.

Usage

LD2sided.tables(ctable)

Arguments

ctable

Vector of the 4 entries in the 2x2 contingency table

Details

This function prints out three tables. First lists all contingency tables consistent with the margins of the input table. Second lists the orderings of the contingency tables according to the different LD measures. Third gives the different LD p-values for all the contingency tables.

Value

Outputs the table of LD p-values for all the contingency tables consistent with the margins of the input table.

Author(s)

Alex Lewin

References

Kulinskaya and Lewin 2008

See Also

LD2sided.pvals

Examples

ctable <- c(0,9,5,16)
LD2sided.tables(ctable)
LD2sided.pvals(ctable)$pval.Fish

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/LD2sided.tables.Rd_%03d_medium.png", width=480, height=480)
> ### Name: LD2sided.tables
> ### Title: Tables of p-values and Linkage Disequilibrium measures for all
> ###   2x2 tables possible under the null distribution.
> ### Aliases: LD2sided.tables
> ### Keywords: htest
> 
> ### ** Examples
> 
> ctable <- c(0,9,5,16)
> 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.2860301
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>