Skip to content

Instantly share code, notes, and snippets.

@daattali
Created September 12, 2013 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daattali/6541111 to your computer and use it in GitHub Desktop.
Save daattali/6541111 to your computer and use it in GitHub Desktop.
n <- 50
a <- 2
b <- -3
sigSq <- 0.5
x <- runif(n)
norm <- rnorm(n, sd = sqrt(sigSq))
y <- a + b * x + norm
plot(x,y)
abline(a, b, col = "blue")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment