Lecture Overview:

Diagnostics - error assumptions

Untitled

Assumptions on the error term are the same as in SLR

Checking non-constant variance (heteroscedasticity)

Constant Variance (Homoscedasticity)

set.seed(1)
par(mfrow=c(3,3))
n <- 50
for(i in 1:5) {
y <- rnorm(n)
plot(y, pch=16)
abline(h=0,lty=2,col = "red")
}
n <- 500
for(1 in 6:9) {
y <- rnorm(n)
plot(y, pch=16)
abline(h=0, lty=2, col = "red")
}

Untitled

Strong Non-constant Variance (Heteroscedasticity)

set.seed(13)
par(mfrow=c(3,3))
n <- 50
for(i in 1:9)
{
x <- runif(n)
plot(x,x*rnorm(n), pch=16)
abline(h=0, lty=2, col="red")
}