GDA Syntax - Example 2: Stepwise Discriminant Analysis with Categorical Predictors

This example illustrates the specification for a stepwise discriminant analysis problem with continuous and categorical predictors. When categorical predictor variables or effects have more than a single degree of freedom, the stepwise and best-subset procedures in STATISTICA GDA ensure that the coded (sigma-restricted) variables representing the categorical predictors are moved in or out of the model as a block (so that always complete multi-degree of freedom effects are included or excluded from the final model). However, refer to the Note of caution for models with categorical predictors, and other advanced techniques in the Introductory Overview to learn about the possible limitations of including categorical predictors in discriminant analysis problems.

Note: brief descriptive comments are enclosed in curly brackets. You can run this example with the example data file Boston2.sta.

GDA;

{ Dependent variable: }

DEPENDENT = PRICE (1 2 3);

{ Specification of grouping variable (factors); note that optional grouping codes (values) are specified to identify the (selected) groups in the categorical predictor. }

GROUPS = CAT1(0 1);

{ Specification of continuous predictor variables (covariates) }

COVARIATE = ORD1 ORD2 ORD3 ORD4 ORD5 ORD6 ORD7 ORD8 ORD9 ORD10 ORD11 ORD12;
DESIGN = ORD1 + ORD2 + ORD3 + ORD4 + ORD5 + ORD6 + ORD7 + ORD8 + ORD9 + ORD10 + ORD11 + ORD12 + CAT1;

{ Forward stepwise selection of predictors is requested as the model building method. }

MBUILD = FSTEPWISE;

{ The maximum number of steps is 10. }

MAXSTEP = 100;

{ p to enter is 0.05. }

P1ENTER = .05;

{ p to remove is 0.05. }

P2REMOVE = .05;

See also, Example 1: Simple Standard Discriminant Analysis.