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:
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).