In: Math
A university would like to examine the linear relationship between a faculty member's performance rating (measured on a scale of 1-20) and his or her annual salary increase. The table to the right shows these data for eight randomly selected faculty members. Complete parts a and b. Rating Increase 16 2300 18 2400 12 1800 12 1600 16 2000 14 2700 18 1900 17 1800
Sol:
Peform correaltion in R:
create 2 vectors and to gt the scatterplot use plot function in R
cor.test function to get the r value.
Rcode:
Rating <- c(16,18,12,12,16,14,18,17)
Increase <- c(2300, 2400,1800,1600, 2000,2700, 1900,
1800)
plot(Rating,Increase,main="Scatter plot",pch=18)
cor.test(Rating,Increase)
Output:
Pearson's product-moment correlation
data: x and y
t = 0.68762, df = 6, p-value = 0.5174
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.5365981 0.8189693
sample estimates:
cor
0.2702716
There exists a weak positive relationship between annual salary increase and rating
From scatterplot
Form:not linear
strength:weak
Direction positive.