In this example you fit a linear regression model to predict the 1987 salaries of Major League Baseball players as a function
of several explanatory variables in the Baseball
data set.
The response variable is salary
. The example examines three explanatory variables: two measures of hitting performance and one measure of longevity. The
explanatory variables are described in the following list:
no_hits
, the number of hits in 1986
no_home
, the number of home runs in 1986
yr_major
, the number of years that the player had been in the major leagues as of 1987
The example has four major steps:
Apply a logarithmic transformation to the response variable.
Set name
to be the variables whose values are used to label observations.
Run the Linear Regression analysis.
Interpret the various plots that the analysis can produce.