GLZ Syntax - Example 2: Stepwise Multiple Regression

This example illustrates the specification for a stepwise multiple regression problem with categorical predictors. When categorical predictor variables or effects have more than a single degree of freedom, the stepwise and best-subset procedures in STATISTICA GLZ ensure that the coded (only sigma-restricted parameterization is allowed in stepwise and best subsets regression) 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).

Note: Brief descriptive comments are enclosed in curly brackets. You can run this example with the example data file Exp.sta, Normal distribution and Identity link in the Startup Panel.

GLZ;

{ Dependent or response variable: }

   RESPONSE = STRESS_R;

{ Specification of grouping variables (factors); note that

  optional grouping codes (values) are specified to identify

  the (selected) groups in the categorical predictors. }

   GROUPS = GENDER ("MALE" "FEMALE")

            TIME   (1 2 3);

{ Specification of continuous predictor variables (covariates) }

   COVARIATE = CORRECT1 CORRECT2 CORRECT3;

{ Here the bar operator is used to construct the full factorial

  design for the categorical predictor variables; the bar operator

  will evaluate to all main effects and interactions

  between the grouping variables. }

   DESIGN   =  CORRECT1+CORRECT2+CORRECT3+

               GENDER | TIME;

{ Forward stepwise regression is requested as the model building

  method. }

   MBUILD   = FSTEPWISE;

{ The maximum number of steps is 10. }

   MAXSTEP  = 10;

{ p to enter is 0.10. }

   P1ENTER  = .10;

{ p to remove is 0.10. }

   P2REMOVE = .10;

For more examples, see GLZ Syntax Examples.