In: Statistics and Probability
You wish to determine if there is a linear correlation between
the two variables at a significance level of α=0.01. You have the
following bivariate data set.
x | y |
---|---|
75 | 22.4 |
50.4 | 41.3 |
94.4 | 27.3 |
60.1 | 35 |
63.9 | 32.2 |
43.8 | 52.1 |
59 | 42.2 |
54.5 | 35.9 |
75.8 | 19.2 |
49.4 | 46.4 |
42.5 | 59.4 |
29.7 | 59.3 |
65.2 | 27.9 |
56.6 | 31.2 |
38.6 | 48.3 |
50.7 | 32.9 |
60 | 35.1 |
61 | 35.6 |
59.2 | 32.7 |
94.4 | 11.8 |
42.3 | 47.5 |
71.1 | 19.3 |
65.9 | 42.2 |
17.3 | 65.3 |
What is the correlation coefficient for this data set?
r =
To find the p-value for a correlation coefficient, you need to
convert to a t-score:
t=√r2(n−2)1−r2
This t-score is from a t-distribution with
n–2 degrees of freedom.
What is the p-value for this correlation coefficient?
p-value =
Your final conclusion is that...
Note: In your calculations, round both r and t to 3 decimal places
in ALL calculations.
Using R code as follow we get
x=c(75,50.4,94.4,60.1,63.9,43.8,59,54,75.8,49.4,42.5,29.7,65.2,56.6,38.6,50.7,60,61,59.2,94.4,42.3,71.1,65.9,17.3)
>
y=c(22.4,41.3,27.3,35,32.2,52.1,42.2,35.9,19.2,46.4,59.3,59.4,27.9,31.2,48.3,32.9,35.1,35.6,32.7,11.8,47.5,19.3,42.2,65.3)
> cor(x,y)
[1] -0.8912305
Correlation coefficient for data is r= - 0.892
Ho : Correlation coefficent is zero
v/s
H1: correlation coefficient is not equal to zero
> cor.test(x,y,conf.level = 0.99)
Pearson's product-moment correlation
data: x and y
t = -9.2167, df = 22, p-value = 5.212e-09
alternative hypothesis: true correlation is not equal to 0
99 percent confidence interval:
-0.9633119 -0.6992257
sample estimates:
cor
-0.8912305
Here
t= -0.923
Looking in t table we get -0.92167 value is close to zero at 0.01
and R out put alos show that P value is close to zero = zero
P-value=5.212e-09 0
Decision Rule:- P value < 0.01 we reject Ho
Conclusion : There is sufficient sample evidence to support that claim that there is statistically significant correlation between two variables