1 |
x |
|
q |
|
nboot |
|
SEED |
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 32 33 34 35 36 37 38 39 40 | ##---- 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, q = c(0.1, 0.25, 0.5, 0.75, 0.9), nboot = 2000,
SEED = TRUE)
{
if (SEED)
set.seed(2)
if (is.matrix(x))
x <- listm(x)
if (length(x) != 4)
stop("Current version is for a 2-by-2 ANOVA only. Should have four groups.")
A = matrix(NA, nrow = length(q), 5)
B = matrix(NA, nrow = length(q), 5)
AB = matrix(NA, nrow = length(q), 5)
dimnames(A) = list(NULL, c("q", "psihat", "p.value", "ci.lower",
"ci.upper"))
dimnames(B) = list(NULL, c("q", "psihat", "p.value", "ci.lower",
"ci.upper"))
dimnames(AB) = list(NULL, c("q", "psihat", "p.value", "ci.lower",
"ci.upper"))
con = con2way(2, 2)
for (i in 1:length(q)) {
A[i, 1] = q[i]
B[i, 1] = q[i]
AB[i, 1] = q[i]
a = linconpb(x, nboot = nboot, est = hd, con = con$conA,
SEED = FALSE, q = q[i])
b = linconpb(x, nboot = nboot, est = hd, con = con$conB,
SEED = FALSE, q = q[i])
ab = linconpb(x, nboot = nboot, est = hd, con = con$conAB,
SEED = FALSE, q = q[i])
A[i, 2:5] = a$output[, c(2, 3, 5, 6)]
B[i, 2:5] = b$output[, c(2, 3, 5, 6)]
AB[i, 2:5] = ab$output[, c(2, 3, 5, 6)]
}
list(A = A, B = B, AB = AB)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.