Monday, June 4, 2012

Diagnost Plot No. One, Random Examples

diagnostic plot no1: normal distributed errors

  • example how a the diagnostic plot 1 (residuals vs. fitted) should look like: 9 random number examples
par(mfrow=c(3,3),mar=c(3,2,2,1)) ## 9 plots on one page
x <- runif(100,0,20)
for(i in 1:9){
  y <- x + rnorm(100)
  m <- lm(y ~ x)
  plot(m,which=1)
}

0 comments:

Post a Comment