binom.blaker.VHadj.acc: Blaker's binomial acceptability function with Vos-Hudson...

Description Usage Arguments Details Value Warning Author(s) Examples

Description

Calculates values of the Vos-Hudson adjusted acceptability function in a sequence of points (for, e.g., plotting purposes). The adjusted acceptability function may optionally be “unimodalized”, i.e. replaced with the smallest greater or equal unimodal function.

Usage

1
2
binom.blaker.VHadj.acc(x, n, p, type = c("orig", "unimod"),
      acc.tol = 1e-10, nmax=n+1000,int.eps=1e-12, ...)

Arguments

x

number of successes.

n

number of trials.

p

vector (length 1 allowed) of hypothesized binomial parameters (between 0 and 1). In case of more than one point, an increasing sequence required.

type

for type = "orig", Vos-Hudson adjustment applied to original acceptability function. For type = "unimod", smallest unimodal function greater or equal to the adjusted acceptability function.

acc.tol

numerical tolerance (relevant only for type = "unimod").

nmax

Pairs (y, m) of number of trials and number of successes are allowed to contribute to the Vos-Hudson adjustment for only m up to nmax. Warning is returned when greater numbers of trials are suspected to have influence.

int.eps

Maximum expected error of machine representation of integers calculated from reals via multiplication and division. (Used in order to round numbers correctly if they happen to be integer, e. g. ceiling(xx - int.eps) is calculated instead of ceiling(xx).)

...

additional arguments to be passed to binom.blaker.acc.single.p; in fact, just maxiter (see BlakerCI-internal).

Details

The relationship between the adjusted acceptability function and the adjusted confidence intervals (see binom.blaker.VHadj.limits) is the same as between the unadjusted acceptability function and confidence interval (see binom.blaker.acc, binom.blaker.limits): The confidence interval is the convex hull of the set of those points where the function exceeds 1 - confidence level.

Value

Vector of Vos-Hudson adjusted acceptability values (with or without unimodalization) in points of p.

Warning

(1) Comparing output of the function with that of binom.blaker.acc cannot answer positively the question whether the unadjusted and adjusted functions are identical on an interval (but, up to the numerical accuracy, in the points of p only).

(2) The Warning section of the binom.blaker.VHadj.limits documentation is relevant here, as well.

Author(s)

Jan Klaschka klaschka@cs.cas.cz

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
p <- seq(0,1,length=10001)
acc.adj <- binom.blaker.VHadj.acc(6,13,p)
acc <- binom.blaker.acc(6,13,p)

plot(p,acc.adj,type="l",col="red",ylab="acceptability"
  ,main=paste("Vos-Hudson adjustment of acceptability function"
  ,"for 6 successes in 13 trials"
  , sep="\n")
)
lines(p,acc,type="l")
legend(x=.7,y=.8,c("unadjusted","adjustment"),col=c("black","red"),lwd=1)

## Plot of differences between the unadjusted and adjusted
## acceptability functions reveals some adjustment details
## hardly visible in the previous graph. 

plot(p,acc.adj-acc,type="l",ylab="acceptability difference")

## The narrow peak near 0.215 is close to the 
## Blaker's lower 0.95 confidence limit.
## 
## Focussing on the neighbourhood of 0.215:

p <- seq(0.21,0.22,length=1001)
acc.adj <- binom.blaker.VHadj.acc(6,13,p)
acc <- binom.blaker.acc(6,13,p)

plot(p,acc.adj,type="l",col="red",ylab="acceptability"
  ,main=paste("A detail of Vos-Hudson adjustment of acceptability function"
  ,"for 6 successes in 13 trials"
  ,sep="\n")
  ,ylim=c(0.02,0.09)
)
lines(p,acc,type="l")
legend(x=.210,y=.08,c("unadjusted","adjustment"),col=c("black","red"),lwd=1)

## The above adjustment results from the fact that, though
## 15 > 13 and 7/15 > 6/13, the acceptability function
## for 7 successes in 15 trials is greater that that for 6 successes
## in 13 trials on a short interval:

acc.7.15 <- binom.blaker.acc(7,15,p)
plot(p,acc,type="l",ylab="acceptability"
  ,main=paste("A detail of acceptability functions"
  ,sep="\n")
  ,ylim=c(0.02,0.09)
)
lines(p,acc.7.15,type="l",col="green")
legend(x=.210,y=.08,c("6 / 13","7 / 15"),col=c("black","green")
  ,title="succ / trials",lwd=1)

## The adjustment shifts the point where the 0.05 level is exceeded,
## i. e. the Blaker's lower 0.95 confidence limit, from 0.2158 to 0.2150. 
## (Compare with Examples in binom.blaker.VHadj.limits section.)

BlakerCI documentation built on May 2, 2019, 2:38 a.m.