Displaying 20 results from an estimated 200 matches similar to: "(PR#7393) Re: dhyper() does not allow non-integer values for"
2004 Nov 25
0
(PR#7393) Re: dhyper() does not allow non-integer values for
>>>>> "PD" == Peter Dalgaard <p.dalgaard@biostat.ku.dk>
>>>>> on 24 Nov 2004 18:32:15 +0100 writes:
PD> tlumley@u.washington.edu writes:
>> > > dhyper() does not allow non-integer values for input
>> parameters m and n.
>> >
>> > this is in contrast to the other functions in the
2008 Feb 27
1
dhyper, phyper (PR#10853)
Aloha all,
I know too little about what I'm about to write and hope I'm not
wasting your time.
For a class I'm teaching in archaeological data analysis, I'm trying
to put together a routine that calculates the so-called Petersen
index and, especially, confidence intervals for the index. This was
introduced to archaeologists by N.R.J. Fieller and A. Turner in an
article
1998 Apr 03
1
R-beta: Bug in dhyper (and phyper) (fwd)
Last night I sent the bug report below to r-help. I have since then looked
at dhyper.c and found:
if (NR < 0 || NB < 0 || n <= 0 || n > N)
DOMAIN_ERROR;
I changed 'n <= 0' to 'n < 0' and then dhyper worked as I wanted. Am I
introducing some potentially dangerous behaviour by this change?
Goran
2004 Apr 15
0
phyper accuracy and efficiency (PR#6772)
Full_Name: Morten Welinder
Version: snapshot
OS:
Submission from: (NULL) (65.213.85.218)
Time to kick phyper's tires...
The current version has very serious cancellation issues. For example, if you
ask
for a small right-tail you are likely to get total cancellation. For example
phyper(59, 150, 150, 60, FALSE, FALSE) gives 6.372680161e-14. The right answer
is
dhyper(0, 150, 150, 60,
2012 Oct 01
1
Retrieve hypergeometric results in large scale
I'm going to use
dhyper(x, m, n, k)
to get a 95% coverage. Let me use an example to explain my problem:
Suppose I have a urn containing 90 red and 10 black balls.
Now I wanna remove 3 from the urn. By the following codes:
m<-90;n<-10;k<-3;
x<-0:3
dhyper(x,m,n,k)
I can obtain the probability that 0,1,2,3 red balls will be removed.
0.000742115 0.025046382 0.247680891
2009 Oct 16
1
How odds ratio is computed in fisher.test()?
I'm wondering how odds ratio is computed. I thought that it is
(n11/n12)/(n21/n22), but it is not what fisher.test() computes. Could
somebody let me know?
> n11=3
> n12=1
> n21=1
> n22=3
>
> n1_=n11+n12
> n2_=n21+n22
>
> n_1=n11+n21
> n_2=n12+n22
>
> x=rbind(c(n11,n12),c(n21,n22))
>
> threshold=dhyper(n11,n1_,n2_,n_1)
>
2003 Oct 01
1
hypergeometric & population estimates
"help"
We want to estimate the number of caribou in Jasper. We recently conducted
an aerial survey and saw 70 uncollared caribou and 8 of 11 collared
caribou. We want to estimate the number of caribou in this population with
95% confidence limits. Gary White uses the hypergeometric distribution and
determines the population estimates using maximum likelihood and 95%CL as
2017 Aug 25
0
Are r2dtable and C_r2dtable behaving correctly?
> On 25 Aug 2017, at 11:23 , Jari Oksanen <jari.oksanen at oulu.fi> wrote:
>
> It is not about "really arge total number of observations", but:
>
> set.seed(4711);tabs <- r2dtable(1e6, c(2, 2), c(2, 2)); A11 <- vapply(tabs, function(x) x[1, 1], numeric(1));table(A11)
>
> A11
> 0 1 2
> 166483 666853 166664
>
> There are
1998 Feb 23
0
R-beta: Hypergeometric Probabilities
In both versions of R to which I currently have access (R-0.16.1 and
R-0.61.1), "phyper" stops returning correct cumulative probabilities as the
parameters of the hypergeometric distribution get large. For example, when
N1=1345, N2=1055, and n=1330, phyper returns either 0 or 1, and nothing in
between.
Looking at phyper.c, it's clear what's happening. First a term (called
2008 Aug 21
1
pnmath compilation failure; dylib issue?
(1) ...need to speed up a monte-carlo sampling...any suggestions about
how I can get R to use all 8 cores of a mac pro would be most useful
and very appreciated...
(2) spent the last few hours trying to get pnmath to compile under os-
x 10.5.4...
using gcc version 4.2.1 (Apple Inc. build 5553) as downloaded from
CRAN, xcode 3.0...
...xcode 3.1 installed over top of above after
2008 Dec 03
1
hypergeometric
Hi,
I hope somebody can help me on how to use the hypergeometric function.
I did read through the R documentation on hypergeometric but not really
sure what it means.
I would like to evaluate the hypergeometric function as follows:
F((2*alpha+1)/2, (2*alpha+2)/2 , alpha+1/2, betasq/etasq).
I'm not sure which function should be used- either phyper or qhyper or
dhyper
Where
2003 Nov 14
2
Round error?
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
2004 Sep 30
1
Vectorising and loop (was Re: optim "a log-likelihood function")
>From: Sundar Dorai-Raj <sundar.dorai-raj at PDF.COM>
>Reply-To: sundar.dorai-raj at PDF.COM
>To: Zhen Pang <nusbj at hotmail.com>
>CC: r-help at stat.math.ethz.ch
>Subject: Vectorising and loop (was Re: [R] optim "a log-likelihood
>function")
>Date: Wed, 29 Sep 2004 18:21:17 -0700
>
>
>
>Zhen Pang wrote:
>
>>
>>I also use
2009 Dec 15
3
RFC: lchoose() vs lfactorial() etc
lgamma(x) and lfactorial(x) are defined to return
ln|Gamma(x)| {= log(abs(gamma(x)))} or ln|Gamma(x+1)| respectively.
Unfortunately, we haven't chosen the analogous definition for
lchoose().
So, currently
> lchoose(1/2, 1:10)
[1] -0.6931472 -2.0794415 NaN -3.2425924 NaN -3.8869494
[7] NaN -4.3357508 NaN -4.6805913
Warning message:
In
2017 Aug 25
1
Are r2dtable and C_r2dtable behaving correctly?
> On 25 Aug 2017, at 10:30 , Martin Maechler <maechler at stat.math.ethz.ch> wrote:
>
[...]
> https://stackoverflow.com/questions/37309276/r-r2dtable-contingency-tables-are-too-concentrated
>
>
>> set.seed(1); system.time(tabs <- r2dtable(1e6, c(100, 100), c(100, 100))); A11 <- vapply(tabs, function(x) x[1, 1], numeric(1))
> user system elapsed
>
2002 Aug 05
2
options(digits) (PR#1879)
[this message needed manual improvement by the mailing list
administrator since it was `HTMLified' .. ``please do not'']
Apologies for bothering you about a fairly trivial matter. I have been
getting some inconsistencies with the display digits in R V1.5. I have been
using the hypergeometric distribution function, and have found that when
printing out the results from this
2011 Feb 11
3
How can we make a vector call a function element-wise efficiently?
Hello
I have a time-comsuming program which need to simplify, I have tested the annotated program as follow:
> #define function which will be call
> calsta <- function(c, n=100000)
+ {
+ i <- seq(from=0, length=c)
+ logx <- lchoose(NT-n, CT-i) + lchoose(n, i)
+ logmax <- max(logx)
+ logmax + log(sum(exp(logx - logmax)))
+ }
> CT=6000 #assignment to CT
>
2000 Dec 13
0
choose(n, k) for k>n: An inconsistency?
It took me by surprise to find that choose(4,5) delivers
[1] NaN
Warning message:
NaNs produced in: choose(n, k)
If we look at choose(4,5) as the number of ways of choosing
5 objects from 4 I would have expected 0 as result.
Furthermore dhyper(5,4,6,5) does deliver 0 and this essentially
equivalent to choose(4,5)*choose(6,0)/choose(10,5).
2011 Feb 12
1
how to improve the precison of this calculation?
Hello
T
I want to order some calculation "result", there will be lots of "result" that need to calculate and order
PS: the "result" is just a intermediate varible and ordering them is the very aim
# problem:
# For fixed NT and CT, and some pair (c,n). order the pair by corresponding result
# c and n are both random variable
CT<-6000 #assignment to CT
1997 Dec 13
1
R-beta: Compile error; R-0.60.1, Solaris 2.6, gcc 2.7.2.1
Hi!
I have just downloaded the R-0.60.1 sources and have problems compiling R
on a Sun Ultra 1 running Solaris 2.6 and gcc 2.7.2.1.
I have not been able to find to find any compiling hints in the
documentation or the FAQ.
After ./configure I use make and get the output below.
Any hints are welcome.
I am not on the list, so please answer me directly too.
Best regards
Jens
---
Jens Lund