x2fx
Convert factor settings to a design matrix.
📝Syntax
D = x2fx(X, modelspec)
📄Description

x2fx creates a design matrix with a constant column and terms requested by the model specification.

💡Examples
Create common model matrices from factor settings.
X = [1 2; 3 4];
Dlinear = x2fx(X, 'linear')
Dquadratic = x2fx(X, 'quadratic')
Use an explicit model specification matrix.
X = [1 2; 3 4];
modelspec = [1 0; 0 2; 1 1];
D = x2fx(X, modelspec)
Used Functions
candgen rowexch cordexch
Edit this page on GitHub