# [R] binom.test inside ctest

gb gb at stat.umu.se
Tue Sep 12 11:16:35 CEST 2000

```Bendix,

that's what I meant. There are in fact _two_ border points, when
you look at the two-sided test, 35 and 65. I thougt of taking half
of each point, but expressed it in a sloppy way.

The perhaps more interesting thing to discuss is whether this is
a reasonable thing to do or not. Would the one-sided analogue to add
half of the probability of the only border point to the p-value
be equally reasonable? What do the experts say? References?

Göran

On Tue, 12 Sep 2000, BXC (Bendix Carstensen) wrote:

>
> > -----Original Message-----
> > From: gb [mailto:gb at stat.umu.se]
> > Sent: 12. september 2000 08:40
> > To: Mai Zhou
> > Cc: r-help at stat.math.ethz.ch
> > Subject: Re: [R] binom.test inside ctest
> >
> >
> > Mai,
> >
> > it seems as if binom.test only adds half the probability of
> > of the border point 65 to the p-value. If you try
> >
> > > (1-pbinom(64, 100, p = 0.5)) + pbinom(34, 100, p=0.5)
> > [1] 0.002653786
> >
> > you get the same result as binom.test.
>
> Göran,
>
> Rather, it adds the border point only once:
> I think the general idea is:
>
> > db <- dbinom(0:100,100,p=0.5)
> > obs.p <- dbinom(65,100,p=0.5)
> > sum(db[db<obs.p])+obs.p
> [1] 0.002653786
>
> Bendix
> >
> >
> > Göran
> >
> > On Tue, 12 Sep 2000, Mai Zhou wrote:
> >
> > > I got
> > >
> > > binom.test(65, 100, p=0.5)
> > >
> > >
> > > p-value = 0.002654
> > >
> > > I thought in this case (when p=0.5 so a symmetric distribution)
> > > we should get
> > >
> > > p-value = 2*( 1-pbinom(64, 100, p=0.5) ) = 0.003517642
> > >
> > > Can somebody explain why the difference?
> > >
> > > Thanks.
> > >
> > > Mai Zhou
> > >
> > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
> > -.-.-.-.-.-.-.-.-
> > > r-help mailing list -- Read
> > http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> > > Send "info", "help", or "[un]subscribe"
> > > (in the "body", not the subject !)  To:
> > r-help-request at stat.math.ethz.ch
> > >
> > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
> > _._._._._._._._._
> > >
> >
> > --
> >  Göran Broström                      tel: +46 90 786 5223
> >  Department of Statistics            fax: +46 90 786 6614
> >  Umeå University
> >  SE-90187 Umeå, Sweden             e-mail: gb at stat.umu.se
> >
>
> ----------------------
> Bendix Carstensen
> Senior Statistician
> Steno Diabetes Centre
> Niels Steensens Vej 2
> DK-2820 Gentofte
> Denmark
> tel: +45 44 43 87 38
> mob: +45 28 25 87 38
> fax: +45 44 43 73 13
> bxc at novo.dk
> www.biostat.ku.dk/~bxc
> ----------------------
>
>

--
Göran Broström, professor           tel: +46 90 786 5223
Department of Statistics            fax: +46 90 786 6614
Umeå University
SE-90187 Umeå, Sweden             e-mail: gb at stat.umu.se

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

```