
R version 2.15.0 (2012-03-30)
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-unknown-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.

  Natural language support but running in an English locale

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.

Settings for Mayo HSR...
---------------------------------
 *Attaching packages: rlocal, survival, gam
Loading rlocal for Mayo HSR


Attaching package: ‘rlocal’

The following object(s) are masked from ‘package:base’:

    table

Loading required package: stats
Loading required package: utils
Loading required package: graphics
Loading required package: splines
Loaded gam 1.06.2

 *Setting stringsAsFactors option to False
---------------------------------
Loading required package: grDevices

Settings preferred by Jason Sinnwell:
  -load rlocal...
  -add lib: /projects/bsi/gentools/R/lib213...
  -make interactive plots not slow...
  -limit printing to 1000 lines...
  -view help in html with elinks (see rweb in localScripts)...
R> #$Author: sinnwell $
R> #$Date: 2005/08/12 15:27:54 $
R> #$Header: /people/biostat3/sinnwell/Projects/LDpairs/Make/RCS/ld.pairs.demo.q,v 1.1 2005/08/12 15:27:54 sinnwell Exp $
R> #$Locker:  $
R> #$Log: ld.pairs.demo.q,v $
R> #Revision 1.1  2005/08/12 15:27:54  sinnwell
R> #Initial revision
R> #
R> #Revision 1.2  2004/03/25 22:39:29  sinnwell
R> #add comments, and it works now
R> #
R> #Revision 1.1  2004/03/24 20:37:09  sinnwell
R> #Initial revision
R> #
R> 
R> require(ld.pairs)
Loading required package: ld.pairs
Loading required package: haplo.stats

Attaching package: ‘haplo.stats’

The following object(s) are masked from ‘package:rlocal’:

    printBanner

R> 
R> g.test <- matrix(c(1,1,1,2,
+                  2,3,2,2,
+                  1,3,1,3,
+                  1,3,3,3,
+                  1,3,1,2,
+                  2,3,2,3),ncol=4,byrow=T)
R> 
R> ld.test <- ld.pairs(g.test,c("A","B"))
R> 
R> print(ld.test)
  loc1 loc2 loc1.label loc2.label dprime.ave r2 lr.stat lr.df  lr.pval
1    1    2          A          B    0.60714 NA  4.4482     1 0.034938
  comp.stat comp.df comp.pval
1    6.0417       4   0.19606
R> #not worth plotting, since only one pair of loci.
R> 
R> 
R>  "geno.random" <- matrix(c(c(4., 2., 4., 4., 2., 2., 4., 2., 1., 3.)
+                 , c(4., 3., 4., 1., 2., 4., 3., 4., 2., 4.)
+                 , c(2., 2., 2., 3., 1., 3., 1., 3., 3., 2.)
+                 , c(2., 3., 3., 3., 3., 3., 3., 2., 3., 3.)
+                 , c(4., 3., 3., 1., 4., 4., 2., 2., 4., 3.)
+                 , c(2., 4., 4., 1., 4., 4., 1., 4., 3., 1.)
+                 , c(3., 2., 4., 4., 4., 4., 2., 1., 2., 4.)
+                 , c(3., 2., 4., 3., 4., 3., 3., 4., 3., 4.)
+                 ), ncol=10, byrow=T)
R> 
R> # this ld.pairs call may actually get a warning for wrong df in qchisq.
R> # this is a problem with the nature of using lrt in this context, but 
R> # go ahead and disregard the warning and use the results
R> ld.obj5 <- ld.pairs(geno.random,c("A","B","C","D", "E"))
Warning message:
In ld.pairs(geno.random, c("A", "B", "C", "D", "E")) :
  One or more degrees of freedom have value zero (0). 

R> 
R> print(ld.obj5)
   loc1 loc2 loc1.label loc2.label dprime.ave r2 lr.stat lr.df   lr.pval
1     1    2          A          B    0.45067 NA  5.1763     1 0.0228972
2     1    3          A          C    0.44624 NA  3.6460     2 0.1615385
3     1    4          A          D    0.59341 NA  4.6626     2 0.0971681
4     1    5          A          E    0.68750 NA  7.7459     1 0.0053833
5     2    3          B          C    0.75000 NA  8.9063     0 0.0000000
6     2    4          B          D    0.57153 NA  4.4971     2 0.1055505
7     2    5          B          E    0.70833 NA  7.2877     2 0.0261517
8     3    4          C          D    0.52652 NA  7.1107     2 0.0285720
9     3    5          C          E    0.64423 NA  7.8369     2 0.0198717
10    4    5          D          E    0.61185 NA  2.1256     1 0.1448600
   comp.stat comp.df comp.pval
1     9.7561       6  0.135306
2     8.6924       6  0.191628
3     7.7143       6  0.259792
4    10.1905       6  0.116856
5    16.1630       9  0.063555
6     9.8011       9  0.366824
7    13.0081       9  0.162239
8    11.1276       9  0.267064
9    12.6275       9  0.180201
10   11.8974       9  0.219153
R> plot(ld.obj5)
R> 
R> 
R> 

 Thanks for using

  ******* 
 /**////** 
 /**   /** 
 /******* 
 /**///** 
 /**  //** 
 /**   //** 
 //     //  

> proc.time()
   user  system elapsed 
  1.272   0.087   1.508 
