1 |
x |
|
y |
|
alpha |
|
AC |
|
SD |
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 | ##---- 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 (x, y = NULL, alpha = 0.05, AC = TRUE, SD = FALSE)
{
if (is.null(y[1])) {
if (ncol(as.matrix(x)) != 2)
stop("y is null so x should be a matrix or data frame with two columns")
if (is.matrix(x) || is.data.frame(x))
dif <- x[, 1] - x[, 2]
if (is.list(x))
dif <- x[[1]] - x[[2]]
}
if (!is.null(y[1]))
dif <- x - y
dif = elimna(dif)
n <- length(dif)
dif <- dif[dif != 0]
flag <- (dif < 0)
if (!AC)
temp <- binomcipv(y = flag, alpha = alpha)
if (AC)
temp <- acbinomcipv(y = flag, alpha = alpha)
if (SD)
temp = binomLCO(y = flag, alpha = alpha)
list(Prob_x_less_than_y = temp$phat, ci = temp$ci, n = n,
N = length(flag), p.value = temp$p.value)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.