Partial correlation between x and y, after having adjusted both for z.
pcor(x, y, z, alpha = 0.05)
A numeric vector.
A numeric vector.
A data frame, which can contain characters or factors.
Type-I error for the confidence interval (CI).
Default is 0.05
, corresponding to a 95% CI.
The partial correlation, and the lower and upper bounds of its CI.
pcor(iris[[1]], iris[[2]], iris[-(1:2)])
#> [1] 0.4328206 0.2908200 0.5561645