Specifying Linear Models for SAS Viya Analytical Actions

Models with Constructed Effects

Classification effects are one way for you to define models that depend in complex ways on the values of the predictor variables. Other useful predictive relations require more complex specifications; for these you specify constructed effect parameters and use them in your model. There are four types of constructed effects:

collection

specifies a collection effect that defines one or more variables as a single effect that has multiple degrees of freedom. The variables in a collection are considered as a unit for estimation and inference.

multimember

specifies a multimember classification effect whose levels are determined by one or more classification variables.

polynomial

specifies a multivariate polynomial effect in the specified numeric variables.

spline

specifies a regression spline effect whose columns are univariate spline expansions of one or more variables. A spline expansion replaces the original variable with an expanded or larger set of new variables.

Constructed effect parameters consists of a name, a type, and the list of constituent variables, in addition to other subparameters, as shown in Table 4.

Table 4: Models with Constructed Effects

Spline smoothing
SAS code:
effect SmoothX = spline(x);
model y = SmoothX;
Action specification:
spline={{name='SmoothX', vars='x'}},
model={depVar='y', effects='SmoothX'}
Cubic polynomial
SAS code:
effect Func = poly(x1 x2 x3 / degree=3);
model y = Func;
Action specification:
polynomial={{name='Func', vars={'x1','x2','x3'}, degree=3}},
model={depVar='y', effects='Func'}
ANCOVA with splines
SAS code:
class a;
effect SmoothX = spline(x);
model y = a|SmoothX;
Action specification:
class='a',
spline={{name='SmoothX', vars='x'}},
model={depVar='y',
   effects={ {vars={'a', 'SmoothX'}, interact='BAR'} },
   }


The ANCOVA with splines example fits a different smooth spline model in the continuous predictor x for every value of the classification predictor a. It demonstrates that you can use effects that are constructed with an effects parameter in terms just as you would use a predictor variable. For more information about effects, see the section EFFECT Statement (SAS Visual Statistics: Procedures).

Last updated: March 05, 2026