n = 30
R <- 199
## mutually independent standard normal vectors
x <- rnorm(n)
y <- rnorm(n)
z <- rnorm(n)
pdcor(x, y, z)
pdcov(x, y, z)
set.seed(1)
pdcov.test(x, y, z, R=R)
set.seed(1)
pdcor.test(x, y, z, R=R)
# \donttest{
if (require(MASS)) {
p = 4
mu <- rep(0, p)
Sigma <- diag(p)
## linear dependence
y <- mvrnorm(n, mu, Sigma) + x
print(pdcov.test(x, y, z, R=R))
## non-linear dependence
y <- mvrnorm(n, mu, Sigma) * x
print(pdcov.test(x, y, z, R=R))
}
# }
Run the code above in your browser using DataLab