Skip to content

Instantly share code, notes, and snippets.

@davharris
Created October 28, 2013 18:37
Show Gist options
  • Save davharris/7202223 to your computer and use it in GitHub Desktop.
Save davharris/7202223 to your computer and use it in GitHub Desktop.
library(MASS)
n = 1000
x = mvrnorm(n, c(0, 0), Sigma = matrix(c(1, .9, .9, 1), nrow = 2))
cor(x) # correlation of about 0.9 before thresholding
thresholded.values = x > 0
cor(thresholded.values) # Correlation drops to about 0.7, depending on random seed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment