[R] Huge number
Lucke, Joseph F
Joseph.F.Lucke at uth.tmc.edu
Tue Feb 19 20:15:29 CET 2008
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
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list