May 2019
Beginner to intermediate
266 pages
5h 57m
English
The cor() command is used to determine correlations between two vectors, all of the columns of a data frame, or two data frames. The cov() command, on the other hand, examines covariance. The cor.test() command carries out a test as to the significance of the correlation.
Simple correlations are between two continuous variables and use the cor() command to obtain a correlation coefficient, as shown in the following command:
> cor(bank$balance, bank$age, method = 'spearman')[1] 0.105988
The preceding example uses the Spearman Rho correlation, but a user can also apply Kendall's Tau by specifying kendall as the method:
> cor(bank$balance, bank$age, method = 'kendall')[1] 0.07119334
A correlation is nothing but a bivariate analysis ...
Read now
Unlock full access