ffFullMatrix: Full model matrix from a design matrix
Description
The function builds the full matrix with the constant term, main effects and
interactions from a design matrix.
Usage
ffFullMatrix(X, x, maxInt, blk = NULL)
Arguments
X
numeric matrix. Design matrix.
x
numeric vector. Design matrix entries to use to construct the full model matrix.
maxInt
numeric. Highest interaction order.
blk
numeric matrix. Each column correspond to a blocking factor.
Value
The function returns list with the following components:
Xamatrix
. Augmented matrix with columns for the constant terms,
blocking factors, main effects, second order interactions, ..., etc.
xnumeric vector. Design matrix X factor (column) numbers
used to build the complete model matrix.
maxIntnumeric. The highest interaction order.
nTermsnumeric vector. Contains the number of blocking factors,
main effects, 2nd order interaction effects, ..., etc.
Details
Columns x of matrix X are used for main effects. All
the 2, ..., maxInt order interaction are constructed.
The first columns of the final matrix correspond to the constant term (1's)
and block factors.