# NOT RUN {
n = 200; p = 10
y = matrix(rnorm(n*2),n,2)
x = matrix(rnorm(n*p),n,p)
res1 = mdcov(y,x)
res2 = numeric(p)
for(j in 1:p){res2[j] = dcov::dcov(y,x[,j])}
# res1 is same with res2
res1 - res2
res3 = mdcor(y,x)
res4 = numeric(p)
for(j in 1:p){res4[j] = dcov::dcor(y,x[,j])}
# res3 is same with res4
res3-res4
# }
Run the code above in your browser using DataLab