Overview Formula
Many of the statistical functions in the previous chapters have the option of building formulas. Formulas are required for modeling and defining the response and explanatory variables as well as defining the structure of the model. For example, if you expect a curvilinear relationship between the response and explanatory variable you can specify the polynomial term in the formula. In S-PLUS there is a specific structure to the formulas, the main feature is the presence of a tilde ("~") which separates the listing of the response from the listing of the explanatory variables. Using the formula builders described in this chapter, you can construct a formula without knowing the details of the formula syntax of the S-PLUS language.
Use the Transformation dialog to manage the transformation of variables when building a formula. When the Transformation dialog is active, the model dialog which opened the formula dialog, and the formula dialog itself, are unavailable. After performing transformations, click OK and the new variable list is sent back to the Formula dialog, which becomes active once more.
Two formula builders are described in the following sections. Many of the statistical dialogs use formula builders with a slightly different range of options, however the options are present in the two builders described here.
Hint |
Refer to the Programmer's Guide for details of the syntax of formulas, should you need them, and to the Guide to Statistics for many examples of formulas used in a wide range of statistical models. |