Skip to content

Instantly share code, notes, and snippets.

@yfwu
Last active June 11, 2018 05:54
Show Gist options
  • Save yfwu/c08c2dde3c10e4428af0181a81cddf17 to your computer and use it in GitHub Desktop.
Save yfwu/c08c2dde3c10e4428af0181a81cddf17 to your computer and use it in GitHub Desktop.
Linear regression plotting
labor<- c(115.63, 134.13, 140.31, 125.14, 76.96, 78.3, 67.71, 72.36, 96.14, 111.82, 113.46, 73.67, 125.6, 143.78, 136.28, 131.65)
marriage<- c(46.96, 21.47, 24.75, 31.36, 50.37, 49.41, 37.36, 32.11, 0, 23.88, 35.43, 11.73, 53.58, 51.9, 99.74, 0)
plot(labor, marriage)
mod <- lm(marriage ~ labor)
abline(mod, col=2, lwd=3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment