modelMatrix
ModelMatrix refers to the design matrix used in statistical modeling. It is a numeric matrix that encodes the terms of a model so estimation procedures can operate on predictor data. In many software environments, a function with a name like modelMatrix (or the closely related model.matrix in R) constructs this matrix from a model specification and a data set.
A design matrix is built from a model formula or specification and the data. It typically includes
The output is usually a numeric matrix with one row per observation and one column per encoded
While some environments expose a function named modelMatrix, the canonical implementation in R is model.matrix. The