Description Usage Arguments Details Value References See Also Examples
View source: R/LMModelMatrix.R
Create the specific model matrix from the design for the ASCA-GLM method.
1 | LMModelMatrix(formula, design)
|
formula |
The p terms formula of the GLM used to predict the response variables.Variable must be character |
design |
The nxk "free encoded" experimental design data frame. Variables must be factors. |
In typical ASCA-glm analysis, the GLM model need 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 colums with 0 and 1 for a-1 first levels and -1 for the last. K is the sum of all the columns for every parameters.
A list with the 3 following named elements :
formula
A formula
object with the expression of the GLM used to predict the outcomes.
design
A nxk data frame with the "free encoded" experimental design.
ModelMatrix
A nxK model matrix specifically encoded for the ASCA-GLM method.
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
More informations about the specific encoding is available in the article from (Thiel et al, 2017)
1 2 3 4 5 | data('UCH')
ResLMModelMatrix <- LMModelMatrix(as.formula(UCH$formula),UCH$design)
head(ResLMModelMatrix$ModelMatrix)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.