stat545a-2013-hw01_johnston-reb.R

Rebecca — Sep 13, 2013, 8:55 PM

a <- 10
b <- -10
sigSq <- 0.5
n <- 50
x <- runif(n)
y <- a + b * x + rnorm(n, sd = sqrt(sigSq))
(avgX <- mean(x))
[1] 0.5402
plot(x, y)
abline(a, b, col = "red")

plot of chunk unnamed-chunk-1