Background
This document sets out a simple recipe for visualising Australian life industry data from APRA using Tableau.
Tableau public is a free to use visualisation tool that can ingest data in a number of different formats and is useful at creating flexible visualisation. Gephi is an open source graphing platform that has a number of algorithms that can automatically spread the points (nodes) of a network and their connecting lines (edges) into set of points that can be combined with other data and visualised in Tableau. You could also create a visual in Gephi, but Tableau has a number of other useful tools.
See link above to GitHub repository which has data and tableau workbook for this recipe.
Introducing radial bar charts
A radial bar chart is a bar chart plotted in polar co-ordinates rather than a Cartesian plane. This site sets out a very simple approach, which I have used here.
Using r to view industry stats
As with most data sources, an alternative visualisation tool is r. The below extracts the individual disability income
# this script reads in the APRA data and produces a few graphs for presentation
<- c("tidyverse", "ggplot2", "readxl", "lubridate", "scales", "xtable")
packages install.packages(setdiff(packages, rownames(installed.packages())))
for (package in packages) {
library(package, character.only = TRUE)
}
<- function(value) {
percent0 return(percent(value, accuracy = 0.1))
}
# update names
# [1] "Reporting date" "Industry sector" "Subject"
# [4] "Category" "Data item" "Reporting Structure"
# [7] "Class of business" "Product Group" "Calculation basis"
# [10] "Value" "Notes"
<- c(
qrt_col_name "rep_date", "sector", "subject", "category", "data_item",
"rep_struc", "class", "product", "calc_basis", "value",
"notes"
)<- c("date", rep("text", 8), "numeric", "text")
qrt_col_type
#---------- read in quarterly data
<- read_xlsx(
qrt_data path = "Quarterly life insurance performance statistics database - June 2008 to June 2021.xlsx",
sheet = "Data",
col_names = qrt_col_name,
skip = 1,
col_types = qrt_col_type,
trim_ws = TRUE, na = "N/A"
)
# add fiscal years
$fin_year <- paste0("FY", format(year(qrt_data$rep_date) +
qrt_dataas.integer(month(qrt_data$rep_date) > 6)))
# also add calendar year as an alternative aggregation
$cal_year <- format(year(qrt_data$rep_date))
qrt_data
# DI Profit by Year -----------------------------------------------------
<- "Individual Disability Income Insurance"
DI_risk_type
<- c(
data_items "Profit / loss before tax ($m)" = "Profit / loss before tax",
"Premiums after reinsurance ($m)" = "Net policy revenue",
"Premiums before reinsurance ($m)" = "Gross policy revenue"
)
<- qrt_data %>%
DI_profit filter(data_item %in% data_items) %>%
filter(is.na(class)) %>%
filter(product == DI_risk_type) %>%
group_by(`Fin year` = fin_year, data_item) %>%
summarise(risk_value = sum(value)) %>%
spread(data_item, risk_value) %>%
mutate(`Margin (%)` = percent0(`Profit / loss before tax` /
`Net policy revenue`)) %>%
rename(data_items)
<- xtable(
DI_profit_print x = DI_profit,
caption = "Individual Disability Income Industry Profit",
align = "llrrrr",
digits = 0
)
print(DI_profit_print,
type = "html",
file = "DI_profit",
include.rownames = FALSE,
)