Specifying Linear Models for SAS Viya Analytical Actions

Introduction

Many SAS Viya analytical actions model the value of one designated variable (the dependent, response, or target variable) based on the values of other variables (the independent, covariate, or predictor variables, which are often called simply "the inputs"). A fundamental concept is that of a linear model, which is a sum of multiples of the predictors, where each constituent product consists of a known covariate part x Subscript i and an unknown parameter part beta Subscript i:

sigma-summation Underscript i Endscripts beta Subscript i Baseline x Subscript i

For some actions (such as regression.glm), this linear form models the expected response:

StartLayout 1st Row 1st Column upper E left-parenthesis y vertical-bar x right-parenthesis 2nd Column equals 3rd Column sigma-summation Underscript i Endscripts beta Subscript i Baseline x Subscript i EndLayout

For other actions, a linear model is used to model other characteristics of the response. For example, in logistic regression (performed with the regression.logistic action) you often use a linear model to model the logit of the conditional probability p equals upper P left-parenthesis y equals 1 vertical-bar x right-parenthesis of the response:

StartLayout 1st Row 1st Column log left-parenthesis p slash left-parenthesis 1 minus p right-parenthesis right-parenthesis 2nd Column equals 3rd Column sigma-summation Underscript i Endscripts beta Subscript i Baseline x Subscript i EndLayout

In contrast, for quantile regression (performed with the quantreg.quantreg action) you use a linear model to model the conditional quantile upper Q Subscript tau Baseline left-parenthesis y vertical-bar x right-parenthesis of the response:

StartLayout 1st Row 1st Column upper Q Subscript tau Baseline left-parenthesis y vertical-bar x right-parenthesis 2nd Column equals 3rd Column sigma-summation Underscript i Endscripts beta Subscript i Baseline x Subscript i EndLayout

Each action makes different additional assumptions about the response, such as assumptions about its distribution or the dependence structure of observed values. In all cases, the linear model is what relates the predictors to the response.

Some linear models are relatively simple. In fact, a very common one is called a "simple linear model" and consists of just one predictor, plus an intercept term:

StartLayout 1st Row 1st Column upper E left-parenthesis y vertical-bar x right-parenthesis 2nd Column equals 3rd Column beta 0 plus beta 1 x 1 EndLayout

However, you do not need to stop there. Depending on how the covariate parts of the model depend on the actual predictor values, you can define linear models of great versatility and utility. These covariate parts are called effects. Common effects include the following:

  • an effect directly proportional to a single predictor value

  • an effect that is an unspecified smooth function of a predictor value

  • a categorical effect of a predictor

  • a crossproduct effect of two or more predictors

  • a categorical effect of two or more predictors

The next section discusses common modeling concepts that use the linear model framework.

Last updated: March 05, 2026