bin1samp_power | R Documentation |
Determines the power and significance level for a one-sided, one-sample exact binomial test.
bin1samp_power
accepts a single value or vector for n
and/or
r
and will return a matrix with results for each combination. If
only one value is given for each, a vector is returned.
bin1samp_power(p0, pa, n, r)
bin1samp_sim(p0, pa, n, r = seq.int(n), plot = TRUE)
p0 , pa |
probability of success under the null and alternative hypotheses, respectively |
n |
sample size, a single value or vector |
r |
a vector of critical values, typically the minimum number of
successes required to reject |
plot |
logical; if |
bin1samp_power
returns a vector or matrix with the following:
type1 |
the overall type-I error |
type2 |
the overall type-II error |
bin1samp_sim
returns a data frame with the following columns:
r |
critical values |
type1 |
the overall type-I errors |
type2 |
the overall type-II errors |
twostg_power
; twostg_sim
p0 <- 0.1
pa <- 0.3
des <- desmon2:::bin1samp(p0, pa)
bin1samp_power(p0, pa, des['n'], des['r'] + 1)
## compare
des[c('size', 'type2')]
bin1samp_power(p0, pa, des['n'], des['r'] + -2:2)
bin1samp_power(p0, pa, des['n'] + 0:1, des['r'] + -2:2)
## simulate over critical values
bin1samp_sim(p0, pa, des['n'])
des <- desmon2:::bin1samp(pa, p0)
bin1samp_power(pa, p0, des['n'], des['r'])
## compare
des[c('size', 'type2')]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.