1 | stepmcp(x, tr = 0.2, alpha = 0.05)
|
x |
|
tr |
|
alpha |
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 | ##---- 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, tr = 0.2, alpha = 0.05)
{
if (is.matrix(x) || is.data.frame(x))
x = listm(x)
J = length(x)
if (J < 3)
stop("For two groups only, use yuen")
if (J > 5)
stop("Currently limited to at most five groups")
com = modgen(J)
jp1 = J + 1
mout = matrix(NA, nrow = length(com), ncol = 3, dimnames = list(NULL,
c("Groups", "p-value", "p.crit")))
mout[, 3] = alpha
jm2 = J - 2
com = com[jp1:length(com)]
mout = mout[jp1:nrow(mout), ]
for (i in 1:length(com)) {
nmod = length(com[[i]]) - 1
temp = c(nmod:0)
mout[i, 1] = sum(com[[i]] * 10^temp)
temp = t1way(x[com[[i]]], tr = tr)$p.value
pnum = length(com[[i]])
pe = 1 - (1 - alpha)^(pnum/J)
if (length(com[[i]]) <= jm2)
mout[i, 3] = pe
mout[i, 2] = t1way(x[com[[i]]], tr = tr)$p.value
}
mout
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.