Created
July 26, 2012 09:04
-
-
Save mihids/3181123 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x <- sample(-50:50,50) # select 50 values between -50 and +50 with replacement - consider option replace=F | |
y <- 2*x + 1 # linearly correlated data | |
plot(x,y) | |
r <- runif(50, 1.0, 40.0) # generate 50 random numbers between 1 and 40 | |
y_1 <- y+ r # Correlated but not exact | |
plot(x,y_1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment