title: How to find the multivariate empirical cumulative distribution function (CDF) in R?
body: <p>I have two correlated variables x and y, and I wonder how to find their empirical joint CDF in R? </p>
  
  <p>Also, how can we find probabilities like: P(X&lt;=2 and Y&lt;=3), P(X>=2 and Y>=3), P(X>=3 and Y&lt;=2), P(X&lt;=3 and Y>=2); P(X&lt;=2 or Y&lt;=3), P(X>=3 or Y>=2), P(X>=3 or Y&lt;=2), P(X&lt;=2 or Y>=3)? Thanks for any help.</p>
  
  <pre><code>x= c(1,3,2,2,8,2,1,3,1,1,3,3,1,1,2,1,2,1,1,3,4,1,1,3,1,1,2,1,3,7,1,4,6,1,2,1,1,3,1,2,2,3,4,1,1,1,1,2,2,12,1,1,2,1,1,1,3,4)
  y = c(1.42,5.15,2.52,2.29,12.36,2.82,1.49,3.53,1.17,1.03,4.03,5.26,1.65,1.41,3.75,1.09,3.44,1.36,1.19,4.76,5.58,1.23,2.29,7.71,1.12,1.26,2.78,1.13,3.87,15.43,1.19,4.95,7.69,1.17,3.27,1.44,1.05,3.94,1.58,2.29,2.73,3.75,6.80,1.16,1.01,1.00,1.02,2.32,2.86,22.90,1.42,1.10,2.78,1.23,1.61,1.33,3.53,10.44)
  
  cor(x,y)
  x_cdf = ecdf(x)
  y_cdf = ecdf(y)
  </code></pre>