In: Statistics and Probability
The HR Department of Vanderizing Bulb Company wanted to know if among its salaried employees there was a relationship between years of school and annual compensation. A random sample of employees yielded the following data:
Employee | Years of School | Compensation ($) |
1 | 20 | 69,582 |
2 | 15 | 55,433 |
3 | 13 | 64,678 |
4 | 14 | 74,465 |
5 | 17 | 70,159 |
6 | 16 | 62,487 |
7 | 17 | 69,763 |
8 | 18 | 71,125 |
9 | 20 | 64,350 |
10 | 14 | 53,290 |
a. Find the correlation coefficient for the relationship between Years of School and Compensation.
b. Find the best equation which should be used to predict compensation on the basis of years of schooling. Justify by a test of a hypothesis.
c. Maggie Radford has 15 years of schooling. What is her predicted salary if she works at Vanderizing?
Cov(years , compensation)= 5643.356 standard deviation(years) = 2.458545
std(compensation)= 6912.532
r(x,y)= cov(x,y) / [(std(x) * std(y)] = 5643.356 / (6912.532 * 2.458545) = 0.3320642
therefore the Correlation coefficient for the relationship between Years of School and Compensation is is 0.3320642.
Y^= 50221.4 + 933.6 * Years.
H0: B1=0
H1: B1=/ 0.
As p value is 0.349. P value > 0.05.Thus, the years of schooling is not significant with compensation. We accept H0
Y^= 50221.4 + 933.6 * Years = 50221.4 + 933.6 * 15 = 64226.1.
Hence,
The compensation for 15 years of schooling is 64226.1.
The Values can be checked by R codes .
View(dat1)
> attach(dat1)
> cov(years,compensation)
[1] 5643.356
> sqrt(var(years))
[1] 2.458545
> sqrt(var(compensation))
[1] 6912.532
> cor(years,compensation)
[1] 0.3320642
> model <- lm(compensation~years)
> model
Call:
lm(formula = compensation ~ years)
Coefficients:
(Intercept) years
50221.4 933.6
> predict(model,data.frame(years=15))
1
64226.1