(4) Select two variables that are (approximately) normally distributed. Test whe
ID: 3328581 • Letter: #
Question
(4) Select two variables that are (approximately) normally distributed. Test whether they are correlated using an appropriate test. Conclude your test result with a sentence.
I used pearson test with this.
(5) Select two variables that are clearly non-normal. Test whether they are significantly correlated using an appropriate test. Conclude your test result with a sentence.
I did both Kendall and Spearman but I got error messages. Please correct me. I am not really good at this. An explanation is also greatly appreciated.
> cor.test(swiss$Catholic, swiss$Education, method="spearman")
Spearman's rank correlation rho
data: swiss$Catholic and swiss$Education
S = 19794, p-value = 0.3328
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
-0.1444163
Warning message:
In cor.test.default(swiss$Catholic, swiss$Education, method = "spearman") :
Cannot compute exact p-value with ties
> cor.test(swiss$Catholic, swiss$Education, method="kendall")
Kendall's rank correlation tau
data: swiss$Catholic and swiss$Education
z = -0.81969, p-value = 0.4124
alternative hypothesis: true tau is not equal to 0
sample estimates:
tau
-0.08479652
Warning message:
In cor.test.default(swiss$Catholic, swiss$Education, method = "kendall") :
Cannot compute exact p-value with ties
Explanation / Answer
These are not error messages but the warning messages, you can very well ignore them in R.
The hypothesis for the test is as follows
H0 : The correlation is not signficant (equal to 0 )
H1 : The correlation is statistically signficant (not equal to zero
if the p value of the test is less than 0.05 , then we can reject null in favor of alternate hypothesis and conclude that The correlation is not signficant (equal to 0 )
p-value = 0.3328 for spearman
p-value = 0.4124 for kendalls rank
both are greater than 0.05 , hence we fail to reject the null hypothesis
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.