Created
September 11, 2013 07:09
-
-
Save jennybc/6520226 to your computer and use it in GitHub Desktop.
Toy example used in STAT 545A
This file contains 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
a <- 2 | |
b <- 7 | |
sigSq <- 0.5 | |
n <- 400 | |
set.seed(1234) | |
x <- runif(n) | |
y <- a + b * x + rnorm(n, sd = sqrt(sigSq)) | |
(avgX <- mean(x)) | |
plot(x, y) | |
abline(a, b, col = "blue", lwd = 2) | |
sessionInfo() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment