View source: R/DEPRECATED_mmer.R
| csr | R Documentation |
mmer and vsrCombines a design/incidence representation with a user-supplied covariance-component constraint matrix for use by the mmer covariance-model interface, typically inside vsr.
csr(x, mm)
x |
A factor, character vector, numeric vector, or design/incidence matrix defining the covariance dimension. Factor and character inputs are expanded to incidence columns. A matrix is used directly. |
mm |
A square covariance-component constraint matrix. Its dimensions must correspond to the columns of the design matrix generated from |
csr() provides the general constraint-matrix interface underlying custom covariance patterns for mmer/vsr. Unlike dsr and usr, it does not construct a predefined diagonal or unstructured pattern. Instead, the supplied matrix mm determines the covariance-component structure through thetaC.
Conceptually, thetaC identifies which elements of the covariance matrix are associated with estimated variance-covariance components and which constraints are shared among elements. The interpretation of the entries therefore follows the thetaC convention used by vsr.
When x is a matrix it is used directly as Z. Otherwise, factors and character vectors are converted to incidence matrices, while numeric non-factor inputs are treated as a single design column.
The function assigns the column names of Z to both dimensions of mm; therefore mm should be conformable with the number of columns of the resulting design matrix.
A list with components:
Z: the design/incidence matrix associated with the covariance dimension.
thetaC: the user-supplied covariance-component constraint matrix, with dimensions named according to Z.
vsr, dsr, usr, atr,
mmer
# A custom two-level covariance-component pattern
x <- factor(c("A","B","A","B"))
mm <- matrix(c(1, 2,
2, 1), 2, 2, byrow = TRUE)
C <- csr(x, mm)
C$Z
C$thetaC
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.