if (FALSE) {
mtx=data.frame(mtcars[,1:3]) #make sure columns of mtx have names
ctrl=data.frame(mtcars[,4:5])
causeAllPair(mtx=mtx,ctrl=ctrl)
}
options(np.messages=FALSE)
set.seed(234)
z=runif(10,2,11)# z is independently created
x=sample(1:10)+z/10 #x is somewhat indep and affected by z
y=1+2*x+3*z+rnorm(10)
w=runif(10)
x2=x;x2[4]=NA;y2=y;y2[8]=NA;w2=w;w2[4]=NA
causeAllPair(mtx=cbind(x2,y2), ctrl=cbind(z,w2))
Run the code above in your browser using DataLab