In: Statistics and Probability
Chris is undecided about whether to go back to school and get his master’s degree. He is trying to perform a cost-benefit analysis to determine whether the cost of attending the school of his choice will be outweighed by the increase in salary he will receive after he attains his degree. He does research and compiles data on annual salaries in the industry he currently works in (he has been working for 10 years), along with the years of experience for each employee and whether or not the employee has a master’s degree. Earning his master’s degree will require him to take out approximately $20,000 worth of student loans. He has decided that if the multiple regression model shows, with 95% confidence, that earning a master’s degree is significant in predicting annual salary, and the estimated increase in salary is at least $10,000, he will enroll in a degree program.
Salary ($) | Years of Experience | Master’s Degree |
37,620 | 23 | No |
67,180 | 26 | Yes |
31,280 | 16 | No |
20,500 | 3 | No |
75,120 | 27 | Yes |
59,820 | 24 | Yes |
40,180 | 16 | Yes |
81,360 | 31 | Yes |
36,080 | 20 | No |
36,080 | 11 | Yes |
36,680 | 23 | No |
29,200 | 12 | Yes |
34,040 | 17 | No |
30,060 | 13 | No |
53,300 | 22 | Yes |
22,820 | 6 | No |
72,900 | 33 | Yes |
55,920 | 20 | Yes |
18,280 | 0 | No |
27,000 | 9 | No |
59,600 | 24 | Yes |
40,000 | 16 | Yes |
81,500 | 31 | Yes |
36,000 | 20 | No |
36,500 | 11 | Yes |
37,020 | 23 | No |
29,000 | 12 | Yes |
5. What is the average difference between the salaries of people with and without Master’s degree (holding years of experience constant)?
6. Does the master’s degree significantly influence the salary of the employees at the alpha level of 0.01?
7. Do the years of experience significantly influence the salary of the employees at the alpha level of 0.01? Make sure to show which values you use to make the decision.
8. Remember, Chris has decided that if the multiple regression model shows that earning a master’s degree is significant in predicting annual salary (at alpha of 0.05), and the estimated increase in salary is at least $10,000, he will enroll in a degree program. Should he? Use the actual numbers from the regression model to prove your answer. there should be two sets of values/numbers used.
The data is saved in an excel file by removing the commas and we save it as a .csv file.
R codes used :
> data1=read.csv(file.choose(),header=T) #importing the saved
csv file into R environment
> names(data1)
[1] "Salary" "Years" "Masters"
> attach(data1)
The following objects are masked from data1 (pos = 3):
Masters, Salary, Years
> Salary[Masters=="Yes"]
[1] 67180 75120 59820 40180 81360 36080 29200 53300 72900 55920
59600 40000 81500
[14] 36500 29000
> Salary[Masters=="No"]
[1] 37620 31280 20500 36080 36680 34040 30060 22820 18280 27000
36000 37020
5.>
mean(Salary[Masters=="Yes"])-mean(Salary[Masters=="No"])
[1] 23895.67
6.> model=lm(Salary~Years+Masters)
> summary(model)
Call:
lm(formula = Salary ~ Years + Masters)
Residuals:
Min 1Q Median 3Q Max
-10739 -4894 -1052 4921 11152
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7127.6 3231.1 2.206 0.037208 *
Years 1629.2 175.6 9.279 2.08e-09
***
MastersYes 13061.6 2936.4 4.448 0.000169
***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 6957 on 24 degrees of freedom
Multiple R-squared: 0.8729, Adjusted R-squared:
0.8623
F-statistic: 82.38 on 2 and 24 DF, p-value: 1.785e-11
Since the p-value for Masters is very small = 0.000169 (<0.01), we reject the null hypothesis of no significance and conclude that the variable MASTER's DEGREE is significantly associated with SALARY.
7.Since the p-value for Years of Experience is very small = 2.08e-09 (<0.01), we reject the null hypothesis of no significance and conclude that the variable YEARS OF EXPERIENCE is significantly associated with SALARY.
8. In the regression equation SALARY = 7127.6 +1629.2*YEARS + 13061.6*MASTERS, we observe that if the person has a Master's degree, then there will be an increase of $13,061.60 in his salary, which means Chris should enroll for the Master's degree since the increase in salary is more than $10,000.