Skip to content

Instantly share code, notes, and snippets.

@cdated
Last active September 28, 2015 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdated/d4615737500136345056 to your computer and use it in GitHub Desktop.
Save cdated/d4615737500136345056 to your computer and use it in GitHub Desktop.
> house.size <- c(1400, 2400, 1800, 1900, 1300, 1100)
> house.cost <- c(112000, 192000, 144000, 152000, 104000, 88000)
> plot(house.size, house.cost)
> fit <- lm(house.cost ~ house.size)
> abline(fit)
> predict(fit, newdata=data.frame(house.size=c(1300)), se.fit=TRUE)
$fit
1
104000
$se.fit
[1] 6.53471e-12
$df
[1] 4
$residual.scale
[1] 1.247036e-11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment