1 |
r1 |
|
n1 |
|
r2 |
|
n2 |
|
x |
|
y |
|
alpha |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (r1 = sum(x), n1 = length(x), r2 = sum(y), n2 = length(y),
x = NA, y = NA, alpha = 0.05)
{
alph = seq(0.001, 0.999, 0.001)
for (i in 1:length(alph)) {
pv = alph[i]
chk = twobici(r1 = r1, n1 = n1, r2 = r2, n2 = n2, x = x,
y = y, alpha = alph[i])$ci
if (chk[1] > 0 && chk[2] > 0)
break
if (chk[1] < 0 && chk[2] < 0)
break
}
reg = twobici(r1 = r1, n1 = n1, r2 = r2, n2 = n2, x = x,
y = y, alpha = alpha)
list(p.value = pv, ci = reg$ci, p1 = reg$p1, p2 = reg$p2)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.