Question: Please use Rstudio to solve this question. Data is available in the R package alr4 . Data package is avialable in the Rstudio. Use
Please use Rstudio to solve this question. Data is available in the R package "alr4". Data package is avialable in the Rstudio.
Use the data file salarygov from package alr4. (Run ?salarygov for a description of the data).
a. Examine the scatterplot of MaxSalary versus Score, and verify that simple regression provides a poor description of this figure.
b. Fit the regression with response MaxSalary and a quadratic polynomial for Score. Draw the fitted curves on a figure with the data and comment.
c. According to Minnesota statutes, and probably laws in other states as well, a job class is considered to be female dominated if 70% of the employees or more in the job class are female. These data were collected to examine whether female-dominated positions are compensated at a lower level, adjusting for Score, than are other positions. Make factor with two levels that divides the job classes into female dominated or not. Then, refit your model in part b. Summarize the results using an effects plot.
d. Test whether the interaction between the indicator for female-dominated occupations and Score (main effect) should be included. Obtain a 95% confidence interval for the difference between female-dominated job classes and all other job classes.
e. The data as given have as its unit of analysis the job class. In a study of the dependence of maximum salary on skill, one might prefer to have the employee as the unit of analysis. Explain why changing the unit of analysis to the employee rather than the job class would suggest using WLS. What are the relevant weights?
f. Repeat part d but use WLS. conclusions change?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
