1 | Lc(fit, nam, ref = 1, verbose = 0)
|
fit |
|
nam |
|
ref |
|
verbose |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ##---- 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 (fit, nam, ref = 1, verbose = 0)
{
if (class(fit) != "lmer")
stop("only implemented for lmer")
L <- Lmu(fit, nam)
Lref <- L[ref, , drop = F]
index <- 1:nrow(L)
names(index) <- rownames(L)
refind <- index[ref]
if (length(refind) != 1)
stop(paste(ref, "does not refer to a single level"))
Lret <- L[-refind, ]
Lret <- Lret - cbind(rep(1, nrow(Lret))) %*% Lref
attr(Lret, "heading") <- paste("Comparisons with reference level:",
rownames(L)[refind])
Lret
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.