Version: | 0.5-8 |
Date: | 2017-03-26 |
Title: | Uniformly Most Powerful Tests |
Author: | Charles J. Geyer <charlie@stat.umn.edu> and Glen D. Meeden <glen@stat.umn.edu> |
Maintainer: | Charles J. Geyer <charlie@stat.umn.edu> |
Depends: | R (≥ 3.0.2) |
Imports: | stats, graphics |
Description: | Does uniformly most powerful (UMP) and uniformly most powerful unbiased (UMPU) tests. At present only distribution implemented is binomial distribution. Also does fuzzy tests and confidence intervals (following Geyer and Meeden, 2005, <doi:10.1214/088342305000000340>) for the binomial distribution (one-tailed procedures based on UMP test and two-tailed procedures based on UMPU test). |
License: | MIT + file LICENSE |
URL: | http://www.stat.umn.edu/geyer/fuzz/ |
NeedsCompilation: | yes |
Packaged: | 2017-03-26 23:47:19 UTC; geyer |
Repository: | CRAN |
Date/Publication: | 2017-03-27 00:02:11 UTC |
Abstract Randomized P-value for the Binomial Distribution
Description
Calculate the abstract randomized P-value for the UMPU two-tailed test for the binomial distribution.
Usage
arpv.binom(x, n, p, plot = TRUE, ...)
Arguments
x |
binomial observations. |
n |
number of observations. |
p |
the success probability under the null hypothesis. |
plot |
if |
... |
additional arguments passed to |
Details
The first three arguments must be scalar. Evaluates the distribution function of the abstract randomized P-value for the UMPU two-tailed test for the binomial distribution, which is a continuous, piecewise linear function. Gives the knots.
Value
a list containing two components:
alpha |
significance level values at the knots. |
phi |
distribution function values at the knots. |
Examples
library(ump)
print(arpv.binom(10, 10, 0.7, plot = FALSE))
arpv.binom(10, 10, 0.7)
arpv.binom(10, 10, 0.7, df = FALSE)
Plot Abstract Randomized P-value
Description
Plot ether the distribution function or the probability density function of an abstract randomized P-value
Usage
arpv.plot(alpha, phi, df = TRUE, verticals = TRUE)
Arguments
alpha |
significance levels at which the density is discontinuous ("knots"). |
phi |
values of the distribution function at these knots. |
df |
if |
verticals |
if |
Value
none.
Examples
out <- arpv.binom(10, 10, 0.7)
arpv.plot(out$alpha, out$phi)
arpv.plot(out$alpha, out$phi, df = FALSE)
Abstract Randomized P-value for the Binomial Distribution
Description
Calculate the abstract randomized P-value for the UMPU two-tailed test for the binomial distribution.
Usage
fci.binom(x, n, alpha = 0.05, p = seq(0, 1, length = 10001), flat = 1 / 4)
Arguments
x |
binomial observation. |
n |
number of observations. |
alpha |
the significance level, one minus the coverage probability. |
p |
the vector of parameter values at which (the membership function of) the fuzzy confidence interval is evaluated. |
flat |
the amount of flat parts of the membership function shown, expressed as a fraction of the curved parts. |
Details
prints the core and support of the fuzzy confidence interval and makes one or two plots (as appropriate) showing the edges of the fuzzy interval.
Value
none
Examples
library(ump)
fci.binom(4, 10)
fci.binom(0, 10)
fci.binom(9, 10)
UMPU Test for the Binomial Distribution
Description
Calculate the uniformly most powerful unbiased (UMPU) two-tailed test for the binomial distribution.
Usage
umpu.binom(x, n, p, alpha, maxiter = 10, tol = 1e-9)
Arguments
x |
binomial observations. |
n |
number of observations. |
p |
the success probability under the null hypothesis. |
alpha |
the significance level. |
maxiter |
the maximum number of iterations allowed. |
tol |
tolerance used in testing floating point numbers. |
Details
At most one of x
, p
, and alpha
is allowed to be
a vector. Evaluates the critical function for the UMPU two-tailed
test for the binomial distribution, which satisfies the following
x <- seq(0, n) phix <- umpu.binom(x, n, p, alpha) px <- dbinom(x, n, p) sum(phix * px) == alpha sum(x * phix * px) == n * p * alpha
when p
is strictly between zero and one.
Value
a vector of values of the critical function.
Examples
library(ump)
umpu.binom(0:10, 10, 0.6, 0.1)