In this article I share interactive graphs that allow readers to explore trends in Australian aged care star ratings for various groups of homes.
Note
The original version of this article was posted on June 25, 2024.
In this article I share interactive graphs that allow readers to explore trends in Australian aged care star ratings grouped by various variables. Most variables are directly taken from the quarterly star rating extracts, but provider size had to be derived, and regionality was modified by grouping MM3-5 and MM6-7. Additionally, service sizes for Q3 FY22-23 were missing, so I imputed these values based on data from the previous and subsequent quarter. I have included a description of each variable in Table 1. When grouped by ‘nothing’, all services are considered as a single group. By default, points are connected with a Catmull–Rom spline.
viewof smoother_select = Inputs.select(['smooth','straight'])html`<span style="line-height: 2rem;">Aged care star ratings grouped by <span style="white-space: nowrap;"><span class="dropdown-container" style="width: 10rem;">${viewof category_select}</span>. </span>The categories are <span class="checkbox-styling">${viewof legend}</span>. Click the categories to include or exclude them from the graphs. Points are connected by <span class="dropdown-container" style="width: 5rem;">${viewof smoother_select}</span> lines. Click points to reveal the average star rating and number of services within each category and time period.</span>`
smoother_select = "smooth"
Aged care star ratings grouped by . The categories are . Click the categories to include or exclude them from the graphs. Points are connected by lines. Click points to reveal the average star rating and number of services within each category and time period.
{if(legend.length&&legend.length>0) {returnhtml`${facetCharts.map(chart => chart)}${bar_chart}`; } else {returnhtml`Select at least one category.<div style="display: none;">${facetCharts.map(chart => chart)}${bar_chart}</div>`; }}
sortedCategories = averageNPerCategory.sort((a, b) => b.average_n- a.average_n).map(d => d.category);bar_chart = Plot.plot({marks: [ Plot.barY(averageNPerCategory, {x:"category",y:"average_n",fill: d => color_scheme.find(k => d.category=== k.name).color }), Plot.text(averageNPerCategory.filter(d => d.average_n>100), {x:"category",y:"average_n",text: d => d.average_n.toFixed(1),// Display average_n on each bardy:10,// Adjust position of text above the barfill:"white",// White text for higher valuestextAnchor:"middle",fontSize:14,fontWeight:"bold" }), Plot.text(averageNPerCategory.filter(d => d.average_n<=100), {x:"category",y:"average_n",text: d => d.average_n.toFixed(1),dy:-10,fill:"black",textAnchor:"middle",fontSize:14,fontWeight:"bold" }) ],x: {label:"Category",domain: sortedCategories // Set the domain to the sorted categories },y: {label:"Average n" },width:700,height:200});