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. )
Open the Baseball data set.
Select Analysis Variable Transformation from the main menu.
The Variable Transformation wizard in Figure 21.1 appears.
Select the log10(Y+a) transformation from the Transformations list.
Click Next.
The wizard displays the page shown in Figure 21.2.
Scroll to the end of the variable list. Select the salary variable, and click Set Y.
The parameter is an offset that is useful if your variable contains nonpositive values. For these data, you can accept the default value of .
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.
Click OK to dismiss the warning message.
SAS/IML Studio adds the new variable, Log10_salary, as the last variable in the data set.
Copyright © SAS Institute, Inc. All Rights Reserved.