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 |
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:
|
the overall type-I error |
|
the overall type-II error |
bin1samp_sim
returns a data frame with the following columns:
|
critical values |
|
the overall type-I errors |
|
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'] + 1L) ## 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'])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.