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 >

NominalVariables

NominalVariables
is an option for fitting functions such as LinearModelFit which specifies which variables should be treated as having discrete values specified by names.
Automatictreat variables with non-numeric data values as nominal
Alltreat all variables as nominal
Nonetreat no variables as nominal
{v1,v2,...}treat the variables vi as nominal
  • In linear models, a nominal variable v with possible values s1, s2, ... is represented as a collection of variables with values 1 or 0 corresponding to each case vEqualsi.
Define some data:
Fit the data, treating the first variable as a nominal variable:
See the functional form:
Treat all variables as nominal:
Define some data:
In[1]:=
Click for copyable input
Fit the data, treating the first variable as a nominal variable:
In[2]:=
Click for copyable input
Out[2]=
See the functional form:
In[3]:=
Click for copyable input
Out[3]=
Treat all variables as nominal:
In[4]:=
Click for copyable input
Out[4]=
Automatically select nominal variables:
Specify nominal variables in GeneralizedLinearModelFit:
Fit a one-way ANOVA model:
Obtain the ANOVA table:
Compute the model estimates for the three groups:
Fit a two-way ANOVA model with interaction term:
Obtain the ANOVA table:
Compute estimates for each cell:
Results in a table:
Fit an ANCOVA model:
Visualize curves for the three x categories and label using Tooltip:
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team