可视化某一年的死亡率数据
既然您已经对 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")