stat545a-2013-hw01_gingerich-mat.R

Matthew — Sep 12, 2013, 1:37 PM

n <- 100
a <- 2
b <- -3
sigSq <- 0.2
x <- runif(n)
y <- a + b * x + rnorm(n, sd = sqrt(sigSq))
(avgX <- mean(x))
[1] 0.524
plot(x, y)
abline(a, b, col = "darkgreen", lwd=2)

plot of chunk unnamed-chunk-1