s-news
[Top] [All Lists]

Problem with qhyper() - more info

To: "S-News List" <s-news@lists.biostat.wustl.edu>
Subject: Problem with qhyper() - more info
From: John Fennick <jhf2@bellsouth.net>
Date: Thu, 21 Sep 2006 19:59:56 -0400
Sorry, in prior note neglected to mention, using Splus 7.1 under Win XP

Hi Group,

The function qhyper(p,m,n,k) should take vectors for arguments m and n.

In the example below a vector in the call to create c11 works fine, but two vectors or even one, in the call to
create c21 produces all -Inf. Even though any combination of single values from the two vectors produce
finite results.


                 ct <- 750       
                 c1 <- 1:(ct-1)

                 c11 <- qhyper( 0.92, c1, (1000-c1), 1000*0.92 )
                    # vector for 3rd arg.
                    # Produces vector c11 of real integers (not shown)
                 
                 c21 <- qhyper( 0.16, (ct-c1), (4000-p1), 4000*0.16)
                          # vectors for 3rd and 4th args.
                          # Produces vector c21 of all -Inf (not shown)
                          
                 # Now delineate 2nd and 3rd args. of c21
                          p1 <- (ct-c1); q1 <- (4000-p1)
                 # And call them individually
                          i <- 74            #  Or designation of any elements of p1, q1
                 c21.fixed <- qhyper( 0.16, p1[i], q1[i], 4000*0.16)
                          # Produces correct single result

What is wrong here?
Any suggestions?
john

John Fennick
jhf2@bellsouth.net
alt: j.fennick@ieee.org
Tel: 770 949-9132
7045 Fletcher Drive
Winston, GA 30187
USA

<Prev in Thread] Current Thread [Next in Thread>