Model Fitting: Linear Regression

Part 1: Transform the Response Variable

The salary variable ranges from 67.5 to 2,460 (measured in thousands of dollars). Since the variation of salaries is much greater for the higher salaries, it is appropriate to apply a logarithmic transformation to the salaries before fitting the model. The following steps use the Variable Transformation Wizard to transform the salary variable. (This wizard is described in further detail in Chapter 32: Variable Transformations.)

  1. Open the Baseball data set.

  2. Select AnalysisVariable Transformation from the main menu.

    The Variable Transformation Wizard in Figure 21.1 appears.

  3. Select the log10(Y+a) transformation from the Transformations list.

    Figure 21.1: Selecting a Log10 Transformation

    Selecting a Log10 Transformation

  4. Click Next.

    The wizard displays the page shown in Figure 21.2.

    Figure 21.2: Selecting a Variable and Parameters

    Selecting a Variable and Parameters

  5. Scroll to the end of the variable list. Select the salary variable, and click Set Y.

    The parameter a is an offset that is useful if your variable contains nonpositive values. For these data, you can accept the default value of 0.

  6. Click Finish.

    Because there are missing values for the salary variable, a warning message appears (Figure 21.3) that informs you that the transformed values for these observations are set to missing values.

    Figure 21.3: A Warning Message

    A Warning Message

  7. Click OK to dismiss the warning message.

    SAS/IML Studio adds the new variable, Log10_salary, as the last variable in the data set.