GRM Syntax - Example 2: Stepwise Multiple Regression with Categorical Predictors
This example illustrates the specification for a stepwise multiple regression problem with a single dependent variable 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 GRM 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).
GSR;
{ Dependent variable (list): }
DEPENDENT = 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 GRM Syntax - Examples.