apc | R Documentation |
This function takes a matrix where each line defines a linear function of the parameters to estimate a marginal mean (aka least squares mean) and return the matrix that define the contrasts among these means. All pairwise contrasts are returned (aka Tukey contrasts). The matrix with these contrasts can be passed to glht::multcomp() to estimate them or used in explicit matricial calculus.
apc(lfm, lev = NULL)
lfm |
a k \times p matrix where each line defines a linear function to estimate a lsmean. In general, these matrices are obtained by using doBy::LSmatrix(). |
lev |
a character vector with length equals to the numbers of
lines of |
a K\times p matrix with the linear functions that define all pairwise contrasts. K is {k}\choose{2}.
Walmes Zeviani, walmes@ufpr.br.
doBy::LSmatrix().
X <- diag(3) rownames(X) apc(X) rownames(X) <- letters[nrow(X):1] apc(X) apc(X, lev = LETTERS[1:nrow(X)]) # Objects from doBy::LSmatrix() have an "grid" attribute. attr(X, "grid") <- data.frame(n = LETTERS[1:nrow(X)]) rownames(X) <- NULL apc(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.