
死因別死亡確率(令和元年)
死因別死亡確率は、生命表の上で、ある年齢の者が将来どの死因で死亡するかを計算し、確率の形で表したものである。
```{r,message=FALSE}
library(readr)
mortality_probability_2019 <- read_csv("mortality probability-2019.csv")
mortality <- mortality_probability_2019
m <- as.data.frame(mortality[1:14,])
f <- as.data.frame(mortality[15:28,])
m
f
par(family="HiraKakuProN-W3")
dotchart(m[,2],labels = m[,1],main = "死因別死亡確率、男0歳",sub="2019年簡易生命表",xlim = c(0,30),cex = 0.8)
dotchart(f[,2],labels = f[,1],main = "死因別死亡確率、女0歳",sub="2019年簡易生命表",xlim = c(0,30),cex=0.8)
```
```{r}
m$sex[1:14] <- "男"
f$sex[1:14] <- "女"
both <- rbind(f,m)
colnames(both)[2] <- "dp00"
```
```{r}
ggplot(both, aes(x=死因,y=dp00,group=sex))+
geom_point(aes(col=sex),size=3)+
labs(y="死亡確率",col="性別",title = "男女別の死因別死亡確率",subtitle = "0歳",caption = "令和元年簡易生命表による")+
guides(color=guide_legend(reverse = TRUE))+
theme_minimal(base_family="HiraKakuProN-W3")+
coord_flip()
```