Learn R Programming

jmuOutlier (version 2.2)

power.binom.test: Power Calculations for Exact Binomial Test

Description

Compute the power of the binomial test of a simple null hypothesis about a population median.

Usage

power.binom.test(n, alpha = 0.05, alternative = c("two.sided", "less", "greater"), 
                 null.median, alt.pdist, ...)

Arguments

n

The sample size.

alpha

Probability of Type I error.

alternative

A character string specifying the alternative hypothesis, and must be one of "two.sided" (default), "greater" or "less". Only the initial letter needs to be specified.

null.median

The population median under the null hypothesis.

alt.pdist

Name of the cumulative distribution function under the alternative distribution. Some options include pnorm, pexp, pcauchy, plaplace, pt, pchisq, pf, ptriang, punif, pbinom, pgeom, ppois.

Optional arguments to alt.pdist, excluding the first argument of alt.pdist. See the examples below.

Value

Power of the test.

References

Higgins, J. J. (2004) Introduction to Modern Nonparametric Statistics.

See Also

power.t.test

Examples

Run this code
# NOT RUN {
# Alternative distribution is Normal( mean=55.7, sd=2.5 ).
power.binom.test( 30, 0.05, "greater", 55, pnorm, 55.7, 2.5 )

# Alternative distribution is Laplace( mean=55.7, sd=2.5 ).
power.binom.test( 30, 0.05, "greater", 55, plaplace, 55.7, 2.5 )
# }

Run the code above in your browser using DataLab