2023-12-23
The last meeting I said that correlation matrix is used to show the type of relationship that exist b/w more than two traits that are continuous.
We also explore different method to carry this out e.g. base R (cor function)
; metan package cor_coef
and also correlation pacakge in R.
# Correlation Matrix (pearson-method)
Parameter | carb | gear | am | vs | qsec | wt | drat | hp | disp | cyl
---------------------------------------------------------------------------------------------------------------------
mpg | -0.55* | 0.48 | 0.60** | 0.66** | 0.42 | -0.87*** | 0.68*** | -0.78*** | -0.85*** | -0.85***
cyl | 0.53* | -0.49 | -0.52* | -0.81*** | -0.59* | 0.78*** | -0.70*** | 0.83*** | 0.90*** |
disp | 0.39 | -0.56* | -0.59* | -0.71*** | -0.43 | 0.89*** | -0.71*** | 0.79*** | |
hp | 0.75*** | -0.13 | -0.24 | -0.72*** | -0.71*** | 0.66** | -0.45 | | |
drat | -0.09 | 0.70*** | 0.71*** | 0.44 | 0.09 | -0.71*** | | | |
wt | 0.43 | -0.58* | -0.69*** | -0.55* | -0.17 | | | | |
qsec | -0.66** | -0.21 | -0.23 | 0.74*** | | | | | |
vs | -0.57* | 0.21 | 0.17 | | | | | | |
am | 0.06 | 0.79*** | | | | | | | |
gear | 0.27 | | | | | | | | |
p-value adjustment method: Holm (1979)
# A tibble: 8 × 4
var mpg cyl disp
<chr> <dbl> <dbl> <dbl>
1 hp -0.776 0.832 0.791
2 drat 0.681 -0.700 -0.710
3 wt -0.868 0.782 0.888
4 qsec 0.419 -0.591 -0.434
5 vs 0.664 -0.811 -0.710
6 am 0.600 -0.523 -0.591
7 gear 0.480 -0.493 -0.556
8 carb -0.551 0.527 0.395
[Correlation Analysis in R 👨💻]