# Re: [R] Huge number

From: Lucke, Joseph F <Joseph.F.Lucke_at_uth.tmc.edu>
Date: Tue, 19 Feb 2008 13:15:29 -0600

Use lchoose and use logarithms throughout.

> x=666
> y=1287
> lchoose(x+y,x)-(x+y)*log(2)

[1] -104.4265
> Pxy = exp(lchoose(x+y,x)-(x+y)*log(2))
[1] 4.447787e-46

Joe

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of Hyojin Lee
Sent: Monday, February 18, 2008 5:23 PM
To: r-help_at_r-project.org
Subject: [R] Huge number

Hi,
I'm trying to calculate p-value to findout definitely expressed genes compare A to B situation.
I got this data(this is a part of data) from whole organism , and each number means each expression values (that means, we could think 'a' gene is 13 in A situation, and it turns 30 in B situation) To findout probability, I'm going to use Audic - Claverie Method. ( The significance of digital gene expression profiles. 1997)

But using this equation p(x|y), I have to calculate (x+y)! first. but I can't calculate (157+221)! or (666+1387)! in R. That's probabily the handling problem of huge number, How could I calculate p value in this data with R?

```                         A             B
Total	 5874641	 6295980
a	 13	 30
b	 36	 39
c	 0	 5
d	 40	 61
e	 16	 20
f	 13	 11
g	 3	 3
h	 9	 5
i	 12	 35
j	 157	 221
k	 17	 39
l	 6	 17
m	 666	 1387
n	 2	 5

```

The significance of digital gene expression profiles.

Audic S
<http://www.ncbi.nlm.nih.gov/sites/entrez?Db=pubmed&Cmd=Search&Term=%22A udic%20S%22%5BAuthor%5D&itool=EntrezSystem2.PEntrez.Pubmed.Pubmed_Result sPanel.Pubmed_RVAbstractPlusDrugs1> , Claverie JM <http://www.ncbi.nlm.nih.gov/sites/entrez?Db=pubmed&Cmd=Search&Term=%22C laverie%20JM%22%5BAuthor%5D&itool=EntrezSystem2.PEntrez.Pubmed.Pubmed_Re sultsPanel.Pubmed_RVAbstractPlusDrugs1> .

[[alternative HTML version deleted]]

R-help_at_r-project.org mailing list