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
Perhaps you should read
?dhyper
and if you have a hard time parsing that, then read
?Distributions
and then go back to
?dhyper
---
Jeff NewmillerThe . . Go Live...
Homework? There's a no homework policy on this list.
-- Bert
On Mon, Oct 1, 2012 at 8:10 AM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote:
Perhaps you should read
?dhyper
and if you have a hard time parsing that, then read
?Distributions
and then go back to
?dhyper
Thanks Jeff
The documentation pages, if I haven't missed any crucial points, illustrate
how to get probability and cumulative probability values.
I can first retrieve the data structures and use Perl (I don't know how to
use R...) to sort the derived ratios and sum the probability values until
Hi Bert. This is not a homework. If I can do some basic programming in R like
Perl, then I'll have a better chance to accomplish this task but the matrix
concept is not quickly comprehensible...
--
View this message in context:
If you have not already done so, stop what you are doing and work
through the Introduction to R tutorial that ships with R (or other R
tutorial on the web that you may prefer).
The tutorials are written to help you climb the R learning curve much
more efficiently than the fooling around that you
Thanks Jeff~~~
In fact I do not know how to combine and extract vectors in R.
ans-sort(dhyper(x, m, n, k),decreasing=TRUE)
rbind(ans,cumsum(ans)
will show the first point that exceeds 95% threshold. The problem is:
*information is lost*
I can no longer identify where are the first few elements
Hello,
See the differences.
k - 3
p - 0.95
m - 90; n - 10
dhyper(0:k, m, n, k) # Prob(X = x), with x = 0:k
phyper(0:k, m, n, k) # Prob(X = x)
# quantiles, what you want
qhyper(p, m, n, k) # inverse of phyper
m - 50; n - 50
dhyper(0:k, m, n, k)
phyper(0:k, m, n, k)
qhyper(p, m, n, k)
In
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf
Of jas4710
Sent: Monday, October 01, 2012 9:59 AM
To: r-help@r-project.org
Subject: Re: [R] Retrieve hypergeometric results in large scale
Thanks Jeff~~~
In fact I do not know
9 matches
Mail list logo