Graunt의 생명표

Graunt 와 1993년 미국

graunt <- data.frame(x = c(0, 6, 16, 26, 36, 46, 56, 66, 76), lx.17th = c(100, 64, 40, 25, 16, 10, 6, 3, 1))
us.93 <- data.frame(x = graunt$x, lx.93 = c(100, 99, 99, 98, 97, 95, 92, 84, 70))
graunt.us <- data.frame(graunt, lx.93 = us.93$lx)
graunt.us
##    x lx.17th lx.93
## 1  0     100   100
## 2  6      64    99
## 3 16      40    99
## 4 26      25    98
## 5 36      16    97
## 6 46      10    95
## 7 56       6    92
## 8 66       3    84
## 9 76       1    70
plot(graunt$x,graunt$lx.17th, ann=F, xaxt="n", yaxt="n", type="b")
axis(side=1, at=graunt$x, labels=graunt$x)
axis(side=2, at=graunt$lx.17th, labels=graunt$lx.17th)
abline(v=c(0, 76), lty=2)

plot(graunt$x, graunt$lx.17th, ann=F, xaxt="n", yaxt="n", type="b")
axis(side=1, at=graunt$x, labels=graunt$x)
axis(side=2, at=graunt$lx.17th, labels=graunt$lx.17th)
abline(v=c(0, 76), lty=2)
graunt.x<-c(graunt$x, rev(graunt$x))
graunt.y<-c(rep(0, length(graunt$x)), rev(graunt$lx.17th))
polygon(graunt.x, graunt.y, density=15)

plot(graunt$x, graunt$lx.17th, ann=F, xaxt="n", yaxt="n", type="b")
axis(side=1, at=graunt$x, labels=graunt$x)
axis(side=2, at=graunt$lx.17th, labels=graunt$lx.17th)
abline(v=c(0, 76), lty=2)
graunt.x<-c(graunt$x, rev(graunt$x))
graunt.y<-c(rep(0, length(graunt$x)), rev(graunt$lx.17th))
polygon(graunt.x, graunt.y, density=15)
abline(v=graunt$x,lty=2)

plot(graunt$x, graunt$lx.17th, ann=F, xaxt="n", yaxt="n", type="b")
axis(side=1, at=graunt$x, labels=graunt$x)
axis(side=2, at=graunt$lx.17th, labels=graunt$lx.17th)
abline(v=c(0, 76), lty=2)
graunt.x<-c(graunt$x, rev(graunt$x))
graunt.y<-c(rep(0, length(graunt$x)), rev(graunt$lx.17th))
polygon(graunt.x, graunt.y,density=15)
abline(v=graunt$x, lty=2)
title(main="John Graunt의 생존 곡선", xlab="연령(세)", ylab="생존률(%)")

plot(graunt$x, graunt$lx.17th, ann=F, xaxt="n", yaxt="n", type="b")
axis(side=1, at=graunt$x, labels=graunt$x)
axis(side=2, at=graunt$lx.17th, labels=graunt$lx.17th)
abline(v=c(0, 76), lty=2)
lines(us.93$x, us.93$lx.93, type="b")
axis(side=2, at=70, labels=70)
abline(h=70, lty=2)
text(x=66, y=95, labels="미국 1993년")

plot(graunt$x, graunt$lx.17th, ann=F, xaxt="n", yaxt="n", type="b")
axis(side=1, at=graunt$x, labels=graunt$x)
axis(side=2, at=graunt$lx, labels=graunt$lx.17th)
abline(v=c(0, 76), lty=2)
lines(us.93$x, us.93$lx.93, type="b")
axis(side=2, at=70, labels=70, las=1)
abline(h=70, lty=2)
graunt.x<-c(graunt$x, rev(graunt$x))
graunt.y<-c(rep(0, length(graunt$x)), rev(graunt$lx.17th))
us.y <- c(graunt$lx, rev(us.93$lx.93))
polygon(graunt.x, us.y, density=15, col="red", border=NA)
abline(v=graunt$x,lty=2)
title(main="Graunt와 1993년 미국의 생존 곡선", xlab="연령(세)", ylab="생존률(%)")