1 | johan(cmat, vmean, vsqse, h, alpha = 0.05)
|
cmat |
|
vmean |
|
vsqse |
|
h |
|
alpha |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ##---- 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 (cmat, vmean, vsqse, h, alpha = 0.05)
{
yvec <- matrix(vmean, length(vmean), 1)
if (!is.matrix(vsqse))
vsqse <- diag(vsqse)
test <- cmat %*% vsqse %*% t(cmat)
invc <- solve(test)
test <- t(yvec) %*% t(cmat) %*% invc %*% cmat %*% yvec
R <- vsqse %*% t(cmat) %*% invc %*% cmat
A <- sum(diag((diag(R))^2/diag(h - 1)))
df <- nrow(cmat)
crit <- qchisq(1 - alpha, df)
crit <- crit + (crit/(2 * df)) * A * (1 + 3 * crit/(df +
2))
list(teststat = test[1], crit = crit[1], df = df)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.