poisson.test from stats package does not pass the conf.level (PR#14195)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

poisson.test from stats package does not pass the conf.level (PR#14195)

Fay, Michael (NIH/NIAID) [E]
Hi,

The poisson.test function from stats package does not pass the conf.level p=
arameter for the two-sample test. Here is an example:

poisson.test(c(2,4),c(20,14),conf.level=3D.95)$conf.int
poisson.test(c(2,4),c(20,14),conf.level=3D.9)$conf.int


Here is the solution, change:

        RVAL <- binom.test(x, sum(x), r * T[1]/(r * T[1] + T[2]),
            alternative =3D alternative)

to:

        RVAL <- binom.test(x, sum(x), r * T[1]/(r * T[1] + T[2]),
            alternative =3D alternative, conf.level=3Dconf.level)



Mike

--please do not edit the information below--

Version:
 platform =3D i386-pc-mingw32
 arch =3D i386
 os =3D mingw32
 system =3D i386, mingw32
 status =3D
 major =3D 2
 minor =3D 10.1
 year =3D 2009
 month =3D 12
 day =3D 14
 svn rev =3D 50720
 language =3D R
 version.string =3D R version 2.10.1 (2009-12-14)

Windows XP (build 2600) Service Pack 2

Locale:
LC_COLLATE=3DEnglish_United States.1252;LC_CTYPE=3DEnglish_United States.12=
52;LC_MONETARY=3DEnglish_United States.1252;LC_NUMERIC=3DC;LC_TIME=3DEnglis=
h_United States.1252

Search Path:
 .GlobalEnv, package:stats, package:graphics, package:grDevices, package:ut=
ils, package:datasets, package:methods, Autoloads, package:base

******************************************************************
Michael P. Fay, PhD
Mathematical Statistician
National Institute of Allergy and Infectious Diseases
Tel: 301-451-5124               Fax:301-480-0912
(U.S. postal mail address)
6700B Rockledge Drive MSC 7609
Bethesda, MD 20892-7609
(Overnight mail address)
6700-A Rockledge Drive, Room 5133
Bethesda, MD 20817
http://www3.niaid.nih.gov/about/organization/dcr/BRB/staff/michael.htm
**********************************************************************
Disclaimer:
The information in this e-mail and any of its attachment...{{dropped:3}}

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: [Rd] poisson.test from stats package does not pass the conf.level (PR#14195)

Peter Dalgaard
[hidden email] wrote:

> Hi,
>
> The poisson.test function from stats package does not pass the conf.level p=
> arameter for the two-sample test. Here is an example:
>
> poisson.test(c(2,4),c(20,14),conf.level=3D.95)$conf.int
> poisson.test(c(2,4),c(20,14),conf.level=3D.9)$conf.int
>
>
> Here is the solution, change:
>
>         RVAL <- binom.test(x, sum(x), r * T[1]/(r * T[1] + T[2]),
>             alternative =3D alternative)
>
> to:
>
>         RVAL <- binom.test(x, sum(x), r * T[1]/(r * T[1] + T[2]),
>             alternative =3D alternative, conf.level=3Dconf.level)


Now fixed in 2.10.1 patched and R-devel. Thanks.

--
    O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - ([hidden email])              FAX: (+45) 35327907

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel