Directions
* Complete the following in R. ALL work must be done in R.
* Submit a hard copy of your work, including code, on Monday before the final exam.
Use the file salary2.csv to answer the questions below. Recall, the columns:
Column 1: sl: The three month salary of the subject in dollars (Y ).
Column 2: yd: The number of years since the subject earned their highest degree (X1) (i.e., years of experience). Column 3: dg: The highest degree earned (doctorate, masters) of the subject (X2).
Column 4: sx: The gender of the subject (male, female) (X3)
Column 5: rk: The rank of the subject (assistant, associate, full) (X4)
Data Source: S. Weisberg (1985). Applied Linear Regression, Second Edition. New York: John Wiley and Sons.
(a) Fit the model which includes X1, X2, and all interaction terms. Report back the estimated regression function. (b) Fit a second-order polynomial between Y and X1, and report the estimated regression function.
(c) Test to see if the second-order term can be dropped from the model, using α = 0.01.
(d) Fit a third order polynomial between Y and X1, and report the estimated regression function.
(e) Test to see if the third-order term can be dropped from the model, using α = 0.01.
1