Skip to content

Instantly share code, notes, and snippets.

@dreidpath
Created November 12, 2015 11:19
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 dreidpath/952883e7259d68e4de51 to your computer and use it in GitHub Desktop.
Save dreidpath/952883e7259d68e4de51 to your computer and use it in GitHub Desktop.
# A Plot of age adjusted ischemic stroke annual incidence (per 100,000) in Malaysia.
# The data come from a paper by Aziz et al. (2015) published in the Journal of Stroke &
# Cerebrovascular Disease. For a discussion see: http://wp.me/p6R8xa-Q
year <- 2010:2014
rate <- c(44.94, 49.6, 72.41, 81.94, 126.25)
model1 <- lm(rate ~ year + I(year^2))
plot(year, rate,
xlab="Year",
ylab="Age adjusted stroke incidence",
pch=15, col='Purple')
lines(seq(2010, 2014, by=.1), predict(model1, newdata=data.frame(year=seq(2010, 2014, by=.1), rate=NA)),
lwd=2, col='Blue')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment