SWITCH directive
Adds terms to, or drops them from a linear, generalized linear, generalized additive or nonlinear model.
Options
Parameter
Description
SWITCH modifies the current regression model, which may be linear, generalized linear, generalized additive, standard curve or nonlinear. Terms in the specified formula are dropped from the current model if they are already there, or are added to it if they are not. It is best to give a TERMS statement before investigating sequences of models using SWITCH, in order to define a common set of units for the models to be explored. If no model is fitted after the TERMS statement, the current model is taken to be the null model.
If the current model contains a smoothed term (specified e.g. by SSPLINE or LOESS) which is included in the formula specified by the parameter of SWITCH with a different number of degrees of freedom (or with the smoothing parameter set), SWITCH will then refit the smoothed term.
The model fitted by SWITCH will include a constant term if the previous model included one, and will not include one if the previous model did not. You can, however, change this using the CONSTANT option.
The options of SWITCH are the same as those of the FIT directive, but with the extra NONLINEAR option which controls whether separate nonlinear parameters are fitted to different groups when fitting curves, as in FITCURVE.
Options: PRINT, NONLINEAR, CONSTANT, FACTORIAL, POOL, DENOMINATOR, NOMESSAGE, FPROBABILITY, TPROBABILITY, SELECTION.
Parameter: unnamed.
Action with
RESTRICT
If a TERMS statement was given before fitting the model, any restrictions on the variates or factors in the model will have been implemented then. So any restrictions on vectors involved in the model specified by SWITCH will be ignored. If no TERMS statement has been given and SWITCH introduces new terms into the model, restrictions on the variates or factors in these terms will be taken into account and may cause the units involved in the regression to be redefined.