LMModelMatrix: Creating the model matrix

Description Usage Arguments Details Value References See Also Examples

View source: R/LMModelMatrix.R

Description

Create the specific model matrix from the design for the ASCA-GLM method.

Usage

1

Arguments

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.

Details

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.

Value

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.

References

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

See Also

model.matrix

More informations about the specific encoding is available in the article from (Thiel et al, 2017)

Examples

1
2
3
4
5
data('UCH')

ResLMModelMatrix <- LMModelMatrix(as.formula(UCH$formula),UCH$design)

head(ResLMModelMatrix$ModelMatrix)

FranceschiniS/LMWiRe documentation built on Oct. 30, 2019, 6:20 p.m.