Re: [R] Huge number
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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hyojin Lee Sent: Monday, February 18, 2008 5:23 PM To: r-help@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 Total5874641 6295980 a13 30 b36 39 c0 5 d40 61 e16 20 f13 11 g3 3 h9 5 i12 35 j157 221 k17 39 l6 17 m666 1387 n2 5 The significance of digital gene expression profiles. Audic S http://www.ncbi.nlm.nih.gov/sites/entrez?Db=pubmedCmd=SearchTerm=%22A udic%20S%22%5BAuthor%5Ditool=EntrezSystem2.PEntrez.Pubmed.Pubmed_Result sPanel.Pubmed_RVAbstractPlusDrugs1 , Claverie JM http://www.ncbi.nlm.nih.gov/sites/entrez?Db=pubmedCmd=SearchTerm=%22C laverie%20JM%22%5BAuthor%5Ditool=EntrezSystem2.PEntrez.Pubmed.Pubmed_Re sultsPanel.Pubmed_RVAbstractPlusDrugs1 . [[alternative HTML version deleted]] __ R-help@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. __ R-help@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.
Re: [R] Huge number
If you want to compute (157+221)! then sum up the log: a - 1:(157+221) sum(log10(a)) [1] 811.8165 This is about 6.55e811 which exceeds the range of floating point numbers (1.797693e+308). You might check out the Brobdingnag package. On Feb 18, 2008 6:23 PM, Hyojin Lee [EMAIL PROTECTED] wrote: 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 Total5874641 6295980 a13 30 b36 39 c0 5 d40 61 e16 20 f13 11 g3 3 h9 5 i12 35 j157 221 k17 39 l6 17 m666 1387 n2 5 The significance of digital gene expression profiles. Audic S http://www.ncbi.nlm.nih.gov/sites/entrez?Db=pubmedCmd=SearchTerm=%22A udic%20S%22%5BAuthor%5Ditool=EntrezSystem2.PEntrez.Pubmed.Pubmed_Result sPanel.Pubmed_RVAbstractPlusDrugs1 , Claverie JM http://www.ncbi.nlm.nih.gov/sites/entrez?Db=pubmedCmd=SearchTerm=%22C laverie%20JM%22%5BAuthor%5Ditool=EntrezSystem2.PEntrez.Pubmed.Pubmed_Re sultsPanel.Pubmed_RVAbstractPlusDrugs1 . [[alternative HTML version deleted]] __ R-help@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. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? __ R-help@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.
[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 Total5874641 6295980 a13 30 b36 39 c0 5 d40 61 e16 20 f13 11 g3 3 h9 5 i12 35 j157 221 k17 39 l6 17 m666 1387 n2 5 The significance of digital gene expression profiles. Audic S http://www.ncbi.nlm.nih.gov/sites/entrez?Db=pubmedCmd=SearchTerm=%22A udic%20S%22%5BAuthor%5Ditool=EntrezSystem2.PEntrez.Pubmed.Pubmed_Result sPanel.Pubmed_RVAbstractPlusDrugs1 , Claverie JM http://www.ncbi.nlm.nih.gov/sites/entrez?Db=pubmedCmd=SearchTerm=%22C laverie%20JM%22%5BAuthor%5Ditool=EntrezSystem2.PEntrez.Pubmed.Pubmed_Re sultsPanel.Pubmed_RVAbstractPlusDrugs1 . [[alternative HTML version deleted]] __ R-help@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.