Re: [Rd] inaccuracy in qbinom with partial argument matching

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri, 29 Jun 2007 07:03:32 +0100 (BST)

On Thu, 28 Jun 2007, Peter Ruckdeschel wrote:

> Hi,
>
> I found the following strange effect with
> qbinom & partial argument matching
>
> p0 <- pbinom(0, size = 3, prob = 0.25)
> qbinom(p0, size = 3, prob = 0.25) ## 0 o.k.
> qbinom(p0-0.05, size = 3, prob = 0.25) ## 0 o.k.
>
> ## positional matching:
> qbinom(p0, 3, 0.25) ## 0 o.k.
>
> ## partial argument matching:
> qbinom(p0 , s = 3, p = 0.25) ## 1 ???
> qbinom(p0-0.05, s = 3, p = 0.25) ## 1 ???
> qbinom(p0-0.06, s = 3, p = 0.25) ## 0 o.K.
>
> Unfortunately I have no I idea how to fix this.

You use a call that specifies your intentions accurately. This is not 'partial argument matching': 'p' is an exact match to the first argument of

> args(qbinom)

function (p, size, prob, lower.tail = TRUE, log.p = FALSE)

and that is how argument matching in R is documented to work.

The 'inaccuracy' is in the diagnosis: please see the FAQ.

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Fri 29 Jun 2007 - 06:07:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 29 Jun 2007 - 10:35:44 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.