Hi all, I have tried to compute a p-value for a hypergeometric distribution as: dhyper(x,k,l,n) + phyper(x,k,l,n,lower.tail=FALSE) and sometimes obtained negative values. Do you know if it is because a round error or am I doing something wrong? Thanks in advance, Aurora
You are doing something wrong.The p-value should be calculated using phyper alone. HTH, Jim James W. MacDonald Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623>>> Aurora Torrente <aurora at ebi.ac.uk> 11/14/03 09:22AM >>>Hi all, I have tried to compute a p-value for a hypergeometric distribution as: dhyper(x,k,l,n) + phyper(x,k,l,n,lower.tail=FALSE) and sometimes obtained negative values. Do you know if it is because a round error or am I doing something wrong? Thanks in advance, Aurora ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Aurora Torrente <aurora at ebi.ac.uk> writes:> Hi all, > > I have tried to compute a p-value for a hypergeometric distribution as: > > dhyper(x,k,l,n) + phyper(x,k,l,n,lower.tail=FALSE) > > and sometimes obtained negative values. Do you know if it is because > a round error or am I doing something wrong?Could you give us specific x,k,l,n where this happens, please. It sounds like it shouldn't happen. -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907