Specifying Linear Models for SAS Viya Analytical Actions

Models with Regression and Classification Predictors

For certain simple but common linear models, all you need to know in order to operate the SAS Viya analytical actions is how to specify lists of variables for the depVar and effects parameters. Each row in Table 1 demonstrates this for common types of linear models.

Table 1: Simple Regression Models

Simple linear regression
SAS code:
model y = x;
Action specification:
model={ depVar='y', effect='x' }
Multiple linear regression
SAS code:
model y = x1-x9;
Action specification:
model={ depVar='y', effects={'x1','x2','x3',
                             'x4','x5','x6',
                             'x7','x8','x9'} }

Or you can use a regular expression for the predictors:

model={ depVar='y', effects='/^x/' }
Multiple linear regression with classification predictors
SAS code:
class c:;
model y = x: c:;
Action specification:

Only the regular expression syntax is shown here:

class='/^c/',
model={ depVar='y', effects={'/^x/', '/^c/'} }


Using regular expressions to specify lists of predictor names, as in the two multiple linear regression examples in Table 1, enables you to quickly and succinctly specify very large lists of predictors. Thus, regular expressions are often useful for data mining applications of linear models, including predictive modeling, high-dimensional data analysis, and model selection.

The simple models in Table 1 exhibit the two main types of predictor variables:

  • continuous predictors, which must be numeric and for which any corresponding model effects are algebraic functions of its quantitative values

  • classification predictors, which can be either numeric or character, and on which the corresponding model effects depend qualitatively. You use the class parameter to declare the classification predictors.

The syntax for these simple models exploits several important conveniences of SAS Viya analytical action syntax:

  1. You can omit the braces from singleton lists.

  2. Parameter lists have designated parameters whose names can be dropped, along with the enclosing braces, if they are the only parameter in the list.

These shortcuts enable you to replace the more formal and verbose way to specify a simple linear model with a simpler specification. Consider the following verbose specification:

   model={depVar ={{name='y'}},
          effects={{vars={'x'}}}}

You can replace the preceding specification by the following simpler specification:

   model={ depVar='y', effects='x' }

Table 2 shows some examples of how to specify two more simple linear models that are familiar in statistical applications, although less familiar in data mining and predictive modeling.

Table 2: Simple Statistical Models

One-way analysis of variance
SAS code:
class a;
model y = a;
Action specification:
class='a',
model={ depVar='y', effect='a' }
Analysis of covariance, equal slopes
SAS code:
class a;
model y = a x;
Action specification:
class='a',
model={depVar='y', effects={'a','x'} }


Last updated: March 05, 2026