is an option for statistical functions such as LinearModelFit that specifies which variables should be treated as having discrete values specified by names.


  • Possible settings for NominalVariables include:
  • Automaticautomaticaly detect nominal variables
    Alltreat all variables as nominal
    Nonetreat no variables as nominal
    {v1,v2,}treat the variables vi as nominal
  • When NominalVariables->Automatic, different methods are used to detect nominal variables. In functions returning FittedModel[], variables with non-numeric data values are treated 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 v==si.


open allclose all

Basic Examples  (1)

Define some data:

Fit the data, treating the first variable as a nominal variable:

See the functional form:

Treat all variables as nominal:

Scope  (2)

Automatically select nominal variables:

Specify nominal variables in GeneralizedLinearModelFit:

With LogitModelFit:

With ProbitModelFit:

Applications  (3)

Fit a oneway ANOVA model:

Obtain the ANOVA table:

Compute the model estimates for the three groups:

Fit a twoway 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:

Wolfram Research (2008), NominalVariables, Wolfram Language function, (updated 2014).


Wolfram Research (2008), NominalVariables, Wolfram Language function, (updated 2014).


Wolfram Language. 2008. "NominalVariables." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014.


Wolfram Language. (2008). NominalVariables. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2022_nominalvariables, author="Wolfram Research", title="{NominalVariables}", year="2014", howpublished="\url{}", note=[Accessed: 02-December-2022 ]}


@online{reference.wolfram_2022_nominalvariables, organization={Wolfram Research}, title={NominalVariables}, year={2014}, url={}, note=[Accessed: 02-December-2022 ]}