View source: R/lmwModelMatrix.R
lmwModelMatrix | R Documentation |
Creates the model matrix X
from the design matrix and the formula of the model.
lmwModelMatrix(lmwDataList)
lmwDataList |
A list containing the outcomes, the experimental design and the formula. |
In typical ASCA-GLM analysis, the GLM model needs the design to be re-encoded with the commonly used in industrial experimental design sum coding. The result is the model matrix. Suppose the design matrix is nxk with n observations and k factors. After the transformation, the model matrix will be nxK. For a parameter with a levels, the re-encoding is a-1 columns with 0 and 1 for the a-1 first levels and -1 for the last one. K is the sum of all the columns for every parameters.
A list with the 5 following named elements :
lmwDataList
The initial object: a list with outcomes, design and formula.
modelMatrix
A nxK model matrix specifically encoded for the ASCA-GLM method.
modelMatrixByEffect
A list of p model matrices for each model effect.
effectsNamesUnique
A character vector with the p names of the model effects, each repeated once.
effectsNamesAll
A character vector with the K names of the model effects ordered and repeated as the column names of the model matrix.
Thiel M.,Feraud B. and Govaerts B. (2017) ASCA+ and APCA+: Extensions of ASCA and APCA in the analysis of unbalanced multifactorial designs, Journal of Chemometrics
model.matrix
More information about the specific encoding is available in the article from (Thiel et al, 2017)
data('UCH') resLmwModelMatrix <- lmwModelMatrix(UCH) head(resLmwModelMatrix$modelMatrix)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.