Skip to content

Instantly share code, notes, and snippets.

@marutter
Created November 18, 2010 19:59
Show Gist options
  • Select an option

  • Save marutter/705512 to your computer and use it in GitHub Desktop.

Select an option

Save marutter/705512 to your computer and use it in GitHub Desktop.
x <- c(1,2,3,4,5,15)
y <- c(3.1,5.9,9.3,11.8,15.1,1)
plot(x,y)
res <- lm(y~x)
summary(res)
abline(res)
res1 <- lm(y~x,subset=c(-6))
summary(res1)
yhat.6.6 <- predict(res1,data.frame(x=15))
y[6]-yhat.6.6
hatvalues(res)
sum(hatvalues(res))
res$res[6]
res$res[6]/(1-hatvalues(res)[6])
plot(hatvalues(res))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment