
Semi-partial (part) correlation matrix (native)
Source:R/stats_primitives_native.R
morie_semipartial_cor.RdThe correlation between \(x_i\) and \(x_j\) with the other
variables partialled out of \(x_j\) only:
\(-P_{ij} / (\sqrt{P_{ii}}\, \sqrt{P_{jj} - P_{ij}^2 / P_{ii}})\).
Reproduces ppcor::spcor.
Value
A list mirroring morie_partial_cor with the
semi-partial coefficients in estimate.
Examples
morie_semipartial_cor(mtcars[, c("mpg", "wt", "disp")])$estimate
#> mpg wt disp
#> mpg 1.0000000 -0.2501744 -0.1676239
#> wt -0.2167851 1.0000000 0.2875263
#> disp -0.1550555 0.3069319 1.0000000