Created
November 12, 2015 11:19
-
-
Save dreidpath/952883e7259d68e4de51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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