# generate some correlated data
n <- 1e2
x <- rnorm(n)
y <- 0.25 * x + sqrt(0.75) * rnorm(n)
xy <- cbind(x, y)
# threshold of zero for left-censoring
u <- matrix(0, n, 2)
# left-censored correlation matrix
cencor(xy, u) # could check with cor(xy)
# left-censored covariance matrix
cencov(xy, u)
Run the code above in your browser using DataLab