Alternative Method for Specifying GLM Designs in Macros (Automation)

When you record a particular GLM (or GRM, GDA, GLZ, GC&RT, GCHAID, etc.) analysis as a STATISTICA Visual Basic (SVB) Macro, you will see that, by default, all analyses are recorded via GLM syntax (or GRM, ...) . While this method of recording interactive GLM (GRM, ...) analyses yields a macro that will accurately reproduce analyses for even complex designs, it may be cumbersome to work with the syntax "model" when programming your own GLM (GRM, ...) procedures in SVB (e.g., by modifying a macro).

Therefore, as an alternative method for specifying standard designs in SVB programs (macros), you can use the usual method of specifying variable lists and codes, as implemented in most other analytic procedures (libraries) of STATISTICA. The specific available properties can be reviewed in the SVB Syntax Editor Object Browser dialog, after selecting the STAGLM  (STAGRM, etc.) analysis libraries, and the classes for the respective Specifications dialogs. For example, shown below are some of the properties available for specifying (in SVB programs) variables and other analysis parameters for GLM.

You can specify variable lists, factorial designs to a specified degree (via property FactorialDegree), repeated measures (within-subject) effects, random effects, and details for stepwise and best-subset selection of predictors. For example, a program for analyzing a repeated measures design with two repeated measures factors and two factors may look like this:

Sub Main

Dim newanalysis As Analysis

' Create GLM analysis.

Set newanalysis = Analysis ( scGLM, ActiveDataSet )

newanalysis.Run

' Specify variables:

'  "Dependent | Categorical factors | Continuous covariates".

newanalysis.Dialog.Variables = " 3-8 |  1 2 | "

' Specify repeated measures factors:

'  Rep1 with 3 levels, Rep2 with 2 levels

' There are 6 dependent variables that will be divided into

' the levels of the repeated measures factors).

newanalysis.Dialog.WithinEffects="Rep1 3  Rep2 2 "

' Factorial degree = 1; i.e., evaluate main effects for

' categorical factors only

newanalysis.Dialog.FactorialDegree= 1

newanalysis.Dialog.SigmaRestricted= True

newanalysis.Run

' Summary ANOVA table

newanalysis.Dialog.TestOfAllEffects.Visible = True

End Sub