Visualizing one year of mortality data
Now that you have some feeling with the 1999 life table, you can illustrate the evolution in female mortality rates \(q_x\) as a function of age \(x\). Cynthia's teacher usually plots the log of the mortality rates in his lecture sheets. Can you convince her that this is indeed a good approach?
The object life_table as well as the vectors age and qx defined in the previous exercise have been preloaded.
Deze oefening maakt deel uit van de cursus
Life Insurance Products Valuation in R
Oefeninstructies
plot()(docs) the mortality rates for females in 1999. The first argument has to be theageand the second has to be the mortality ratesqx.- Use a second call to
plot()to display the mortality rates for females in 1999 on the logarithmic scale. Compared to the previous command, you have to transform the second argument by first taking thelog()(docs).
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# 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")