This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# DesignMatrix

 DesignMatrixconstructs the design matrix for the linear model .
• With data in the form , the number of coordinates , , ... should equal the number of variables .
• The design matrix m is formed from the values of basis functions at data points in the form
 IncludeConstantBasis True whether to include a constant basis function NominalVariables None variables considered as nominal or categorical WorkingPrecision Automatic precision used in internal computations
Design matrix for a linear model:
Leave out the constant term:
Design matrix with two predictor variables:
Include a product term:
Assume predictor values , , ...:
Design matrix for a linear model:
 Out[1]=
 Out[2]//MatrixForm=
 Out[3]//MatrixForm=
Leave out the constant term:
 Out[4]//MatrixForm=

Design matrix with two predictor variables:
 Out[1]=
 Out[2]//MatrixForm=
Include a product term:
 Out[3]//MatrixForm=

Assume predictor values , , ...:
 Out[1]//MatrixForm=
 Scope   (2)
Use any numeric functions of the predictors:
Get the design matrix using exact arithmetic:
Use machine arithmetic:
Use arbitrary-precision arithmetic:
Use fixed 24-digit precision arithmetic:
 Options   (3)
A constant term is included by default:
Construct a design matrix without a constant term:
Treat x as a numeric variable:
Treat x as nominal:
Use nominal variables that are not numeric:
Treat only x as nominal:
Treat all predictors as nominal:
DesignMatrix constructs the design matrix used by LinearModelFit:
The matrix is the same for GeneralizedLinearModelFit:
New in 7