x <- sort(rnorm(20,6,2))
y1 <- 1 + 1.5 * x[1:10] + rnorm(10)
y2 <- 10 + 0.5 * x[11:20] + rnorm(10)
y <- c(y1,y2)
plot(y~x)
abline(a=10,b=0.5, col='red',lty=2)
abline(a=1,b=1.5, col='blue',lty=2)
blinding(x,y)
Run the code above in your browser using DataLab