BUILT-IN MATHEMATICA SYMBOL

# DesignMatrix

DesignMatrix[{{x11, x12, ..., y1}, {x21, x22, ..., y2}, ...}, {f1, f2, ...}, {x1, x2, ...}]
constructs the design matrix for the linear model .

## Details and OptionsDetails and Options

• DesignMatrix[{y1, y2, ...}, {f1, f2, ...}, x] assumes data of the form . »
• 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
• DesignMatrix takes the following options:
•  IncludeConstantBasis True whether to include a constant basis function NominalVariables None variables considered as nominal or categorical WorkingPrecision Automatic precision used in internal computations
• With the setting , the design matrix for a model of form is constructed. »

## ExamplesExamplesopen allclose all

### Basic Examples (3)Basic Examples (3)

Design matrix for a linear model:

 Out[1]=
 Out[2]//MatrixForm=

Add a quadratic term:

 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=

## See AlsoSee Also

New in 7
New to Mathematica? Find your learning path »
Have a question? Ask support »