Last chance! 50% off unlimited learning
Sale ends in
x
and y
, controlling for z
.pcor(x, y, z, semi = FALSE, use = "complete.obs", method = c("pearson",
"kendall", "spearman"))
TRUE
the semi-partial correlation coefficient is computed. In that case only y
is controlled for z
.use
of cor
.method
of cor
.pcor.test
for confidence intervals (and tests).set.seed(1444)
x <- 1:30
y <- 1:30+rnorm(30,0,2)
z1 <- runif(30,0,4)
z2 <- 30:1+rnorm(30,03)
pcor(x,y,z1)
pcor(x,y,list(z1,z2))
Run the code above in your browser using DataLab