1 |
r1 |
|
n1 |
|
r2 |
|
n2 |
|
x |
|
y |
|
nullval |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ##---- 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, nullval = 0)
{
alph <- c(1:99)/100
for (i in 1:99) {
irem <- i
chkit <- bi2KMS(r1 = r1, n1 = n1, r2 = r2, n2 = n2, x = x,
y = x, alpha = alph[i])
if (chkit$ci[1] > nullval || chkit$ci[2] < nullval)
break
}
p.value <- irem/100
if (p.value <= 0.1) {
iup <- (irem + 1)/100
alph <- seq(0.001, iup, 0.001)
for (i in 1:length(alph)) {
p.value <- alph[i]
chkit <- bi2KMS(r1 = r1, n1 = n1, r2 = r2, n2 = n2,
x = x, y = x, alpha = alph[i])
if (chkit$ci[1] > nullval || chkit$ci[2] < nullval)
break
}
}
est = bi2KMS(r1 = r1, n1 = n1, r2 = r2, n2 = n2, x = x, y = y)
list(ci = est$ci, est.p1 = est$p1, est.p2 = est$p2, p.value = p.value)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.