GLZ Syntax - Example 3: Best Subset Regression with Multinomial Response

This example illustrates the best-subset regression facilities of Generalized Linear/Nonlinear Models and how they can be used in an analysis with a multinomial response variable (best subset multinomial logit regression). You can run the example shown below using the example data file Irisdat.sta, Multinomial distribution and Logit link in the Startup Panel.

GLZ;

{ Dependent or response variable; note that the codes for the categories

   for the multinomial response variable are specified in parentheses; if

   no codes are specified, the program will automatically use all distinct

   code values in the response variable.  }

   RESPONSE = IRISTYPE (1 2 3);

{ Specification of continuous predictor variables (covariates) }

   COVARIATE = SEPALLEN SEPALWID PETALLEN PETALWID;

{ A simple regression design is specified. }

   DESIGN = SEPALLEN + SEPALWID + PETALLEN + PETALWID;

{ Best-subset regression is requested as the model building method. }

   MBUILD = BESTSUBSET;

{ The Likelihood score statistic is used to determine the best subset of

   predictors. }

   BESTCRIT = SCORE;

{ Set the Convergence Criterion to 1E-3 for this example. }

   CONVERGE = 3;

For more examples, see GLZ Syntax Examples.