GLZ Syntax - Example 1: Multiple Regression with Categorical Predictors

This example illustrates the specification for a simple multiple regression problem with a single dependent variable, and categorical and continuous predictors (ANCOVA design). Note that 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

   no codes (values) are specified, so the program will by default

   take all grouping codes (e.g., 'Male', 'Female') found in the

   data file. }

   GROUPS = GROUP

            GENDER;

{ 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+

             GROUP | GENDER;

For more examples, see GLZ Syntax Examples.