Skip to contents

\(r_{xy\cdot z}\) with its t-test on \(n - 2 - |z|\) degrees of freedom. Reproduces ppcor::pcor.test.

Usage

morie_partial_cor_test(x, y, z, method = "pearson")

Arguments

x, y

Numeric vectors.

z

Numeric vector, matrix, or data frame of controls.

method

Correlation method.

Value

A one-row data frame: estimate, p.value, statistic, n, gp, Method.

Examples

morie_partial_cor_test(mtcars$mpg, mtcars$wt, mtcars$disp)
#>     estimate     p.value statistic  n gp  Method
#> 1 -0.4713927 0.007430725 -2.878399 32  1 pearson