Tutor 4.9 (68 Reviews)
Statistics Tutor
Still stuck with a Statistics question
Ask this expertAnswer
Correlation in R programming
Correlation coefficient can be computed using the functions cor() or cor.test():
1. cor() computes the correlation coefficient
2. cor.test() test for association/correlation between paired samples. It returns both the correlation coefficient and the significance level(or p-value) of the correlation.
cor(x, y, method = c("pearson", "kendall", "spearman"))
cor.test(x, y, method=c("pearson", "kendall", "spearman"))
For example in comparing 178 wines to determine the Flavin and Phenol content correlation we use the code;
cor.test(array1, array 2)
The R-code above depicts that the two contents has a correlation of 0.8645635 meaning they are highly positive correlated.
. Was this Helpful?
Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
Central limit theorem conditions
Answers · 1
Distribution Statistics Definition
Answers · 1