Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Data Manipulation > Numerical Data > Statistical Model Analysis >
Mathematica > Data Manipulation > Statistics > Statistical Model Analysis >
Mathematica > Mathematics and Algorithms > Statistics > Statistical Model Analysis >

DesignMatrix

DesignMatrix[{{x_(11),x_(12),...,y_(1)},{x_(21),x_(22),...,y_(2)},...},{f_(1),f_(2),...},{x_(1),x_(2),...}]
constructs the design matrix for the linear model Beta0+Beta1 f1+Beta2 f2+....
  • DesignMatrix[{y1, y2, ...}, {f1, f2, ...}, x] assumes data of the form {{1, y1}, {2, y2}, ...}. »
  • With data in the form {{x_(11),x_(12),... ,y_(1)},{x_(21),x_(22),... ,y_(2)},...}, the number of coordinates xi1, xi2, ... should equal the number of variables xi.
  • The design matrix m is formed from the values of basis functions fi at data points in the form
IncludeConstantBasisTruewhether to include a constant basis function
NominalVariablesNonevariables considered as nominal or categorical
WorkingPrecisionAutomaticprecision used in internal computations
Design matrix for a linear model:
Add a quadratic term:
Leave out the constant term:
Design matrix with two predictor variables:
Include a product term:
Assume predictor values 1, 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:
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
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team