視覺化某一年的人口死亡資料
既然你已經對 1999 年的生命表有了初步認識,接下來可以把女性的死亡率 \(q_x\) 隨年齡 \(x\) 變化的趨勢畫出來。Cynthia 的老師在講義裡通常會繪製死亡率的對數。你能說服她,這確實是個不錯的做法嗎?
先前練習中定義的物件 life_table,以及向量 age 和 qx 已經預先載入。
本練習屬於課程
以 R 估值人壽保險商品
練習說明
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Plot the female mortality rates in the year 1999
plot(___, ___,
main = "Mortality rates (Belgium, females, 1999)",
xlab = "Age x",
ylab = expression(paste("Mortality rate ", q[x])),
type = "l")
# Plot the logarithm of the female mortality rates in the year 1999
plot(___, ___,
main = "Log mortality rates (Belgium, females, 1999)",
xlab = "Age x",
ylab = expression(paste("Log mortality rate ", log(q[x]))),
type = "l")