<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Aydin&#39;s Workbench Blog</title>
<link>https://blog.aydins-workbench.com/</link>
<atom:link href="https://blog.aydins-workbench.com/index.xml" rel="self" type="application/rss+xml"/>
<description>Notes on statistical modelling, research software, public data questions, and project-adjacent thinking.</description>
<generator>quarto-1.9.38</generator>
<lastBuildDate>Tue, 16 Jun 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>How Panel Pilot Chooses What To Zoom Into</title>
  <dc:creator>Aydin </dc:creator>
  <link>https://blog.aydins-workbench.com/posts/panel-pilot-panel-detection/</link>
  <description><![CDATA[ 




<p>Panel-by-panel reading sounds like it should be simple. Find the boxes, zoom into the boxes, move to the next box.</p>
<p>It is not simple.</p>
<p>Panel Pilot started from a practical annoyance: manga apps can pull from huge libraries through source extensions, but on a phone the full page is often too small to read comfortably. The actual job was not just “detect panels”. It was:</p>
<ol type="1">
<li>choose readable regions,</li>
<li>move through them in the right order,</li>
<li>keep enough surrounding context that the page still feels like a comic,</li>
<li>avoid getting stuck when detection is wrong,</li>
<li>handle manga, webtoons and western comics without making the reader feel like three unrelated apps.</li>
</ol>
<p>This post is a build note on the methods we tried and what the current prototype landed on.</p>
<section id="the-reader-model" class="level2">
<h2 class="anchored" data-anchor-id="the-reader-model">The Reader Model</h2>
<p>The reader does not crop the image into separate files. It keeps the page image intact and treats each panel as a normalized rectangle:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode js code-with-copy"><code class="sourceCode javascript"><span id="cb1-1">{</span>
<span id="cb1-2">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">x</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.12</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-3">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">y</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.34</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-4">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">w</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.42</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-5">  <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">h</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.18</span></span>
<span id="cb1-6">}</span></code></pre></div></div>
<p>When the user moves panel-by-panel, the app expands that rectangle by the current padding setting, computes the scale needed to fit it inside the reader viewport, and translates the full image so the target region is centered.</p>
<p>That matters because it preserves context. A pure crop can feel clean, but manga and comics often rely on gutters, speech tails, nearby reactions, and the rhythm of the page. Panel Pilot therefore lets the user set context padding. Zero percent means “show me the selected region only”. A larger value means “give me a little of the page around it”.</p>
<p>The whole detector stack feeds that one camera model.</p>
</section>
<section id="first-attempt-one-detector-for-everything" class="level2">
<h2 class="anchored" data-anchor-id="first-attempt-one-detector-for-everything">First Attempt: One Detector For Everything</h2>
<p>The first obvious approach was to take a page, find the white gutters, and treat the content blocks between those gutters as panels.</p>
<p>That works surprisingly often for conventional manga pages:</p>
<ul>
<li>manga pages usually have clear black ink on pale paper,</li>
<li>panel gutters are often bright and low-variance,</li>
<li>rectangular panels are common,</li>
<li>right-to-left reading order can be approximated by row and column grouping.</li>
</ul>
<p>But it fails quickly once the layout becomes more interesting. Title pages may have huge blank areas. Action pages may have overlapping art, black backgrounds, angled panel borders, or speech bubbles that look like little panels. Western comics often have caption boxes, diagonal cuts, inset panels and painted backgrounds where “find the gutters” is not a strong enough idea.</p>
<p>So the current system is not one detector. It is a small committee of detectors, plus rules for choosing between them.</p>
</section>
<section id="manga-mode" class="level2">
<h2 class="anchored" data-anchor-id="manga-mode">Manga Mode</h2>
<p>Manga mode is the most mature path.</p>
<p>The page is scaled down for analysis, then converted into luminance-based masks:</p>
<ul>
<li>a dark mask for anything that looks like ink or art,</li>
<li>a black mask for strong panel borders and heavy linework,</li>
<li>a light mask for pale panel interiors and page background,</li>
<li>row and column statistics for brightness, variance and dark-pixel runs.</li>
</ul>
<p>From those masks, Panel Pilot tries several panel candidates.</p>
<section id="recursive-region-splitting" class="level3">
<h3 class="anchored" data-anchor-id="recursive-region-splitting">Recursive Region Splitting</h3>
<p>The main manga detector recursively splits the page into regions. It looks for likely horizontal or vertical separations, then checks the content bounds inside each proposed region.</p>
<p>This works well when panels are rectangular and separated by gutters. It also avoids treating every speech bubble or texture as a separate panel because candidate regions have to pass size and density checks.</p>
</section>
<section id="connected-light-regions" class="level3">
<h3 class="anchored" data-anchor-id="connected-light-regions">Connected Light Regions</h3>
<p>The second candidate path looks for connected light regions. In a typical black-and-white manga page, panel interiors often form large pale regions surrounded by dark ink or borders.</p>
<p>This can catch panel shapes the gutter detector misses, but it can also over-detect. Speech bubbles, bright clothing, sky, paper texture and sound effects can look like “light regions”. We keep it as a useful alternative, not as the default truth.</p>
</section>
<section id="gridgutter-splitting" class="level3">
<h3 class="anchored" data-anchor-id="gridgutter-splitting">Grid/Gutter Splitting</h3>
<p>The third candidate path builds row and column cuts from quiet gutters. It then takes the Cartesian product of those cuts, checks each cell for content, and keeps plausible cells.</p>
<p>This is useful when the recursive detector merges panels or when connected components produce too many fragments. It is also where a recent bug came from: an empty grid cell should be skipped, not abort the whole detector. That little distinction matters more than it has any right to.</p>
</section>
<section id="slanted-manga-separators" class="level3">
<h3 class="anchored" data-anchor-id="slanted-manga-separators">Slanted Manga Separators</h3>
<p>The newest manga addition handles pages where a major separator is not horizontal. Some manga pages use angled borders: visually obvious to a human, but invisible to a detector that only searches for straight row or column gutters.</p>
<p>The slanted pass scans for long near-horizontal diagonal black dividers. When it finds credible separators, it splits the page into diagonal bands and then runs the usual region splitting inside those bands.</p>
<p>This is still an approximation. The reader regions remain rectangles, not polygons. But it catches the important practical case: “there are two or three real panel bands here, and the standard detector merged them because the divider was sloped.”</p>
</section>
<section id="choosing-the-manga-candidate-set" class="level3">
<h3 class="anchored" data-anchor-id="choosing-the-manga-candidate-set">Choosing The Manga Candidate Set</h3>
<p>The detector does not simply concatenate all candidates. It chooses.</p>
<p>The current priority is roughly:</p>
<ol type="1">
<li>prefer slanted panels if they create a plausible set and reduce oversized merged regions;</li>
<li>use recursive panels when they produce a small plausible set;</li>
<li>fall back to split panels when connected components over-detect;</li>
<li>use connected panels when they are plausible and ordered;</li>
<li>otherwise return a full-page fallback.</li>
</ol>
<p>After that, panels are merged if they overlap heavily, filtered for plausible size, sorted, and repaired for reading order.</p>
<p>For right-to-left manga, the order check is as important as detection. It should be rare to move rightward within a row or upward within a column. The sorter therefore groups panels into bands, orders columns RTL or LTR, and applies a small repair pass for local reading-order violations.</p>
</section>
</section>
<section id="webtoon-mode" class="level2">
<h2 class="anchored" data-anchor-id="webtoon-mode">Webtoon Mode</h2>
<p>Webtoon mode needed a different model.</p>
<p>At first, a naive “move one screen-height down” approach seemed tempting. It is simple, but it cuts through speech bubbles, faces and scene transitions. The point of panel mode is readability, not scrolling with extra ceremony.</p>
<p>The current webtoon method still detects regions, but with different assumptions:</p>
<ul>
<li>the content is one continuous vertical strip,</li>
<li>the reader should keep the full strip width,</li>
<li>regions may overlap,</li>
<li>page boundaries from the source should not be treated as meaningful story boundaries.</li>
</ul>
<p>That last point is important. Many sources split a webtoon chapter into multiple image files, but visually the chapter is one long strip. A panel or speech bubble can cross the boundary between source images. So Panel Pilot builds a continuous synthetic page.</p>
<p>The first two source images are loaded immediately, so a panel that crosses the first boundary can be seen. The rest of the chapter loads in the background and is appended to the strip without changing the visual width. As new pages arrive, the app preserves the current vertical position by finding the nearest panel center in the expanded strip.</p>
<p>For detection, webtoon mode analyzes rows rather than boxes. It classifies rows as quiet or active based on brightness, variance, ink and edge changes. Long quiet runs become candidate cuts. Active regions become vertical panels with full width. Very tall regions are split into readable chunks with overlap, preferably near quiet rows.</p>
<p>That landed better than fixed scrolling because it centers on content while still behaving like a vertical reader.</p>
</section>
<section id="comic-beta" class="level2">
<h2 class="anchored" data-anchor-id="comic-beta">Comic Beta</h2>
<p>Western comics are the least solved mode, and the app labels this honestly as beta.</p>
<p>We tried reusing manga mode with left-to-right ordering. It works on clean rectangular pages, but it breaks down on dynamic layouts: painted backgrounds, caption strips, inset panels, overlapping art, diagonal borders and pages where the story focus is not the same thing as a bordered rectangle.</p>
<p>The current comic beta keeps the same luminance and gutter candidates as manga, but adds text-like component detection and several flow fallbacks:</p>
<ul>
<li>full-page mode for covers and backmatter,</li>
<li>caption-strip windows for pages that are mostly text bands,</li>
<li>readable text windows when text clusters are the clearest navigation targets,</li>
<li>story-flow regions when panel detection produces montage slices or tiny fragments,</li>
<li>focus regions when connected components are more useful than panel boxes.</li>
</ul>
<p>This is more a “readable region selector” than a true comic panel detector. That is intentional for now. On a phone, the practical question is not always “what is the canonical panel?” It is often “what region lets me read the words and understand the scene?”</p>
<p>For western comics, I expect future versions to need stronger text and speech-bubble understanding. A page can be visually complex but still have a clear reading path through balloon clusters. The current beta is a step toward that, not the final answer.</p>
</section>
<section id="defensive-fallbacks" class="level2">
<h2 class="anchored" data-anchor-id="defensive-fallbacks">Defensive Fallbacks</h2>
<p>One lesson from building this interactively: detector failures must not break the reader.</p>
<p>The app now sanitizes every panel list before storing it:</p>
<ul>
<li>invalid coordinates are removed,</li>
<li>rectangles are clamped to the page,</li>
<li>empty output falls back to full page,</li>
<li>sparse tiny detections on mostly blank pages fall back to full page,</li>
<li>movement repairs a bad current panel list before reading it.</li>
</ul>
<p>That sounds boring, but it is the difference between “this page was not detected well” and “the app stopped responding”. A panel reader can tolerate occasional full-page fallback. It cannot tolerate navigation state becoming invalid.</p>
</section>
<section id="testing-what-we-could-see" class="level2">
<h2 class="anchored" data-anchor-id="testing-what-we-could-see">Testing What We Could See</h2>
<p>The testing loop became visual very quickly.</p>
<p>For manga, we used Frieren and Chainsaw Man pages because they include a useful spread of normal layouts, title pages, speech-heavy pages, action pages and occasional angled divisions. For webtoon mode, we used long-strip manhwa chapters because they stress page-boundary stitching and tall-region splitting. For western comics, Darth Vader pages were useful precisely because they were unpleasant: dynamic layouts, caption-heavy pages, and art that makes rectangular panel assumptions wobble.</p>
<p>The most useful test artifact was an overlay/contact sheet: render the page, draw detected regions, label the reading order, then inspect whether the flow makes sense. A count alone is not enough. Six detected panels can still be wrong if the order jumps rightward in an RTL row, splits a speech bubble, or zooms into a blank caption edge.</p>
<p>We also added a “report bad panels” button in the app. That saves the current page, selected region and detector metadata so future failures can be reviewed directly instead of reconstructed from memory.</p>
</section>
<section id="visual-examples-from-the-test-set" class="level2">
<h2 class="anchored" data-anchor-id="visual-examples-from-the-test-set">Visual Examples From The Test Set</h2>
<p>These are small annotated excerpts from the detector test runs, not full-resolution reading assets. The colored boxes are the regions Panel Pilot would zoom into, and the small black labels show the reading order.</p>
<section id="manga-chainsaw-man" class="level3">
<h3 class="anchored" data-anchor-id="manga-chainsaw-man">Manga: Chainsaw Man</h3>
<p>Chainsaw Man was useful for manga mode because it has many conventional rectangular pages, but it also makes reading order easy to inspect. In the example below, the top row is read right-to-left: region 1 on the upper right, region 2 below it, then region 3 and 4 on the left. After that, the reader moves down the page.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/panel-pilot-panel-detection/assets/chainsaw-manga-rtl-order.jpg" class="img-fluid figure-img" alt="A low-resolution Chainsaw Man page excerpt with colored panel boxes and numbered reading-order labels." width="420"></p>
<figcaption>Chainsaw Man manga-mode detector overlay showing right-to-left reading order across rectangular panels.</figcaption>
</figure>
</div>
<p>This is the case where manga mode should feel almost invisible. The detector is not trying to understand the story; it is finding plausible panel regions, grouping them into rows, and then applying RTL ordering inside each row. The important behavior is that the reader rarely moves rightward inside a row.</p>
</section>
<section id="webtoon-solo-leveling" class="level3">
<h3 class="anchored" data-anchor-id="webtoon-solo-leveling">Webtoon: Solo Leveling</h3>
<p>Solo Leveling pushed the webtoon path in a different direction. The source gives the chapter as multiple image files, but the reader has to treat those files as one continuous vertical strip. A fixed screen-height scroll would land halfway through faces, speech bubbles and scene transitions.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/panel-pilot-panel-detection/assets/solo-leveling-webtoon-slices.jpg" class="img-fluid figure-img" alt="Three low-resolution Solo Leveling strip excerpts side by side, each showing vertical webtoon slices separated by red detector boundaries." width="680"></p>
<figcaption>Solo Leveling webtoon-mode detector slices from one continuous vertical strip.</figcaption>
</figure>
</div>
<p>The webtoon method keeps the strip width fixed, then chooses vertical slices from quiet and active row analysis. The regions can overlap. That is deliberate: for a long vertical comic, overlapping slices are usually better than cutting a speech bubble or character beat in half.</p>
</section>
<section id="comic-beta-darth-vader-2020" class="level3">
<h3 class="anchored" data-anchor-id="comic-beta-darth-vader-2020">Comic Beta: Darth Vader (2020)</h3>
<p>Darth Vader (2020) chapter 33 is a good stress test for western comics because the page design is doing a lot: diagonal motion, inset panels, large sound effects, captions and overlapping focal regions. A manga-style “find neat rectangles” pass is not enough.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/panel-pilot-panel-detection/assets/darth-vader-comic-beta.jpg" class="img-fluid figure-img" alt="A low-resolution Darth Vader 2020 page excerpt with colored overlapping focus regions and numbered labels." width="420"></p>
<figcaption>Darth Vader 2020 comic-beta detector overlay showing overlapping focus regions on a dynamic western comic page.</figcaption>
</figure>
</div>
<p>This is why the comic beta became a readable-region selector rather than a pure panel detector. Some boxes overlap, and some are aimed at text or visual focus rather than strict bordered panels. It is still the least polished mode, but the objective is different: choose zoom targets where the reader can actually read the words and follow the page flow on a phone.</p>
</section>
</section>
<section id="what-we-landed-on" class="level2">
<h2 class="anchored" data-anchor-id="what-we-landed-on">What We Landed On</h2>
<p>The current prototype uses three modes:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>Mode</th>
<th>Core idea</th>
<th>Current status</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Manga</td>
<td>Multiple rectangular detectors, candidate selection, RTL/LTR ordering, slanted separator pass</td>
<td>Most usable</td>
</tr>
<tr class="even">
<td>Webtoon</td>
<td>Continuous vertical strip, row-based active/quiet segmentation, overlapping readable slices</td>
<td>Usable, still tuning slice height</td>
</tr>
<tr class="odd">
<td>Comic beta</td>
<td>Hybrid region selector using panels, text-like components and flow fallbacks</td>
<td>Useful but not yet elegant</td>
</tr>
</tbody>
</table>
<p>The most important design choice was to stop treating panel detection as a single computer-vision answer. It is closer to a reading interface problem. The app needs enough detection to choose a good camera target, enough ordering to preserve story flow, and enough fallback behavior to keep reading when the detector is uncertain.</p>
<p>The next big step is probably better text awareness: not full OCR for transcription, but enough detection to know whether a speech bubble or caption is fully readable inside at least one region. That would give the detector a more reader-centered objective than “did we find the panel border?”</p>
<p>For now, the working rule is simple: a panel selection method is good if the next tap feels obvious, the words are readable, and the reader does not have to think about the detector.</p>


<!-- -->

</section>

 ]]></description>
  <category>software</category>
  <category>computer-vision</category>
  <category>reading</category>
  <category>tools</category>
  <guid>https://blog.aydins-workbench.com/posts/panel-pilot-panel-detection/</guid>
  <pubDate>Tue, 16 Jun 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>A First Pass At Australian Dwelling Prices</title>
  <dc:creator>Aydin </dc:creator>
  <link>https://blog.aydins-workbench.com/posts/housing-prices-first-pass/</link>
  <description><![CDATA[ 




<p>Housing debates have a way of turning into vibes very quickly. Prices feel high, supply feels tight, first-home buyer policy gets loud, and then everyone starts arguing from their favourite chart.</p>
<p>So this is a small grounding exercise: use the latest ABS dwelling-value data, look at the national dwelling stock and mean prices by state, then write down the policy questions that seem worth chasing next.</p>
<section id="data" class="level2">
<h2 class="anchored" data-anchor-id="data">Data</h2>
<p>The main source is ABS <a href="https://www.abs.gov.au/statistics/economy/price-indexes-and-inflation/total-value-dwellings/latest-release">Total Value of Dwellings</a>, March quarter 2026. The release estimates the total value, number and mean price of Australia’s residential dwellings. I also keep <a href="https://www.abs.gov.au/statistics/economy/finance/lending-indicators/latest-release">Lending Indicators</a>, <a href="https://www.abs.gov.au/statistics/industry/building-and-construction/building-approvals-australia/latest-release">Building Approvals</a>, and Treasury’s <a href="https://treasury.gov.au/policy-topics/housing/home-ownership-support">home ownership support</a> page in view because prices alone do not tell us whether buyers are being helped, stretched, or both.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1">download_if_missing <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(url, path) {</span>
<span id="cb1-2">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(path)) {</span>
<span id="cb1-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download.file</span>(url, path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mode =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wb"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb1-4">  }</span>
<span id="cb1-5">  path</span>
<span id="cb1-6">}</span>
<span id="cb1-7"></span>
<span id="cb1-8">as_number <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">parse_number</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(x), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NA"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n/a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>))</span>
<span id="cb1-10">}</span>
<span id="cb1-11"></span>
<span id="cb1-12">quarter_date_from_excel <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(x), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">origin =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1899-12-30"</span>)</span>
<span id="cb1-14">}</span>
<span id="cb1-15"></span>
<span id="cb1-16">state_from_item <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(item) {</span>
<span id="cb1-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_split_fixed</span>(item, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">";"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_squish</span>()</span>
<span id="cb1-19">}</span>
<span id="cb1-20"></span>
<span id="cb1-21">measure_from_item <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(item) {</span>
<span id="cb1-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb1-23">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(item, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Value of dwelling stock; Owned by All Sectors"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total dwelling stock value"</span>,</span>
<span id="cb1-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(item, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mean price of residential dwellings"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mean dwelling price"</span>,</span>
<span id="cb1-25">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(item, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Number of residential dwellings"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Number of dwellings"</span>,</span>
<span id="cb1-26">    <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb1-27">  )</span>
<span id="cb1-28">}</span>
<span id="cb1-29"></span>
<span id="cb1-30">workbook_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_if_missing</span>(</span>
<span id="cb1-31">  source_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>dwellings_workbook,</span>
<span id="cb1-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(raw_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abs-total-value-dwellings-mar-quarter-2026.xlsx"</span>)</span>
<span id="cb1-33">)</span>
<span id="cb1-34"></span>
<span id="cb1-35">raw <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(workbook_path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Data1"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col_names =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb1-36"></span>
<span id="cb1-37">series_meta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb1-38">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">column =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq_along</span>(raw),</span>
<span id="cb1-39">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">item =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unlist</span>(raw[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, ])),</span>
<span id="cb1-40">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">unit =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unlist</span>(raw[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, ])),</span>
<span id="cb1-41">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">measure =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">measure_from_item</span>(item),</span>
<span id="cb1-42">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">state_from_item</span>(item)</span>
<span id="cb1-43">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-44">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(measure), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state), state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb1-45"></span>
<span id="cb1-46">dwelling_series <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> raw <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-47">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-48">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">row_id =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">row_number</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quarter_date_from_excel</span>(...<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-49">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_cols</span>(raw <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">all_of</span>(series_meta<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>column))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-50">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_longer</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(row_id, quarter_date), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"column_name"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-51">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-52">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">column =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_remove</span>(column_name, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">.</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">."</span>)),</span>
<span id="cb1-53">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">value =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(value)</span>
<span id="cb1-54">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-55">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(series_meta, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"column"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-56">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(value), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(quarter_date), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(measure)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-57">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-58">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">value =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb1-59">      measure <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total dwelling stock value"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb1-60">      measure <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mean dwelling price"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb1-61">      measure <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Number of dwellings"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb1-62">      <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> value</span>
<span id="cb1-63">    )</span>
<span id="cb1-64">  )</span>
<span id="cb1-65"></span>
<span id="cb1-66">latest_quarter <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(dwelling_series<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb1-67"></span>
<span id="cb1-68">latest_state_prices <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> dwelling_series <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-69">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(measure <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mean dwelling price"</span>, quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(quarter_date), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">decreasing =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>], state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Australia"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-70">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(quarter_date, state, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_price =</span> value) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-71">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_wider</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_from =</span> quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_from =</span> mean_price) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-72">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rename</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">previous_price =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">latest_price =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-73">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-74">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarterly_change =</span> latest_price <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> previous_price <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb1-75">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dollar_change =</span> latest_price <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> previous_price</span>
<span id="cb1-76">  )</span></code></pre></div></div>
</details>
</div>
</section>
<section id="what-has-happened-nationally" class="level2">
<h2 class="anchored" data-anchor-id="what-has-happened-nationally">What Has Happened Nationally?</h2>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1">dwelling_series <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(measure <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total dwelling stock value"</span>, state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Australia"</span>, quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2021-03-31"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, value)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#126782"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#126782"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar_format</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">suffix =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"t"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scale =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb2-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total dwelling stock value"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/housing-prices-first-pass/index_files/figure-html/national-stock-value-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>ABS total value of Australian residential dwelling stock.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">dwelling_series <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(measure <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mean dwelling price"</span>, state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Australia"</span>, quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2021-03-31"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, value)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb3-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#7a4b9d"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb3-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#7a4b9d"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb3-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> dollar) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb3-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mean dwelling price"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/housing-prices-first-pass/index_files/figure-html/national-mean-price-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>ABS mean dwelling price for Australia.</figcaption>
</figure>
</div>
</div>
</div>
<p>The March quarter 2026 release puts the national mean dwelling price at over $1.1 million. That is not a typical transaction price and it is not an affordability measure, but it is a useful whole-market signal: the stock keeps getting more expensive, even before we ask who can actually buy into it.</p>
</section>
<section id="which-states-moved-most-recently" class="level2">
<h2 class="anchored" data-anchor-id="which-states-moved-most-recently">Which States Moved Most Recently?</h2>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">latest_state_prices <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_reorder</span>(state, latest_price), latest_price, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> quarterly_change)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb4-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_col</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb4-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_flip</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb4-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> dollar) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb4-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_fill_gradient2</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">low =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#8c2d04"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mid =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey80"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">high =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#006d2c"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">midpoint =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb4-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mean dwelling price"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Quarterly change"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/housing-prices-first-pass/index_files/figure-html/latest-state-prices-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Latest ABS mean dwelling prices by state and territory.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">latest_state_prices <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(quarterly_change)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb5-4">    state,</span>
<span id="cb5-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">latest_mean_price =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(latest_price, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>),</span>
<span id="cb5-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarterly_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(quarterly_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb5-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dollar_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(dollar_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)</span>
<span id="cb5-8">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">state</th>
<th style="text-align: left;">latest_mean_price</th>
<th style="text-align: left;">quarterly_change</th>
<th style="text-align: left;">dollar_change</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">New South Wales</td>
<td style="text-align: left;">$11,495,200</td>
<td style="text-align: left;">0.5%</td>
<td style="text-align: left;">$54,200</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="policy-questions-this-sets-up" class="level2">
<h2 class="anchored" data-anchor-id="policy-questions-this-sets-up">Policy Questions This Sets Up</h2>
<p>Treasury says the 5% Deposit Scheme was expanded from 1 October 2025, with uncapped places, removed income caps and higher property price caps. That creates a nice empirical question, but not a simple one.</p>
<p>The questions I would ask next:</p>
<ul>
<li>Did first-home buyer loan commitments rise after the deposit-scheme expansion, and was that concentrated in states where prices were already rising fastest?</li>
<li>Did the policy mostly pull forward demand, or did it change the composition of buyers entering the market?</li>
<li>Are building approvals moving in the same places as dwelling prices, or is supply still lagging the demand signal?</li>
<li>Are investor loans and first-home buyer loans moving together or pushing against each other?</li>
<li>If mean prices rise after access support expands, how much of the buyer benefit is eaten by price pressure?</li>
</ul>
<p>Those need lending and building-approval data joined to this price series. This post is just the first brick.</p>
</section>
<section id="caveats" class="level2">
<h2 class="anchored" data-anchor-id="caveats">Caveats</h2>
<ul>
<li>Mean dwelling price is a stock estimate, not a median sale price or a first-home buyer price.</li>
<li>State averages hide massive variation inside cities, regions and property types.</li>
<li>The latest ABS dwelling estimates are preliminary and can be revised.</li>
<li>Prices do not measure affordability on their own. We need income, rents, interest rates, deposit constraints, lending standards and supply.</li>
<li>Policy timing matters. A demand-side policy can show up in lending before it shows up in prices, and supply responses can be much slower.</li>
</ul>


<!-- -->

</section>

 ]]></description>
  <category>housing</category>
  <category>cost-of-living</category>
  <category>australia</category>
  <category>policy</category>
  <category>abs</category>
  <guid>https://blog.aydins-workbench.com/posts/housing-prices-first-pass/</guid>
  <pubDate>Thu, 11 Jun 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Are NDIS Participant Outcomes Changing?</title>
  <dc:creator>Aydin </dc:creator>
  <link>https://blog.aydins-workbench.com/posts/ndis-outcomes-spend-service-access/</link>
  <description><![CDATA[ 




<p>The simplest outcomes question is not about spend. It is this:</p>
<blockquote class="blockquote">
<p>Can we see any change in outcomes for NDIS participants?</p>
</blockquote>
<p>This post starts there. It uses the public participant outcomes files to ask what outcomes are measured, what the current national levels look like, and how reported outcomes change after plan reassessment. The analysis is descriptive. It shows changes in aggregate survey outcomes; it does not prove that the NDIS caused those changes for any individual participant.</p>
<p>The companion budget and utilisation model is <a href="../ndis-budget-utilisation-prediction/">here</a>.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1">clean_names <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-2">  x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&amp;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"and"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"[^a-z0-9]+"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^_|_$"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb1-7">}</span>
<span id="cb1-8"></span>
<span id="cb1-9">clean_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(x) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_names</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(x))</span>
<span id="cb1-11">  x</span>
<span id="cb1-12">}</span>
<span id="cb1-13"></span>
<span id="cb1-14">as_number <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-15">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.numeric</span>(x)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(x)</span>
<span id="cb1-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">parse_number</span>(</span>
<span id="cb1-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(x),</span>
<span id="cb1-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NA"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"na"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n/a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Not applicable"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No data available"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb1-19">  )</span>
<span id="cb1-20">}</span>
<span id="cb1-21"></span>
<span id="cb1-22">as_rate <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-23">  out <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(x)</span>
<span id="cb1-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(out <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, out <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, out)</span>
<span id="cb1-25">}</span>
<span id="cb1-26"></span>
<span id="cb1-27">safe_median <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-28">  x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(x)]</span>
<span id="cb1-29">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>)</span>
<span id="cb1-30">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(x)</span>
<span id="cb1-31">}</span>
<span id="cb1-32"></span>
<span id="cb1-33">format_optional_percent <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) {</span>
<span id="cb1-34">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(x), <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> accuracy))</span>
<span id="cb1-35">}</span>
<span id="cb1-36"></span>
<span id="cb1-37">read_page <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(url) {</span>
<span id="cb1-38">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">readLines</span>(url, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">warn =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">encoding =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"UTF-8"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb1-39">}</span>
<span id="cb1-40"></span>
<span id="cb1-41">extract_links <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(url) {</span>
<span id="cb1-42">  html <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_page</span>(url)</span>
<span id="cb1-43">  base_url <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace</span>(url, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^(https?://[^/]+).*$"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">1"</span>)</span>
<span id="cb1-44">  matches <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gregexpr</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;a[^&gt;]+href=[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">']([^</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">']+)[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'][^&gt;]*&gt;(.*?)&lt;/a&gt;"</span>, html, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">perl =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb1-45">  pieces <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">regmatches</span>(html, matches)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb1-46">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(pieces) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>()))</span>
<span id="cb1-47"></span>
<span id="cb1-48">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">raw =</span> pieces) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-49">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-50">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">href =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_match</span>(raw, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"href=[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">']([^</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">']+)[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">']"</span>)[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>],</span>
<span id="cb1-51">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> raw <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-52">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;[^&gt;]+&gt;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-53">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_squish</span>(),</span>
<span id="cb1-54">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb1-55">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(href, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^https?://"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> href,</span>
<span id="cb1-56">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(href, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^/"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(base_url, href),</span>
<span id="cb1-57">        <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_remove</span>(url, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/[^/]*$"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/"</span>, href)</span>
<span id="cb1-58">      )</span>
<span id="cb1-59">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-60">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(label, url)</span>
<span id="cb1-61">}</span>
<span id="cb1-62"></span>
<span id="cb1-63">download_one <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(url, filename) {</span>
<span id="cb1-64">  path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(raw_dir, filename)</span>
<span id="cb1-65">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(path)) {</span>
<span id="cb1-66">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download.file</span>(url, path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mode =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wb"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb1-67">  }</span>
<span id="cb1-68">  path</span>
<span id="cb1-69">}</span>
<span id="cb1-70"></span>
<span id="cb1-71">download_named <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(page_url, label_regex, filename) {</span>
<span id="cb1-72">  path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(raw_dir, filename)</span>
<span id="cb1-73">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(path)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(path)</span>
<span id="cb1-74"></span>
<span id="cb1-75">  link <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">extract_links</span>(page_url) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-76">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(label, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">regex</span>(label_regex, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ignore_case =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-77">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb1-78"></span>
<span id="cb1-79">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(link) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>)</span>
<span id="cb1-80">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_one</span>(link<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>url[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], filename)</span>
<span id="cb1-81">}</span>
<span id="cb1-82"></span>
<span id="cb1-83">cohort_levels <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb1-84">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Early childhood"</span>,</span>
<span id="cb1-85">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"School age"</span>,</span>
<span id="cb1-86">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Young people"</span>,</span>
<span id="cb1-87">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Adults"</span>,</span>
<span id="cb1-88">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Family/carer of children"</span>,</span>
<span id="cb1-89">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Family/carer of adults"</span></span>
<span id="cb1-90">)</span>
<span id="cb1-91"></span>
<span id="cb1-92">standardise_cohort <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(questionnaire) {</span>
<span id="cb1-93">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb1-94">    questionnaire <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participant 0 to before school"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Early childhood"</span>,</span>
<span id="cb1-95">    questionnaire <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participant starting school to 14"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"School age"</span>,</span>
<span id="cb1-96">    questionnaire <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participant 15 to 24"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Young people"</span>,</span>
<span id="cb1-97">    questionnaire <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participant 25 and over"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Adults"</span>,</span>
<span id="cb1-98">    questionnaire <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Family/carer of participant 0 to 14"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Family/carer of children"</span>,</span>
<span id="cb1-99">    questionnaire <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Family/carer of participant 15 and over"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Family/carer of adults"</span>,</span>
<span id="cb1-100">    <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> questionnaire</span>
<span id="cb1-101">  )</span>
<span id="cb1-102">}</span>
<span id="cb1-103"></span>
<span id="cb1-104">classify_outcome_theme <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(indicator) {</span>
<span id="cb1-105">  text <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>(indicator)</span>
<span id="cb1-106">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb1-107">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concerns|development|functional|self-care|independent|daily living"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Development and daily living"</span>,</span>
<span id="cb1-108">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"communicat|tell them what|what they want"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Communication"</span>,</span>
<span id="cb1-109">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"choice|control|decisions|advocacy|advocate|rights|choose who supports|choose what they do"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Choice and control"</span>,</span>
<span id="cb1-110">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"friend|relationship|community|social|family life|meet more people|be more involved|welcomed|included"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Relationships and community"</span>,</span>
<span id="cb1-111">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"home|safe"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Home and safety"</span>,</span>
<span id="cb1-112">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"health|wellbeing|well-being"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Health and wellbeing"</span>,</span>
<span id="cb1-113">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"school|education|training|learn|course|job|employment|paid job|volunteer|mainstream settings"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Learning and work"</span>,</span>
<span id="cb1-114">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"services|specialist|programs and activities"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Service access"</span>,</span>
<span id="cb1-115">    <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Other outcomes"</span></span>
<span id="cb1-116">  )</span>
<span id="cb1-117">}</span>
<span id="cb1-118"></span>
<span id="cb1-119">classify_direction <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(indicator) {</span>
<span id="cb1-120">  text <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>(indicator)</span>
<span id="cb1-121">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb1-122">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"concerns in 6 or more|with no friends|no friends other than|unable to do .*wanted|difficulties accessing"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span></span>
<span id="cb1-123">      <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"did not have any difficulties"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lower is better"</span>,</span>
<span id="cb1-124">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"want more choice and control"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lower may be better"</span>,</span>
<span id="cb1-125">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^has the ndis|involvement with the ndis|ndis helped"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Reported improvement"</span>,</span>
<span id="cb1-126">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(text, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^%|^of those"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Higher is better"</span>,</span>
<span id="cb1-127">    <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Interpret with care"</span></span>
<span id="cb1-128">  )</span>
<span id="cb1-129">}</span>
<span id="cb1-130"></span>
<span id="cb1-131">direction_adjust_change <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(change, direction) {</span>
<span id="cb1-132">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb1-133">    direction <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lower is better"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>change,</span>
<span id="cb1-134">    direction <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Higher is better"</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> change,</span>
<span id="cb1-135">    <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span></span>
<span id="cb1-136">  )</span>
<span id="cb1-137">}</span></code></pre></div></div>
</details>
</div>
<section id="data" class="level2">
<h2 class="anchored" data-anchor-id="data">Data</h2>
<p>The two source files are the national NDIS participant outcomes extracts:</p>
<ol type="1">
<li>Baseline outcomes: current reported levels by state, respondent group and indicator.</li>
<li>Longitudinal outcomes: baseline and reassessment values for people with different numbers of plan reassessments.</li>
</ol>
<p>The main charts use the national rows only, where <code>StateCd == "ALL"</code>. Participant cohorts are shown first. Family and carer outcomes are kept as a short companion note at the end.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1">baseline_outcomes_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_named</span>(</span>
<span id="cb2-2">  page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>participant,</span>
<span id="cb2-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Baseline Outcomes data"</span>,</span>
<span id="cb2-4">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline_outcomes.csv"</span></span>
<span id="cb2-5">)</span>
<span id="cb2-6"></span>
<span id="cb2-7">longitudinal_outcomes_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_named</span>(</span>
<span id="cb2-8">  page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>participant,</span>
<span id="cb2-9">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Longitudinal Outcomes data"</span>,</span>
<span id="cb2-10">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"longitudinal_outcomes.csv"</span></span>
<span id="cb2-11">)</span>
<span id="cb2-12"></span>
<span id="cb2-13">baseline_raw <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_csv</span>(</span>
<span id="cb2-14">  baseline_outcomes_path,</span>
<span id="cb2-15">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NA"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"na"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n/a"</span>),</span>
<span id="cb2-16">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">show_col_types =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb2-17">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb2-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">report_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dmy</span>(rprtdt),</span>
<span id="cb2-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">percentage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_rate</span>(percentage),</span>
<span id="cb2-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cohort_label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">factor</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_cohort</span>(questionnaire), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">levels =</span> cohort_levels),</span>
<span id="cb2-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcome_theme =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">classify_outcome_theme</span>(indicator_description),</span>
<span id="cb2-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">direction =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">classify_direction</span>(indicator_description),</span>
<span id="cb2-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">respondent_type =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(questionnaire, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Participant"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participant"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Family/carer"</span>)</span>
<span id="cb2-26">  )</span>
<span id="cb2-27"></span>
<span id="cb2-28">longitudinal_raw <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_csv</span>(</span>
<span id="cb2-29">  longitudinal_outcomes_path,</span>
<span id="cb2-30">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NA"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"na"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n/a"</span>),</span>
<span id="cb2-31">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">show_col_types =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span></span>
<span id="cb2-32">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-33">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-34">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb2-35">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">report_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dmy</span>(rprtdt),</span>
<span id="cb2-36">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">starts_with</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"percentage_"</span>), as_rate),</span>
<span id="cb2-37">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cohort_label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">factor</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_cohort</span>(questionnaire), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">levels =</span> cohort_levels),</span>
<span id="cb2-38">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcome_theme =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">classify_outcome_theme</span>(indicator_description),</span>
<span id="cb2-39">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">direction =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">classify_direction</span>(indicator_description),</span>
<span id="cb2-40">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">respondent_type =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(questionnaire, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Participant"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participant"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Family/carer"</span>)</span>
<span id="cb2-41">  )</span>
<span id="cb2-42"></span>
<span id="cb2-43">participant_baseline <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> baseline_raw <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-44">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(statecd <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, respondent_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participant"</span>)</span>
<span id="cb2-45"></span>
<span id="cb2-46">participant_longitudinal <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> longitudinal_raw <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-47">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(statecd <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, respondent_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participant"</span>)</span>
<span id="cb2-48"></span>
<span id="cb2-49">family_longitudinal <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> longitudinal_raw <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-50">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(statecd <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, respondent_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Family/carer"</span>)</span>
<span id="cb2-51"></span>
<span id="cb2-52">source_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb2-53">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">file =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Baseline outcomes"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Longitudinal outcomes"</span>),</span>
<span id="cb2-54">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">report_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(baseline_raw<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>report_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(longitudinal_raw<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>report_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)),</span>
<span id="cb2-55">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">national_participant_rows =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(participant_baseline), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(participant_longitudinal)),</span>
<span id="cb2-56">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_cohorts =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(participant_baseline<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>cohort_label), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(participant_longitudinal<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>cohort_label))</span>
<span id="cb2-57">)</span></code></pre></div></div>
</details>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">source_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb3-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">report_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format</span>(report_date, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%d %B %Y"</span>),</span>
<span id="cb3-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">national_participant_rows =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(national_participant_rows)</span>
<span id="cb3-5">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 26%">
<col style="width: 17%">
<col style="width: 31%">
<col style="width: 24%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">file</th>
<th style="text-align: left;">report_date</th>
<th style="text-align: left;">national_participant_rows</th>
<th style="text-align: right;">participant_cohorts</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Baseline outcomes</td>
<td style="text-align: left;">31 March 2026</td>
<td style="text-align: left;">42</td>
<td style="text-align: right;">4</td>
</tr>
<tr class="even">
<td style="text-align: left;">Longitudinal outcomes</td>
<td style="text-align: left;">31 March 2026</td>
<td style="text-align: left;">670</td>
<td style="text-align: right;">4</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="what-outcomes-are-measured" class="level2">
<h2 class="anchored" data-anchor-id="what-outcomes-are-measured">What Outcomes Are Measured?</h2>
<p>The participant files cover four broad age cohorts. The outcomes are not identical across ages: early-childhood items focus on development and communication, school-age items add education and independence, and adult items add choice, home, health, education, work and volunteering.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">participant_outcome_map <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(</span>
<span id="cb4-2">  participant_baseline <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(cohort_label, outcome_theme, indicator_description, direction),</span>
<span id="cb4-4">  participant_longitudinal <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(cohort_label, outcome_theme, indicator_description, direction)</span>
<span id="cb4-6">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>()</span>
<span id="cb4-8"></span>
<span id="cb4-9">outcome_theme_table <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> participant_outcome_map <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(cohort_label, outcome_theme) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb4-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcomes =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(indicator_description),</span>
<span id="cb4-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">example_outcomes =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(indicator_description), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"; "</span>),</span>
<span id="cb4-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb4-15">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(cohort_label, outcome_theme)</span>
<span id="cb4-17"></span>
<span id="cb4-18">outcome_theme_table <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cohort_label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(cohort_label)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col.names =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Cohort"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Outcome theme"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Outcomes"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Example outcomes"</span>))</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 5%">
<col style="width: 10%">
<col style="width: 3%">
<col style="width: 80%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">Cohort</th>
<th style="text-align: left;">Outcome theme</th>
<th style="text-align: right;">Outcomes</th>
<th style="text-align: left;">Example outcomes</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Communication</td>
<td style="text-align: right;">2</td>
<td style="text-align: left;">% who say their child is able to tell them what he/she wants; Has the NDIS helped increase your child’s ability to communicate what they want?</td>
</tr>
<tr class="even">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: right;">2</td>
<td style="text-align: left;">% with concerns in 6 or more of the areas: gross motor skills, fine motor skills, self-care, eating, social interaction, communication, cognitive development, sensory processing; Has the NDIS improved your child’s development?</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">% of children who can make friends with people outside the family; % of children who participate in age appropriate community, cultural or religious activities</td>
</tr>
<tr class="even">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Service access</td>
<td style="text-align: right;">1</td>
<td style="text-align: left;">Has the NDIS improved your child’s access to specialist services?</td>
</tr>
<tr class="odd">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: right;">1</td>
<td style="text-align: left;">% of children who have a genuine say in decisions about themselves</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: right;">3</td>
<td style="text-align: left;">% developing functional, learning and coping skills appropriate to their ability and circumstances; % who say their child is becoming more independent</td>
</tr>
<tr class="odd">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: right;">2</td>
<td style="text-align: left;">% of children attending school in a mainstream class; Has the NDIS improved your child’s access to education?</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: right;">7</td>
<td style="text-align: left;">% of children who can make friends with people outside the family; % of children who spend time after school and on weekends with friends and/or in mainstream programs</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: right;">6</td>
<td style="text-align: left;">% who are happy with the level of independence/control they have now; % who choose who supports them</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: right;">1</td>
<td style="text-align: left;">Has the NDIS helped you with daily living activities?</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: right;">3</td>
<td style="text-align: left;">% who rate their health as good, very good or excellent; % who did not have any difficulties accessing health services</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: right;">3</td>
<td style="text-align: left;">% who are happy with their home; % who feel safe or very safe in their home</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">% who currently attend or previously attended school in a mainstream class; % who have a paid job</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: right;">4</td>
<td style="text-align: left;">% with no friends other than family or paid staff; % who have been actively involved in a community, cultural or religious group in the last 12 months</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">% who choose who supports them; % who choose what they do each day</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: right;">2</td>
<td style="text-align: left;">% who participate in education, training or skill development; Has the NDIS helped you with daily living activities?</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: right;">3</td>
<td style="text-align: left;">% who rate their health as good, very good or excellent; % who did not have any difficulties accessing health services</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: right;">3</td>
<td style="text-align: left;">% who are happy with their home; % who feel safe or very safe in their home</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: right;">6</td>
<td style="text-align: left;">Of those who participate, % who do so in mainstream settings; % unable to do a course or training they wanted to do in the last 12 months</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: right;">4</td>
<td style="text-align: left;">% with no friends other than family or paid staff; % who have been actively involved in a community, cultural or religious group in the last 12 months</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The direction labels are deliberately conservative. Most percentage items are easier to read as higher is better, but some indicators are clearly negative: concerns in many areas, having no friends other than family or paid staff, or being unable to do a course or training the participant wanted to do.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">participant_outcome_map <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">count</span>(direction, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sort =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">name =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outcomes"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col.names =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Direction label"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Outcome rows"</span>))</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">Direction label</th>
<th style="text-align: right;">Outcome rows</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Higher is better</td>
<td style="text-align: right;">35</td>
</tr>
<tr class="even">
<td style="text-align: left;">Reported improvement</td>
<td style="text-align: right;">25</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Lower is better</td>
<td style="text-align: right;">4</td>
</tr>
<tr class="even">
<td style="text-align: left;">Interpret with care</td>
<td style="text-align: right;">2</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Lower may be better</td>
<td style="text-align: right;">2</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="current-levels" class="level2">
<h2 class="anchored" data-anchor-id="current-levels">Current Levels</h2>
<p>The baseline file gives the latest national level for each participant indicator. This is the best starting point before asking whether anything changed.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">baseline_theme_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> participant_baseline <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(cohort_label, outcome_theme) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcomes =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(indicator_description),</span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_level =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(percentage),</span>
<span id="cb6-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">p25 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(percentage, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb6-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">p75 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(percentage, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb6-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb6-9">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(median_level))</span>
<span id="cb6-11"></span>
<span id="cb6-12">baseline_theme_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_reorder</span>(outcome_theme, median_level), median_level)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb6-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_col</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#2f6f73"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb6-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_errorbar</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ymin =</span> p25, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ymax =</span> p75), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">width =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey35"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb6-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_flip</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb6-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> cohort_label, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scales =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_y"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb6-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb6-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Baseline percentage"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-outcomes-spend-service-access/index_files/figure-html/baseline-theme-summary-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Median national baseline outcome level by participant cohort and outcome theme.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">participant_baseline <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb7-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(cohort_label, outcome_theme, indicator_number) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb7-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb7-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Cohort =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(cohort_label),</span>
<span id="cb7-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Theme =</span> outcome_theme,</span>
<span id="cb7-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Outcome =</span> indicator_description,</span>
<span id="cb7-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Direction =</span> direction,</span>
<span id="cb7-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Level =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(percentage, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb7-9">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb7-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 6%">
<col style="width: 11%">
<col style="width: 71%">
<col style="width: 8%">
<col style="width: 2%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">Cohort</th>
<th style="text-align: left;">Theme</th>
<th style="text-align: left;">Outcome</th>
<th style="text-align: left;">Direction</th>
<th style="text-align: left;">Level</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Communication</td>
<td style="text-align: left;">% who say their child is able to tell them what he/she wants</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">68%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">% with concerns in 6 or more of the areas: gross motor skills, fine motor skills, self-care, eating, social interaction, communication, cognitive development, sensory processing</td>
<td style="text-align: left;">Lower is better</td>
<td style="text-align: left;">67%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% of children who can make friends with people outside the family</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">56%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% of children who participate in age appropriate community, cultural or religious activities</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">47%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">Of these, % who are welcomed or actively included</td>
<td style="text-align: left;">Interpret with care</td>
<td style="text-align: left;">63%</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% of children who have a genuine say in decisions about themselves</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">79%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">% developing functional, learning and coping skills appropriate to their ability and circumstances</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">24%</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">% who say their child is becoming more independent</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">39%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% of children attending school in a mainstream class</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">78%</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% of children who can make friends with people outside the family</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">66%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% of children who spend time after school and on weekends with friends and/or in mainstream programs</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">42%</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">Of these, % who are welcomed or actively included</td>
<td style="text-align: left;">Interpret with care</td>
<td style="text-align: left;">74%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% of children who spend time with friends without an adult present</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">13%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who are happy with the level of independence/control they have now</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">30%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who choose who supports them</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">41%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who choose what they do each day</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">51%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who had been given the opportunity to participate in a self-advocacy group meeting</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">19%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who want more choice and control in their life</td>
<td style="text-align: left;">Lower may be better</td>
<td style="text-align: left;">82%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: left;">% who rate their health as good, very good or excellent</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">64%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: left;">% who did not have any difficulties accessing health services</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">65%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: left;">% who are happy with their home</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">78%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: left;">% who feel safe or very safe in their home</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">84%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% who currently attend or previously attended school in a mainstream class</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">46%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% who have a paid job</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">18%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% who volunteer</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">9%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% with no friends other than family or paid staff</td>
<td style="text-align: left;">Lower is better</td>
<td style="text-align: left;">33%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% who have been actively involved in a community, cultural or religious group in the last 12 months</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">28%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who choose who supports them</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">66%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who choose what they do each day</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">73%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who had been given the opportunity to participate in a self-advocacy group meeting</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">24%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who want more choice and control in their life</td>
<td style="text-align: left;">Lower may be better</td>
<td style="text-align: left;">78%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">% who participate in education, training or skill development</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: left;">% who rate their health as good, very good or excellent</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">39%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: left;">% who did not have any difficulties accessing health services</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">59%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: left;">% who are happy with their home</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">67%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: left;">% who feel safe or very safe in their home</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">67%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">Of those who participate, % who do so in mainstream settings</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">69%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% unable to do a course or training they wanted to do in the last 12 months</td>
<td style="text-align: left;">Lower is better</td>
<td style="text-align: left;">36%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% who have a paid job</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">23%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% who volunteer</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">10%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% with no friends other than family or paid staff</td>
<td style="text-align: left;">Lower is better</td>
<td style="text-align: left;">34%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% who have been actively involved in a community, cultural or religious group in the last 12 months</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">30%</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>At baseline, the adult indicators show some obvious gaps as well as strengths. For example, many adults report choice over daily decisions and supports, but paid work and volunteering are much lower-level outcomes. For children, the outcome set is different: it is more about development, communication, friendships, community inclusion and school.</p>
</section>
<section id="change-after-reassessment" class="level2">
<h2 class="anchored" data-anchor-id="change-after-reassessment">Change After Reassessment</h2>
<p>The cleanest first longitudinal comparison is baseline to reassessment 1 among national participant rows with one plan reassessment. This keeps the comparison simple and avoids mixing people with very different reassessment histories.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">participant_reassessment1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> participant_longitudinal <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb8-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(number_of_plan_reassessments <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb8-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb8-4">    cohort_label,</span>
<span id="cb8-5">    outcome_theme,</span>
<span id="cb8-6">    indicator_number,</span>
<span id="cb8-7">    indicator_description,</span>
<span id="cb8-8">    direction,</span>
<span id="cb8-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">baseline =</span> percentage_baseline,</span>
<span id="cb8-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">reassessment_1 =</span> percentage_reassessment_1,</span>
<span id="cb8-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">raw_change =</span> reassessment_1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> baseline,</span>
<span id="cb8-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">direction_adjusted_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">direction_adjust_change</span>(raw_change, direction)</span>
<span id="cb8-13">  )</span>
<span id="cb8-14"></span>
<span id="cb8-15">comparable_reassessment1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> participant_reassessment1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb8-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(baseline), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(reassessment_1), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(direction_adjusted_change))</span></code></pre></div></div>
</details>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">reassessment1_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> comparable_reassessment1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(cohort_label, outcome_theme) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcomes =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(indicator_description),</span>
<span id="cb9-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(direction_adjusted_change),</span>
<span id="cb9-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">p25 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(direction_adjusted_change, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb9-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">p75 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(direction_adjusted_change, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb9-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb9-9">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(median_change))</span>
<span id="cb9-11"></span>
<span id="cb9-12">reassessment1_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_reorder</span>(outcome_theme, median_change), median_change)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey60"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_col</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#7a5c2e"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_errorbar</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ymin =</span> p25, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ymax =</span> p75), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">width =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey35"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_flip</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> cohort_label, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scales =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_y"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Direction-adjusted percentage-point change"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-outcomes-spend-service-access/index_files/figure-html/reassessment-one-summary-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Median direction-adjusted change from baseline to reassessment 1.</figcaption>
</figure>
</div>
</div>
</div>
<p>Most of the comparable indicators move in a favourable direction after the first reassessment, but the size varies. The table below keeps the raw baseline and reassessment percentages visible, then adds a direction-adjusted change only where the direction is clear.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">comparable_reassessment1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">abs_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(direction_adjusted_change)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(abs_change)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb10-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Cohort =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(cohort_label),</span>
<span id="cb10-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Theme =</span> outcome_theme,</span>
<span id="cb10-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Outcome =</span> indicator_description,</span>
<span id="cb10-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Direction =</span> direction,</span>
<span id="cb10-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Baseline =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(baseline, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb10-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Reassessment 1</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(reassessment_1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb10-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Raw change</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(raw_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb10-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Adjusted change</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(direction_adjusted_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb10-14">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 5%">
<col style="width: 9%">
<col style="width: 61%">
<col style="width: 5%">
<col style="width: 3%">
<col style="width: 5%">
<col style="width: 3%">
<col style="width: 5%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">Cohort</th>
<th style="text-align: left;">Theme</th>
<th style="text-align: left;">Outcome</th>
<th style="text-align: left;">Direction</th>
<th style="text-align: left;">Baseline</th>
<th style="text-align: left;">Reassessment 1</th>
<th style="text-align: left;">Raw change</th>
<th style="text-align: left;">Adjusted change</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Communication</td>
<td style="text-align: left;">% who say their child is able to tell them what he/she wants</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">62%</td>
<td style="text-align: left;">77%</td>
<td style="text-align: left;">15.0%</td>
<td style="text-align: left;">15.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% of children who can make friends with people outside the family</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">49%</td>
<td style="text-align: left;">59%</td>
<td style="text-align: left;">10.0%</td>
<td style="text-align: left;">10.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">% with concerns in 6 or more of the areas: gross motor skills, fine motor skills, self-care, eating, social interaction, communication, cognitive development, sensory processing</td>
<td style="text-align: left;">Lower is better</td>
<td style="text-align: left;">69%</td>
<td style="text-align: left;">76%</td>
<td style="text-align: left;">7.0%</td>
<td style="text-align: left;">-7.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">% who say their child is becoming more independent</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">43%</td>
<td style="text-align: left;">49%</td>
<td style="text-align: left;">6.0%</td>
<td style="text-align: left;">6.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% who have a paid job</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">15%</td>
<td style="text-align: left;">19%</td>
<td style="text-align: left;">4.0%</td>
<td style="text-align: left;">4.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% of children attending school in a mainstream class</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">81%</td>
<td style="text-align: left;">78%</td>
<td style="text-align: left;">-3.0%</td>
<td style="text-align: left;">-3.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who are happy with the level of independence/control they have now</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">29%</td>
<td style="text-align: left;">32%</td>
<td style="text-align: left;">3.0%</td>
<td style="text-align: left;">3.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who choose who supports them</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">36%</td>
<td style="text-align: left;">39%</td>
<td style="text-align: left;">3.0%</td>
<td style="text-align: left;">3.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% who have been actively involved in a community, cultural or religious group in the last 12 months</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">29%</td>
<td style="text-align: left;">32%</td>
<td style="text-align: left;">3.0%</td>
<td style="text-align: left;">3.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who choose what they do each day</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">46%</td>
<td style="text-align: left;">49%</td>
<td style="text-align: left;">3.0%</td>
<td style="text-align: left;">3.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% who have been actively involved in a community, cultural or religious group in the last 12 months</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">28%</td>
<td style="text-align: left;">31%</td>
<td style="text-align: left;">3.0%</td>
<td style="text-align: left;">3.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% of children who can make friends with people outside the family</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">67%</td>
<td style="text-align: left;">70%</td>
<td style="text-align: left;">3.0%</td>
<td style="text-align: left;">3.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: left;">% who did not have any difficulties accessing health services</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">70%</td>
<td style="text-align: left;">72%</td>
<td style="text-align: left;">2.0%</td>
<td style="text-align: left;">2.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: left;">% who are happy with their home</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">66%</td>
<td style="text-align: left;">68%</td>
<td style="text-align: left;">2.0%</td>
<td style="text-align: left;">2.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: left;">% who did not have any difficulties accessing health services</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">59%</td>
<td style="text-align: left;">61%</td>
<td style="text-align: left;">2.0%</td>
<td style="text-align: left;">2.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% unable to do a course or training they wanted to do in the last 12 months</td>
<td style="text-align: left;">Lower is better</td>
<td style="text-align: left;">37%</td>
<td style="text-align: left;">35%</td>
<td style="text-align: left;">-2.0%</td>
<td style="text-align: left;">2.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% of children who participate in age appropriate community, cultural or religious activities</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">45%</td>
<td style="text-align: left;">47%</td>
<td style="text-align: left;">2.0%</td>
<td style="text-align: left;">2.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">% developing functional, learning and coping skills appropriate to their ability and circumstances</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">28%</td>
<td style="text-align: left;">30%</td>
<td style="text-align: left;">2.0%</td>
<td style="text-align: left;">2.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% of children who have a genuine say in decisions about themselves</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">79%</td>
<td style="text-align: left;">80%</td>
<td style="text-align: left;">1.0%</td>
<td style="text-align: left;">1.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% of children who spend time after school and on weekends with friends and/or in mainstream programs</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">38%</td>
<td style="text-align: left;">39%</td>
<td style="text-align: left;">1.0%</td>
<td style="text-align: left;">1.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% with no friends other than family or paid staff</td>
<td style="text-align: left;">Lower is better</td>
<td style="text-align: left;">34%</td>
<td style="text-align: left;">33%</td>
<td style="text-align: left;">-1.0%</td>
<td style="text-align: left;">1.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: left;">% who rate their health as good, very good or excellent</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">67%</td>
<td style="text-align: left;">66%</td>
<td style="text-align: left;">-1.0%</td>
<td style="text-align: left;">-1.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% who currently attend or previously attended school in a mainstream class</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">46%</td>
<td style="text-align: left;">45%</td>
<td style="text-align: left;">-1.0%</td>
<td style="text-align: left;">-1.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who choose what they do each day</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">74%</td>
<td style="text-align: left;">75%</td>
<td style="text-align: left;">1.0%</td>
<td style="text-align: left;">1.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: left;">% who feel safe or very safe in their home</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">64%</td>
<td style="text-align: left;">65%</td>
<td style="text-align: left;">1.0%</td>
<td style="text-align: left;">1.0%</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Some longitudinal items ask directly whether the NDIS helped or improved something. These do not have a meaningful baseline percentage, so they are better read as reassessment-level responses rather than baseline-to-reassessment changes.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">direct_improvement_items <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> participant_reassessment1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(baseline), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(reassessment_1), direction <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Reported improvement"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(cohort_label, outcome_theme, indicator_number)</span>
<span id="cb11-4"></span>
<span id="cb11-5">direct_improvement_items <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb11-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Cohort =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(cohort_label),</span>
<span id="cb11-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Theme =</span> outcome_theme,</span>
<span id="cb11-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Outcome =</span> indicator_description,</span>
<span id="cb11-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Reported improvement at reassessment 1</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(reassessment_1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb11-11">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 7%">
<col style="width: 14%">
<col style="width: 58%">
<col style="width: 19%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">Cohort</th>
<th style="text-align: left;">Theme</th>
<th style="text-align: left;">Outcome</th>
<th style="text-align: left;">Reported improvement at reassessment 1</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Communication</td>
<td style="text-align: left;">Has the NDIS helped increase your child’s ability to communicate what they want?</td>
<td style="text-align: left;">85%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">Has the NDIS improved your child’s development?</td>
<td style="text-align: left;">92%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">Has the NDIS improved how your child fits into family life?</td>
<td style="text-align: left;">84%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">Has the NDIS improved how your child fits into community life?</td>
<td style="text-align: left;">71%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Service access</td>
<td style="text-align: left;">Has the NDIS improved your child’s access to specialist services?</td>
<td style="text-align: left;">93%</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">Has the NDIS helped your child to become more independent?</td>
<td style="text-align: left;">72%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">Has the NDIS improved your child’s access to education?</td>
<td style="text-align: left;">53%</td>
</tr>
<tr class="even">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">Has the NDIS improved your child’s relationships with family and friends?</td>
<td style="text-align: left;">63%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">Has the NDIS improved your child’s social and recreational life?</td>
<td style="text-align: left;">57%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">Has the NDIS helped you have more choices and more control over your life?</td>
<td style="text-align: left;">69%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">Has the NDIS helped you with daily living activities?</td>
<td style="text-align: left;">66%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: left;">Has your involvement with the NDIS improved your health and wellbeing?</td>
<td style="text-align: left;">52%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: left;">Has your involvement with the NDIS helped you to choose a home that’s right for you?</td>
<td style="text-align: left;">27%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">Has your involvement with the NDIS helped you to learn things you want to learn or to take courses you want to take?</td>
<td style="text-align: left;">39%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">Has your involvement with the NDIS helped you find a job that’s right for you?</td>
<td style="text-align: left;">23%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">Has the NDIS helped you to meet more people?</td>
<td style="text-align: left;">50%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">Has the NDIS helped you be more involved?</td>
<td style="text-align: left;">58%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">Has the NDIS helped you have more choices and more control over your life?</td>
<td style="text-align: left;">78%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">Has the NDIS helped you with daily living activities?</td>
<td style="text-align: left;">80%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: left;">Has your involvement with the NDIS improved your health and wellbeing?</td>
<td style="text-align: left;">62%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: left;">Has your involvement with the NDIS helped you to choose a home that’s right for you?</td>
<td style="text-align: left;">36%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">Has your involvement with the NDIS helped you to learn things you want to learn or to take courses you want to take?</td>
<td style="text-align: left;">33%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">Has your involvement with the NDIS helped you find a job that’s right for you?</td>
<td style="text-align: left;">21%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">Has the NDIS helped you to meet more people?</td>
<td style="text-align: left;">57%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">Has the NDIS helped you be more involved?</td>
<td style="text-align: left;">65%</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="later-reassessments" class="level2">
<h2 class="anchored" data-anchor-id="later-reassessments">Later Reassessments</h2>
<p>The longitudinal file also includes reassessment 2 and later columns. Those are useful as a rough trend, but they should be read carefully: later reassessment rows are not a clean participant-level panel in this public extract, and the mix of participants changes as reassessment history gets longer.</p>
<p>For the later windows below, “reassessment 5” means the group with five plan reassessments, comparing its baseline value with its reassessment 5 value. It is a useful descriptive window, but it should not be read as the exact same participants shown in the reassessment 1 chart.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">reassessment_cols <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(participant_longitudinal) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">keep</span>(\(nm) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(nm, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^percentage_reassessment_"</span>))</span>
<span id="cb12-3"></span>
<span id="cb12-4">participant_trend <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> participant_longitudinal <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb12-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(percentage_baseline),</span>
<span id="cb12-7">    direction <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Higher is better"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lower is better"</span>)</span>
<span id="cb12-8">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_longer</span>(</span>
<span id="cb12-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">all_of</span>(reassessment_cols),</span>
<span id="cb12-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reassessment"</span>,</span>
<span id="cb12-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reassessment_value"</span></span>
<span id="cb12-13">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb12-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">reassessment_number =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_extract</span>(reassessment, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"[0-9]+"</span>)),</span>
<span id="cb12-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">raw_change =</span> reassessment_value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> percentage_baseline,</span>
<span id="cb12-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">direction_adjusted_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">direction_adjust_change</span>(raw_change, direction)</span>
<span id="cb12-18">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb12-20">    reassessment_number <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> number_of_plan_reassessments,</span>
<span id="cb12-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(direction_adjusted_change)</span>
<span id="cb12-22">  )</span>
<span id="cb12-23"></span>
<span id="cb12-24">trend_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> participant_trend <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(reassessment_number) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb12-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rows =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(),</span>
<span id="cb12-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcome_cohort_pairs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_c</span>(cohort_label, indicator_number, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"::"</span>)),</span>
<span id="cb12-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(direction_adjusted_change),</span>
<span id="cb12-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">p25 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(direction_adjusted_change, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb12-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">p75 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(direction_adjusted_change, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb12-32">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb12-33">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-34">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(rows <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>)</span>
<span id="cb12-35"></span>
<span id="cb12-36"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(trend_summary) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb12-37">  trend_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-38">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(reassessment_number, median_change)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-39">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey60"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-40">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_ribbon</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ymin =</span> p25, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ymax =</span> p75), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#b7c7a3"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.45</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-41">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#395f3b"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-42">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#395f3b"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-43">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> trend_summary<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>reassessment_number) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-44">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-45">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Reassessment number"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Direction-adjusted change from baseline"</span>)</span>
<span id="cb12-46">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb12-47">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"There are not enough later reassessment rows to draw a stable trend."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-48">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb12-49">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-outcomes-spend-service-access/index_files/figure-html/later-reassessment-trend-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Median direction-adjusted change by reassessment number.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">trend_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb13-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Reassessment =</span> reassessment_number,</span>
<span id="cb13-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Rows =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(rows),</span>
<span id="cb13-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Outcome/cohort pairs</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> outcome_cohort_pairs,</span>
<span id="cb13-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Median adjusted change</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(median_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb13-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">25th percentile</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(p25, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb13-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">75th percentile</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(p75, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb13-9">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 13%">
<col style="width: 5%">
<col style="width: 22%">
<col style="width: 24%">
<col style="width: 17%">
<col style="width: 17%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: right;">Reassessment</th>
<th style="text-align: left;">Rows</th>
<th style="text-align: right;">Outcome/cohort pairs</th>
<th style="text-align: left;">Median adjusted change</th>
<th style="text-align: left;">25th percentile</th>
<th style="text-align: left;">75th percentile</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: right;">1</td>
<td style="text-align: left;">39</td>
<td style="text-align: right;">39</td>
<td style="text-align: left;">1.0%</td>
<td style="text-align: left;">0.0%</td>
<td style="text-align: left;">2.5%</td>
</tr>
<tr class="even">
<td style="text-align: right;">2</td>
<td style="text-align: left;">39</td>
<td style="text-align: right;">39</td>
<td style="text-align: left;">1.0%</td>
<td style="text-align: left;">0.0%</td>
<td style="text-align: left;">3.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">3</td>
<td style="text-align: left;">39</td>
<td style="text-align: right;">39</td>
<td style="text-align: left;">1.0%</td>
<td style="text-align: left;">-0.5%</td>
<td style="text-align: left;">5.5%</td>
</tr>
<tr class="even">
<td style="text-align: right;">4</td>
<td style="text-align: left;">39</td>
<td style="text-align: right;">39</td>
<td style="text-align: left;">2.0%</td>
<td style="text-align: left;">-1.0%</td>
<td style="text-align: left;">7.5%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">5</td>
<td style="text-align: left;">39</td>
<td style="text-align: right;">39</td>
<td style="text-align: left;">2.0%</td>
<td style="text-align: left;">-1.0%</td>
<td style="text-align: left;">8.5%</td>
</tr>
<tr class="even">
<td style="text-align: right;">6</td>
<td style="text-align: left;">35</td>
<td style="text-align: right;">35</td>
<td style="text-align: left;">2.0%</td>
<td style="text-align: left;">-1.0%</td>
<td style="text-align: left;">7.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">7</td>
<td style="text-align: left;">35</td>
<td style="text-align: right;">35</td>
<td style="text-align: left;">2.0%</td>
<td style="text-align: left;">-1.0%</td>
<td style="text-align: left;">8.5%</td>
</tr>
<tr class="even">
<td style="text-align: right;">8</td>
<td style="text-align: left;">34</td>
<td style="text-align: right;">34</td>
<td style="text-align: left;">0.5%</td>
<td style="text-align: left;">-1.7%</td>
<td style="text-align: left;">9.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">9</td>
<td style="text-align: left;">27</td>
<td style="text-align: right;">27</td>
<td style="text-align: left;">3.0%</td>
<td style="text-align: left;">-1.0%</td>
<td style="text-align: left;">12.5%</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>To make the later reassessment pattern easier to read, the next chart repeats the reassessment 1 idea for two later windows: one around the middle of the available reassessment history, and the latest window with enough comparable outcome rows.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">later_windows <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> trend_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(reassessment_number <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(reassessment_number)</span>
<span id="cb14-4"></span>
<span id="cb14-5">selected_later_reassessments <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(later_windows) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb14-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb14-7">    later_windows<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>reassessment_number[[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ceiling</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(later_windows) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)]],</span>
<span id="cb14-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(later_windows<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>reassessment_number)</span>
<span id="cb14-9">  ))</span>
<span id="cb14-10">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb14-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">integer</span>()</span>
<span id="cb14-12">}</span>
<span id="cb14-13"></span>
<span id="cb14-14">selected_later_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> participant_trend <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(reassessment_number <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> selected_later_reassessments) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">window =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Reassessment "</span>, reassessment_number)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(window, reassessment_number, cohort_label, outcome_theme) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb14-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rows =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(),</span>
<span id="cb14-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(direction_adjusted_change),</span>
<span id="cb14-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">p25 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(direction_adjusted_change, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb14-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">p75 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(direction_adjusted_change, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb14-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb14-24">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(median_change)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cohort_theme =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_c</span>(cohort_label, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">": "</span>, outcome_theme))</span>
<span id="cb14-27"></span>
<span id="cb14-28"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(selected_later_summary) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb14-29">  selected_later_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-30">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_reorder</span>(cohort_theme, median_change), median_change)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-31">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey60"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-32">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_col</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#7a5c2e"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-33">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_errorbar</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ymin =</span> p25, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ymax =</span> p75), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">width =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey35"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-34">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_flip</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-35">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> window, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scales =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_y"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ncol =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-36">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-37">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Direction-adjusted percentage-point change"</span>)</span>
<span id="cb14-38">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb14-39">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"There are not enough later reassessment windows to draw selected comparisons."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-40">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb14-41">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-outcomes-spend-service-access/index_files/figure-html/selected-later-reassessment-summary-1.png" class="img-fluid figure-img" width="960"></p>
<figcaption>Direction-adjusted change for middle and latest reassessment windows.</figcaption>
</figure>
</div>
</div>
</div>
<p>The detailed table keeps the raw baseline and later reassessment values visible. Positive adjusted changes mean the result moved in the favourable direction after accounting for whether a higher or lower raw percentage is better.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">participant_trend <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(reassessment_number <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> selected_later_reassessments) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">abs_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(direction_adjusted_change)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(reassessment_number) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_max</span>(abs_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">with_ties =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(reassessment_number, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(abs_change)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb15-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Reassessment =</span> reassessment_number,</span>
<span id="cb15-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Cohort =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(cohort_label),</span>
<span id="cb15-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Theme =</span> outcome_theme,</span>
<span id="cb15-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Outcome =</span> indicator_description,</span>
<span id="cb15-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Direction =</span> direction,</span>
<span id="cb15-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Baseline =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(percentage_baseline, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb15-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Selected reassessment</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(reassessment_value, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb15-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Raw change</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(raw_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb15-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Adjusted change</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(direction_adjusted_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb15-18">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 4%">
<col style="width: 5%">
<col style="width: 9%">
<col style="width: 57%">
<col style="width: 5%">
<col style="width: 2%">
<col style="width: 7%">
<col style="width: 3%">
<col style="width: 5%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: right;">Reassessment</th>
<th style="text-align: left;">Cohort</th>
<th style="text-align: left;">Theme</th>
<th style="text-align: left;">Outcome</th>
<th style="text-align: left;">Direction</th>
<th style="text-align: left;">Baseline</th>
<th style="text-align: left;">Selected reassessment</th>
<th style="text-align: left;">Raw change</th>
<th style="text-align: left;">Adjusted change</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: right;">5</td>
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Communication</td>
<td style="text-align: left;">% who say their child is able to tell them what he/she wants</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">17%</td>
<td style="text-align: left;">72%</td>
<td style="text-align: left;">55.0%</td>
<td style="text-align: left;">55.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">5</td>
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% of children who can make friends with people outside the family</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">35%</td>
<td style="text-align: left;">67%</td>
<td style="text-align: left;">32.0%</td>
<td style="text-align: left;">32.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">5</td>
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">% with concerns in 6 or more of the areas: gross motor skills, fine motor skills, self-care, eating, social interaction, communication, cognitive development, sensory processing</td>
<td style="text-align: left;">Lower is better</td>
<td style="text-align: left;">49%</td>
<td style="text-align: left;">79%</td>
<td style="text-align: left;">30.0%</td>
<td style="text-align: left;">-30.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">5</td>
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% who have a paid job</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">7%</td>
<td style="text-align: left;">27%</td>
<td style="text-align: left;">20.0%</td>
<td style="text-align: left;">20.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">5</td>
<td style="text-align: left;">Early childhood</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% of children who participate in age appropriate community, cultural or religious activities</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">35%</td>
<td style="text-align: left;">50%</td>
<td style="text-align: left;">15.0%</td>
<td style="text-align: left;">15.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">5</td>
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who choose what they do each day</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">35%</td>
<td style="text-align: left;">50%</td>
<td style="text-align: left;">15.0%</td>
<td style="text-align: left;">15.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">5</td>
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who choose who supports them</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">27%</td>
<td style="text-align: left;">41%</td>
<td style="text-align: left;">14.0%</td>
<td style="text-align: left;">14.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">5</td>
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% of children who have a genuine say in decisions about themselves</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">62%</td>
<td style="text-align: left;">74%</td>
<td style="text-align: left;">12.0%</td>
<td style="text-align: left;">12.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">5</td>
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% of children attending school in a mainstream class</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">69%</td>
<td style="text-align: left;">58%</td>
<td style="text-align: left;">-11.0%</td>
<td style="text-align: left;">-11.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">5</td>
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: left;">% who are happy with their home</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">85%</td>
<td style="text-align: left;">75%</td>
<td style="text-align: left;">-10.0%</td>
<td style="text-align: left;">-10.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">5</td>
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% unable to do a course or training they wanted to do in the last 12 months</td>
<td style="text-align: left;">Lower is better</td>
<td style="text-align: left;">38%</td>
<td style="text-align: left;">28%</td>
<td style="text-align: left;">-10.0%</td>
<td style="text-align: left;">10.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">5</td>
<td style="text-align: left;">School age</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">% who say their child is becoming more independent</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">42%</td>
<td style="text-align: left;">51%</td>
<td style="text-align: left;">9.0%</td>
<td style="text-align: left;">9.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% who have a paid job</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">3%</td>
<td style="text-align: left;">30%</td>
<td style="text-align: left;">27.0%</td>
<td style="text-align: left;">27.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who choose what they do each day</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">18%</td>
<td style="text-align: left;">42%</td>
<td style="text-align: left;">24.0%</td>
<td style="text-align: left;">24.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who choose who supports them</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">12%</td>
<td style="text-align: left;">33%</td>
<td style="text-align: left;">21.0%</td>
<td style="text-align: left;">21.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Choice and control</td>
<td style="text-align: left;">% who had been given the opportunity to participate in a self-advocacy group meeting</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">10%</td>
<td style="text-align: left;">29%</td>
<td style="text-align: left;">19.0%</td>
<td style="text-align: left;">19.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% with no friends other than family or paid staff</td>
<td style="text-align: left;">Lower is better</td>
<td style="text-align: left;">44%</td>
<td style="text-align: left;">29%</td>
<td style="text-align: left;">-15.0%</td>
<td style="text-align: left;">15.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">% unable to do a course or training they wanted to do in the last 12 months</td>
<td style="text-align: left;">Lower is better</td>
<td style="text-align: left;">34%</td>
<td style="text-align: left;">19%</td>
<td style="text-align: left;">-15.0%</td>
<td style="text-align: left;">15.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Home and safety</td>
<td style="text-align: left;">% who are happy with their home</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">94%</td>
<td style="text-align: left;">79%</td>
<td style="text-align: left;">-15.0%</td>
<td style="text-align: left;">-15.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Relationships and community</td>
<td style="text-align: left;">% who have been actively involved in a community, cultural or religious group in the last 12 months</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">36%</td>
<td style="text-align: left;">49%</td>
<td style="text-align: left;">13.0%</td>
<td style="text-align: left;">13.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Development and daily living</td>
<td style="text-align: left;">% who participate in education, training or skill development</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">22%</td>
<td style="text-align: left;">9%</td>
<td style="text-align: left;">-13.0%</td>
<td style="text-align: left;">-13.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Learning and work</td>
<td style="text-align: left;">Of those who participate, % who do so in mainstream settings</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">49%</td>
<td style="text-align: left;">61%</td>
<td style="text-align: left;">12.0%</td>
<td style="text-align: left;">12.0%</td>
</tr>
<tr class="odd">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Young people</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: left;">% who did not have any difficulties accessing health services</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">70%</td>
<td style="text-align: left;">79%</td>
<td style="text-align: left;">9.0%</td>
<td style="text-align: left;">9.0%</td>
</tr>
<tr class="even">
<td style="text-align: right;">9</td>
<td style="text-align: left;">Adults</td>
<td style="text-align: left;">Health and wellbeing</td>
<td style="text-align: left;">% who rate their health as good, very good or excellent</td>
<td style="text-align: left;">Higher is better</td>
<td style="text-align: left;">59%</td>
<td style="text-align: left;">51%</td>
<td style="text-align: left;">-8.0%</td>
<td style="text-align: left;">-8.0%</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The later-reassessment pattern is best read as directional context, not as a precise individual trajectory. Still, it helps separate the first question from the bigger spend question: the public data does show reported outcome movement after entry, even before we try to link those changes to budgets, service markets or regional access.</p>
</section>
<section id="family-and-carer-note" class="level2">
<h2 class="anchored" data-anchor-id="family-and-carer-note">Family And Carer Note</h2>
<p>Family and carer outcomes are part of the public outcomes files, but they answer a different question. They are about the circumstances of the family or carer around the participant, not the participant’s own outcome level. For this reason, they sit beside the participant story rather than inside it.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">family_reassessment1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> family_longitudinal <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(number_of_plan_reassessments <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb16-4">    cohort_label,</span>
<span id="cb16-5">    outcome_theme,</span>
<span id="cb16-6">    indicator_description,</span>
<span id="cb16-7">    direction,</span>
<span id="cb16-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">baseline =</span> percentage_baseline,</span>
<span id="cb16-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">reassessment_1 =</span> percentage_reassessment_1,</span>
<span id="cb16-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">raw_change =</span> reassessment_1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> baseline,</span>
<span id="cb16-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">direction_adjusted_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">direction_adjust_change</span>(raw_change, direction)</span>
<span id="cb16-12">  )</span>
<span id="cb16-13"></span>
<span id="cb16-14">family_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> family_reassessment1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(cohort_label) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb16-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">comparable_outcomes =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(direction_adjusted_change)),</span>
<span id="cb16-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_adjusted_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(direction_adjusted_change),</span>
<span id="cb16-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">direct_improvement_items =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(baseline) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(reassessment_1)),</span>
<span id="cb16-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_direct_improvement =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(reassessment_1[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(baseline) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(reassessment_1)]),</span>
<span id="cb16-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb16-22">  )</span>
<span id="cb16-23"></span>
<span id="cb16-24">family_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb16-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Cohort =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(cohort_label),</span>
<span id="cb16-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Comparable outcomes</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> comparable_outcomes,</span>
<span id="cb16-28">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Median adjusted change</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format_optional_percent</span>(median_adjusted_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb16-29">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Direct improvement items</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> direct_improvement_items,</span>
<span id="cb16-30">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Median direct improvement response</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format_optional_percent</span>(median_direct_improvement, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb16-31">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 19%">
<col style="width: 15%">
<col style="width: 17%">
<col style="width: 19%">
<col style="width: 27%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">Cohort</th>
<th style="text-align: right;">Comparable outcomes</th>
<th style="text-align: left;">Median adjusted change</th>
<th style="text-align: right;">Direct improvement items</th>
<th style="text-align: left;">Median direct improvement response</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Family/carer of children</td>
<td style="text-align: right;">12</td>
<td style="text-align: left;">2.0%</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">78%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Family/carer of adults</td>
<td style="text-align: right;">12</td>
<td style="text-align: left;">1.0%</td>
<td style="text-align: right;">4</td>
<td style="text-align: left;">61%</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The family and carer rows are useful, especially for questions about informal care, work, confidence, health and service access. They should not be blended with participant rows when the main question is whether participant outcomes themselves changed.</p>
</section>
<section id="caveats" class="level2">
<h2 class="anchored" data-anchor-id="caveats">Caveats</h2>
<ul>
<li>These are aggregate public survey rows, not participant-level records.</li>
<li>The reassessment comparisons are descriptive. They do not prove causation.</li>
<li>Later reassessment rows may reflect a different participant mix from earlier reassessment rows.</li>
<li>Direction-adjusting outcomes helps readability, but it does not make all indicators equally important.</li>
<li>Some items ask whether the NDIS helped or improved something. Those are reassessment responses, not true baseline-to-change measures.</li>
<li>Spend, provider access and regional service-market questions are deliberately left out of this simplified version.</li>
</ul>


<!-- -->

</section>

 ]]></description>
  <category>ndis</category>
  <category>outcomes</category>
  <category>disability</category>
  <category>australia</category>
  <guid>https://blog.aydins-workbench.com/posts/ndis-outcomes-spend-service-access/</guid>
  <pubDate>Wed, 10 Jun 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Did the 1 November 2025 Bulk Billing Changes Shift Access?</title>
  <dc:creator>Aydin </dc:creator>
  <link>https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/</link>
  <description><![CDATA[ 




<p>The 1 November 2025 bulk billing changes were designed to make it easier for general practices to bulk bill more patients. The narrowest measurable question is whether the share of GP attendances that were bulk billed moved after the change. The broader access question is harder: a higher bulk billing rate is not the same thing as more appointments, shorter waits or less delayed care.</p>
<p>This post treats access as two linked signals:</p>
<ol type="1">
<li>the GP bulk billing rate, which is the main outcome;</li>
<li>service-use and payment checks, so we do not confuse a billing-mix change with an access change.</li>
</ol>
<p>The analysis is deliberately framed as an early signal. The policy began on 1 November 2025, the AIHW dashboard is updated quarterly, and AIHW treats the last 3 months of data as preliminary.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ensure_aihw_tableau</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">refresh =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb1-2"></span>
<span id="cb1-3">manifest <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_csv</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(raw_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"aihw_tableau_manifest.csv"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">show_col_types =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb1-4"></span>
<span id="cb1-5">national <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_tableau</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"national"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_rate_sheet</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">month_index =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">interval</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(service_month), service_month) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%/%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">months</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)))</span>
<span id="cb1-8"></span>
<span id="cb1-9">age_rates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_tableau</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_rate_sheet</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group_series_alias"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Age group"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace</span>(group, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" - "</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-"</span>))</span>
<span id="cb1-12"></span>
<span id="cb1-13">seifa_rates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_tableau</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"seifa"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_rate_sheet</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"seifa_series_alias"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Socioeconomic quintile"</span>)</span>
<span id="cb1-15"></span>
<span id="cb1-16">benefits_raw <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_tableau</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"benefits"</span>)</span>
<span id="cb1-17">benefits <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> benefits_raw <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb1-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_month =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(.data[[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(benefits_raw, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^month_service_month_value$"</span>)]]),</span>
<span id="cb1-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">series =</span> .data[[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(benefits_raw, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^chart_4_series_alias$"</span>)]],</span>
<span id="cb1-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">value =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(.data[[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(benefits_raw, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^sum_pivot_field_values_value$"</span>)]])</span>
<span id="cb1-22">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service_month), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(value), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(series)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>()</span>
<span id="cb1-25"></span>
<span id="cb1-26">lga_latest <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_tableau</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"latest_lga_map"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb1-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> state1_alias,</span>
<span id="cb1-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(lga_code21_alias),</span>
<span id="cb1-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_name =</span> attr_lga_name_alias,</span>
<span id="cb1-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">latest_bulk_billing_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(sum_pivot_field_values_copy_alias),</span>
<span id="cb1-32">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_area =</span> attr_main_ra_alias,</span>
<span id="cb1-33">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">seifa_quintile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(attr_main_seifa_alias)</span>
<span id="cb1-34">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-35">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(latest_bulk_billing_rate), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(lga_code))</span>
<span id="cb1-36"></span>
<span id="cb1-37">phn_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_if_missing</span>(source_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>phn_quarterly, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(raw_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phn_bulk_billing.xlsx"</span>))</span>
<span id="cb1-38">sa3_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_if_missing</span>(source_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>sa3_quarterly, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(raw_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sa3_quarterly.xlsx"</span>))</span>
<span id="cb1-39">mmm_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_if_missing</span>(source_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>mmm_quarterly, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(raw_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mmm_quarterly.xlsx"</span>))</span>
<span id="cb1-40">pcst_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_if_missing</span>(source_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>primary_care_service_type, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(raw_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"primary_care_service_type.xlsx"</span>))</span>
<span id="cb1-41">phn_lga_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_if_missing</span>(source_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>phn_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(raw_dir, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"phn_lga_concordance.xlsx"</span>))</span>
<span id="cb1-42"></span>
<span id="cb1-43">phn_quarterly <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(phn_path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"By BTOS and PHN"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">skip =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-44">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-45">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb1-46">    state,</span>
<span id="cb1-47">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">phn =</span> primary_health_network,</span>
<span id="cb1-48">    quarter,</span>
<span id="cb1-49">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_type =</span> broad_type_of_service,</span>
<span id="cb1-50">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">phn_bulk_billing_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(mbs_bulk_billing_rate)</span>
<span id="cb1-51">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-52">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(service_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total GP Non-Referred Attendances"</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(phn_bulk_billing_rate))</span>
<span id="cb1-53"></span>
<span id="cb1-54">phn_age <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(phn_path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GP NRA by PHN and Age Group"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">skip =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-55">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-56">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(state, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">phn =</span> primary_health_network, quarter, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">contains</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bulk_billing_rate"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-57">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_longer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">contains</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bulk_billing_rate"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bulk_billing_rate"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-58">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-59">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">age_group =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb1-60">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(age_group, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"under_16"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0-15"</span>,</span>
<span id="cb1-61">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(age_group, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"16_to_64"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"16-64"</span>,</span>
<span id="cb1-62">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(age_group, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"65"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"65+"</span>,</span>
<span id="cb1-63">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(age_group, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"all_ages"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"All ages"</span>,</span>
<span id="cb1-64">      <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> age_group</span>
<span id="cb1-65">    ),</span>
<span id="cb1-66">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bulk_billing_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(bulk_billing_rate)</span>
<span id="cb1-67">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-68">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(bulk_billing_rate))</span>
<span id="cb1-69"></span>
<span id="cb1-70">sa3_visits_raw <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(sa3_path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GP NRA by SA3"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">skip =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-71">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>()</span>
<span id="cb1-72"></span>
<span id="cb1-73">sa3_visits <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sa3_visits_raw <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-74">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb1-75">    state,</span>
<span id="cb1-76">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sa3 =</span> sa3,</span>
<span id="cb1-77">    quarter,</span>
<span id="cb1-78">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quarter_to_date</span>(quarter),</span>
<span id="cb1-79">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_type =</span> broad_type_of_service,</span>
<span id="cb1-80">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(services),</span>
<span id="cb1-81">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">benefits =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(benefits),</span>
<span id="cb1-82">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bulk_billed_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(bulk_billed_services),</span>
<span id="cb1-83">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">patient_billed_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(patient_billed_services),</span>
<span id="cb1-84">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bulk_billing_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(mbs_bulk_billing_rate),</span>
<span id="cb1-85">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_patient_contribution_patient_billed =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(avg_patient_contribution_per_service_out_of_hospital_patient_billed),</span>
<span id="cb1-86">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_patient_contribution_total =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(avg_patient_contribution_per_service_out_of_hospital_total)</span>
<span id="cb1-87">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-88">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb1-89">    service_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total GP Non-Referred Attendances"</span>,</span>
<span id="cb1-90">    <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(quarter_date),</span>
<span id="cb1-91">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(services),</span>
<span id="cb1-92">    services <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb1-93">    <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span>sa3 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Australia"</span>, state),</span>
<span id="cb1-94">    <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(state, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">regex</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"unknown|other territories"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ignore_case =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)),</span>
<span id="cb1-95">    <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(sa3, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">regex</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^unknown|unknown state"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ignore_case =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))</span>
<span id="cb1-96">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-97">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-98">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sa3_key =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(state, sa3, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" - "</span>),</span>
<span id="cb1-99">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_status =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb1-100">      quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> transition_quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pre-policy"</span>,</span>
<span id="cb1-101">      quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> transition_quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Transition quarter"</span>,</span>
<span id="cb1-102">      quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> clean_post_quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Clean post-policy"</span>,</span>
<span id="cb1-103">      <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb1-104">    )</span>
<span id="cb1-105">  )</span>
<span id="cb1-106"></span>
<span id="cb1-107">sa3_exposure <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sa3_visits <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-108">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb1-109">    quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date[quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> transition_quarter_date], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%m-%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">months</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>),</span>
<span id="cb1-110">    quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> transition_quarter_date</span>
<span id="cb1-111">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-112">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(sa3_key) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-113">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb1-114">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">baseline_quarters =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(quarter_date),</span>
<span id="cb1-115">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">baseline_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(services, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb1-116">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pre_policy_bulk_billing_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">weighted_rate</span>(bulk_billed_services, services),</span>
<span id="cb1-117">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pre_policy_patient_contribution =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">weighted.mean</span>(</span>
<span id="cb1-118">      avg_patient_contribution_patient_billed,</span>
<span id="cb1-119">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">w =</span> patient_billed_services,</span>
<span id="cb1-120">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb1-121">    ),</span>
<span id="cb1-122">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb1-123">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-124">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-125">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pre_policy_non_bulk_billed_share =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pre_policy_bulk_billing_rate,</span>
<span id="cb1-126">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pre_policy_gap_10pp =</span> pre_policy_non_bulk_billed_share <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span></span>
<span id="cb1-127">  )</span>
<span id="cb1-128"></span>
<span id="cb1-129">sa3_panel <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sa3_visits <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-130">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(sa3_exposure, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sa3_key"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-131">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-132">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(services),</span>
<span id="cb1-133">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">clean_post_policy =</span> quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> clean_post_quarter_date,</span>
<span id="cb1-134">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">exposure_band =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cut</span>(</span>
<span id="cb1-135">      pre_policy_non_bulk_billed_share,</span>
<span id="cb1-136">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(pre_policy_non_bulk_billed_share, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">probs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb1-137">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">include.lowest =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb1-138">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lower room to move"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Middle"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Higher room to move"</span>)</span>
<span id="cb1-139">    ),</span>
<span id="cb1-140">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rate_check =</span> bulk_billed_services <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> services,</span>
<span id="cb1-141">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rate_difference =</span> bulk_billing_rate <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> rate_check</span>
<span id="cb1-142">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-143">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb1-144">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(pre_policy_gap_10pp),</span>
<span id="cb1-145">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(baseline_services),</span>
<span id="cb1-146">    baseline_quarters <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span></span>
<span id="cb1-147">  )</span>
<span id="cb1-148"></span>
<span id="cb1-149">mmm_visits <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(mmm_path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"All Services"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">skip =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-150">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-151">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb1-152">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">modified_monash =</span> modified_monash_group,</span>
<span id="cb1-153">    quarter,</span>
<span id="cb1-154">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quarter_to_date</span>(quarter),</span>
<span id="cb1-155">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_type =</span> broad_type_of_service,</span>
<span id="cb1-156">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(services),</span>
<span id="cb1-157">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bulk_billed_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(bulk_billed_services),</span>
<span id="cb1-158">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">patient_billed_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(patient_billed_services),</span>
<span id="cb1-159">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bulk_billing_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(mbs_bulk_billing_rate)</span>
<span id="cb1-160">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-161">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb1-162">    service_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total GP Non-Referred Attendances"</span>,</span>
<span id="cb1-163">    <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(quarter_date),</span>
<span id="cb1-164">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(services),</span>
<span id="cb1-165">    services <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb1-166">    <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span>modified_monash <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Australia"</span>)</span>
<span id="cb1-167">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-168">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-169">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_status =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb1-170">      quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> transition_quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pre-policy"</span>,</span>
<span id="cb1-171">      quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> transition_quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Transition quarter"</span>,</span>
<span id="cb1-172">      quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> clean_post_quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Clean post-policy"</span>,</span>
<span id="cb1-173">      <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb1-174">    )</span>
<span id="cb1-175">  )</span>
<span id="cb1-176"></span>
<span id="cb1-177">pcst_quarters <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(pcst_path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"State"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">skip =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-178">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-179">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb1-180">    quarter,</span>
<span id="cb1-181">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quarter_to_date</span>(quarter),</span>
<span id="cb1-182">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_type =</span> broad_type_of_service,</span>
<span id="cb1-183">    primary_care_service_type,</span>
<span id="cb1-184">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(services)</span>
<span id="cb1-185">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-186">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(quarter_date), service_type <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total GP Non-Referred Attendances"</span>)</span>
<span id="cb1-187"></span>
<span id="cb1-188">phn_lga <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(phn_lga_path) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-189">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-190">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb1-191">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(lga_code_2021),</span>
<span id="cb1-192">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_name =</span> lga_name_2021,</span>
<span id="cb1-193">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">phn_code =</span> phn_code_2023,</span>
<span id="cb1-194">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">phn =</span> phn_name_2023,</span>
<span id="cb1-195">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ratio =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(ratio_from_to)</span>
<span id="cb1-196">  )</span>
<span id="cb1-197"></span>
<span id="cb1-198">lga_phn_latest <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> lga_latest <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-199">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(phn_lga, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lga_code"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">suffix =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_phn"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-200">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(phn) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-201">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb1-202">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lgas =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(lga_code),</span>
<span id="cb1-203">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">latest_lga_mean_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">weighted.mean</span>(latest_bulk_billing_rate, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">w =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(ratio, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb1-204">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb1-205">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-206">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(phn))</span></code></pre></div></div>
</details>
</div>
<section id="source-audit" class="level2">
<h2 class="anchored" data-anchor-id="source-audit">Source Audit</h2>
<p>The AIHW monthly dashboard is the main source because it is dated by month of service and has the policy date built into the time series. The Department’s PHN workbook is added as a quarterly cross-check because it has current PHN and age information, but it is not identical to the AIHW dashboard.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1">audit <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb2-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">source =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb2-3">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"AIHW Tableau monthly dashboard"</span>,</span>
<span id="cb2-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Department quarterly PHN workbook"</span>,</span>
<span id="cb2-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Department quarterly SA3 workbook"</span>,</span>
<span id="cb2-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Department quarterly MMM workbook"</span>,</span>
<span id="cb2-7">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Department primary care service type workbook"</span>,</span>
<span id="cb2-8">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PHN 2023 to LGA 2021 concordance"</span>,</span>
<span id="cb2-9">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Modified Monash Model 2019 feature service"</span></span>
<span id="cb2-10">  ),</span>
<span id="cb2-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">used_for =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb2-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monthly national, age, SEIFA, benefits and latest LGA map"</span>,</span>
<span id="cb2-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Quarterly PHN and PHN by age cross-check"</span>,</span>
<span id="cb2-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Quarterly SA3 GP visit-volume panel"</span>,</span>
<span id="cb2-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Quarterly Modified Monash visit-volume cross-check"</span>,</span>
<span id="cb2-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Primary care service type source audit"</span>,</span>
<span id="cb2-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Approximate latest LGA-to-PHN grouping"</span>,</span>
<span id="cb2-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Documented as the correct MMM source; not spatially joined in this render"</span></span>
<span id="cb2-19">  ),</span>
<span id="cb2-20">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">latest_period =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb2-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(national<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>service_month), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%B %Y"</span>),</span>
<span id="cb2-22">    phn_quarterly<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]],</span>
<span id="cb2-23">    sa3_panel <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-24">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-25">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(quarter) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-26">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(),</span>
<span id="cb2-27">    mmm_visits <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-28">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-29">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(quarter) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-30">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(),</span>
<span id="cb2-31">    pcst_quarters <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-32">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-33">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(quarter) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb2-34">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(),</span>
<span id="cb2-35">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2021 LGA to 2023 PHN"</span>,</span>
<span id="cb2-36">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2019 MMM polygons"</span></span>
<span id="cb2-37">  ),</span>
<span id="cb2-38">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">caveat =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb2-39">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Last 3 months are preliminary and may revise"</span>,</span>
<span id="cb2-40">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Quarterly and processed-date style statistics may differ from AIHW"</span>,</span>
<span id="cb2-41">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"December quarter 2025 is a transition quarter, not a clean post-policy period"</span>,</span>
<span id="cb2-42">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Coarser than SA3 but directly reports Modified Monash categories"</span>,</span>
<span id="cb2-43">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Used for source triangulation, not the main model"</span>,</span>
<span id="cb2-44">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Latest LGA means are not attendance-weighted"</span>,</span>
<span id="cb2-45">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A faithful MMM join needs spatial or mesh-block concordance work"</span></span>
<span id="cb2-46">  )</span>
<span id="cb2-47">)</span>
<span id="cb2-48"></span>
<span id="cb2-49">audit <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 21%">
<col style="width: 33%">
<col style="width: 9%">
<col style="width: 35%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">source</th>
<th style="text-align: left;">used_for</th>
<th style="text-align: left;">latest_period</th>
<th style="text-align: left;">caveat</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">AIHW Tableau monthly dashboard</td>
<td style="text-align: left;">Monthly national, age, SEIFA, benefits and latest LGA map</td>
<td style="text-align: left;">March 2026</td>
<td style="text-align: left;">Last 3 months are preliminary and may revise</td>
</tr>
<tr class="even">
<td style="text-align: left;">Department quarterly PHN workbook</td>
<td style="text-align: left;">Quarterly PHN and PHN by age cross-check</td>
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Quarterly and processed-date style statistics may differ from AIHW</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Department quarterly SA3 workbook</td>
<td style="text-align: left;">Quarterly SA3 GP visit-volume panel</td>
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">December quarter 2025 is a transition quarter, not a clean post-policy period</td>
</tr>
<tr class="even">
<td style="text-align: left;">Department quarterly MMM workbook</td>
<td style="text-align: left;">Quarterly Modified Monash visit-volume cross-check</td>
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Coarser than SA3 but directly reports Modified Monash categories</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Department primary care service type workbook</td>
<td style="text-align: left;">Primary care service type source audit</td>
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Used for source triangulation, not the main model</td>
</tr>
<tr class="even">
<td style="text-align: left;">PHN 2023 to LGA 2021 concordance</td>
<td style="text-align: left;">Approximate latest LGA-to-PHN grouping</td>
<td style="text-align: left;">2021 LGA to 2023 PHN</td>
<td style="text-align: left;">Latest LGA means are not attendance-weighted</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Modified Monash Model 2019 feature service</td>
<td style="text-align: left;">Documented as the correct MMM source; not spatially joined in this render</td>
<td style="text-align: left;">2019 MMM polygons</td>
<td style="text-align: left;">A faithful MMM join needs spatial or mesh-block concordance work</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">manifest <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 12%">
<col style="width: 14%">
<col style="width: 4%">
<col style="width: 6%">
<col style="width: 27%">
<col style="width: 34%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">label</th>
<th style="text-align: left;">sheet</th>
<th style="text-align: right;">rows</th>
<th style="text-align: right;">columns</th>
<th style="text-align: left;">path</th>
<th style="text-align: left;">source_workbook</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">national</td>
<td style="text-align: left;">GP attendances 1</td>
<td style="text-align: right;">506</td>
<td style="text-align: right;">22</td>
<td style="text-align: left;">aihw_tableau_national.csv</td>
<td style="text-align: left;">HWE-97-MBS-GP-bulk-billing-data_20260526</td>
</tr>
<tr class="even">
<td style="text-align: left;">age</td>
<td style="text-align: left;">GP attendances 2</td>
<td style="text-align: right;">1518</td>
<td style="text-align: right;">21</td>
<td style="text-align: left;">aihw_tableau_age.csv</td>
<td style="text-align: left;">HWE-97-MBS-GP-bulk-billing-data_20260526</td>
</tr>
<tr class="odd">
<td style="text-align: left;">seifa</td>
<td style="text-align: left;">GP attendances 3</td>
<td style="text-align: right;">2530</td>
<td style="text-align: right;">22</td>
<td style="text-align: left;">aihw_tableau_seifa.csv</td>
<td style="text-align: left;">HWE-97-MBS-GP-bulk-billing-data_20260526</td>
</tr>
<tr class="even">
<td style="text-align: left;">benefits</td>
<td style="text-align: left;">GP attendances 4</td>
<td style="text-align: right;">1518</td>
<td style="text-align: right;">24</td>
<td style="text-align: left;">aihw_tableau_benefits.csv</td>
<td style="text-align: left;">HWE-97-MBS-GP-bulk-billing-data_20260526</td>
</tr>
<tr class="odd">
<td style="text-align: left;">latest_lga_map</td>
<td style="text-align: left;">Map</td>
<td style="text-align: right;">515</td>
<td style="text-align: right;">8</td>
<td style="text-align: left;">aihw_tableau_latest_lga_map.csv</td>
<td style="text-align: left;">HWE-97-MBS-GP-bulk-billing-data_20260526</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The extract found 506 monthly observations from February 1984 to March 2026. There are 6 months in the immediate pre-window and 5 months after the policy start.</p>
</section>
<section id="national-signal" class="level2">
<h2 class="anchored" data-anchor-id="national-signal">National Signal</h2>
<p>The national monthly rate is the cleanest first test. A one-off step after November is suggestive, but the stronger signal is a step that is larger than the pre-existing trend and is visible in the 3-month average.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1">national_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">window_compare</span>(national) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb4-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">starts_with</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate"</span>), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)),</span>
<span id="cb4-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb4-5">  )</span>
<span id="cb4-6"></span>
<span id="cb4-7">national_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 8%">
<col style="width: 11%">
<col style="width: 16%">
<col style="width: 18%">
<col style="width: 17%">
<col style="width: 20%">
<col style="width: 6%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">dimension</th>
<th style="text-align: left;">group</th>
<th style="text-align: left;">rate_May-Oct 2025</th>
<th style="text-align: left;">rate_Nov 2025 onward</th>
<th style="text-align: right;">months_May-Oct 2025</th>
<th style="text-align: right;">months_Nov 2025 onward</th>
<th style="text-align: left;">change</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">All</td>
<td style="text-align: left;">All patients</td>
<td style="text-align: left;">78.1%</td>
<td style="text-align: left;">81.7%</td>
<td style="text-align: right;">6</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">3.6%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">national_plot <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> national <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(service_month) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb5-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rolling_3_month =</span> (bulk_billing_rate <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lag</span>(bulk_billing_rate, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lag</span>(bulk_billing_rate, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb5-5">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(service_month <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2023-01-01"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_longer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(bulk_billing_rate, rolling_3_month), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measure"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate"</span>)</span>
<span id="cb5-8"></span>
<span id="cb5-9"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(national_plot, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(service_month, rate, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> measure)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb5-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> policy_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey40"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb5-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb5-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb5-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_colour_manual</span>(</span>
<span id="cb5-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bulk_billing_rate =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rolling_3_month =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#c44e52"</span>),</span>
<span id="cb5-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bulk_billing_rate =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monthly"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rolling_3_month =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rolling 3 months"</span>)</span>
<span id="cb5-16">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb5-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bulk billing rate"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/national-trend-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>National GP bulk billing rate, with a 3-month rolling average.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb6-1">model_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> national <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(service_month <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2023-01-01"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb6-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">post =</span> service_month <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> policy_date,</span>
<span id="cb6-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">months_since_policy =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmax</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">interval</span>(policy_date, service_month) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%/%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">months</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))),</span>
<span id="cb6-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">month_index =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">interval</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(service_month), service_month) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%/%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">months</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb6-7">  )</span>
<span id="cb6-8"></span>
<span id="cb6-9">its_model <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(bulk_billing_rate <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> month_index <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> post <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> months_since_policy, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> model_data)</span>
<span id="cb6-10"></span>
<span id="cb6-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tidy</span>(its_model, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conf.int =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb6-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">estimate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(estimate, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>),</span>
<span id="cb6-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conf.low =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(conf.low, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>),</span>
<span id="cb6-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conf.high =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(conf.high, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>)</span>
<span id="cb6-16">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb6-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 25%">
<col style="width: 11%">
<col style="width: 12%">
<col style="width: 15%">
<col style="width: 12%">
<col style="width: 11%">
<col style="width: 12%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">term</th>
<th style="text-align: left;">estimate</th>
<th style="text-align: right;">std.error</th>
<th style="text-align: right;">statistic</th>
<th style="text-align: right;">p.value</th>
<th style="text-align: left;">conf.low</th>
<th style="text-align: left;">conf.high</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">(Intercept)</td>
<td style="text-align: left;">77.56%</td>
<td style="text-align: right;">0.0031667</td>
<td style="text-align: right;">244.9187761</td>
<td style="text-align: right;">0.0000000</td>
<td style="text-align: left;">76.92%</td>
<td style="text-align: left;">78.20%</td>
</tr>
<tr class="even">
<td style="text-align: left;">month_index</td>
<td style="text-align: left;">0.01%</td>
<td style="text-align: right;">0.0001650</td>
<td style="text-align: right;">0.5360189</td>
<td style="text-align: right;">0.5953359</td>
<td style="text-align: left;">-0.02%</td>
<td style="text-align: left;">0.04%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">postTRUE</td>
<td style="text-align: left;">3.24%</td>
<td style="text-align: right;">0.0080242</td>
<td style="text-align: right;">4.0401600</td>
<td style="text-align: right;">0.0002779</td>
<td style="text-align: left;">1.61%</td>
<td style="text-align: left;">4.87%</td>
</tr>
<tr class="even">
<td style="text-align: left;">months_since_policy</td>
<td style="text-align: left;">0.30%</td>
<td style="text-align: right;">0.0029888</td>
<td style="text-align: right;">1.0059201</td>
<td style="text-align: right;">0.3213582</td>
<td style="text-align: left;">-0.31%</td>
<td style="text-align: left;">0.91%</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The <code>postTRUE</code> coefficient is the immediate step after November 2025, after allowing for a linear pre/post time trend. This is useful as a screening estimate, not as a final causal estimate.</p>
</section>
<section id="who-moved" class="level2">
<h2 class="anchored" data-anchor-id="who-moved">Who Moved?</h2>
<p>The policy should matter most for patients who were not already covered by the old child/concession-heavy incentive structure. In the public AIHW age bands, that makes <code>16-64</code> the group to watch.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1">age_compare <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">window_compare</span>(age_rates) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb7-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb7-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">starts_with</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate"</span>), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)),</span>
<span id="cb7-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb7-5">  )</span>
<span id="cb7-6"></span>
<span id="cb7-7">age_compare <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 9%">
<col style="width: 5%">
<col style="width: 17%">
<col style="width: 20%">
<col style="width: 19%">
<col style="width: 21%">
<col style="width: 6%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">dimension</th>
<th style="text-align: left;">group</th>
<th style="text-align: left;">rate_May-Oct 2025</th>
<th style="text-align: left;">rate_Nov 2025 onward</th>
<th style="text-align: right;">months_May-Oct 2025</th>
<th style="text-align: right;">months_Nov 2025 onward</th>
<th style="text-align: left;">change</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Age group</td>
<td style="text-align: left;">16-64</td>
<td style="text-align: left;">69.6%</td>
<td style="text-align: left;">75.9%</td>
<td style="text-align: right;">6</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">6.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Age group</td>
<td style="text-align: left;">65+</td>
<td style="text-align: left;">87.4%</td>
<td style="text-align: left;">88.4%</td>
<td style="text-align: right;">6</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">1.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Age group</td>
<td style="text-align: left;">0-15</td>
<td style="text-align: left;">90.6%</td>
<td style="text-align: left;">90.8%</td>
<td style="text-align: right;">6</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">0.3%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">age_rates <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb8-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(service_month <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2023-01-01"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb8-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(service_month, bulk_billing_rate, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> group)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb8-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> policy_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey40"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb8-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb8-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb8-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bulk billing rate"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Age group"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/age-trend-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Bulk billing rates by age group.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1">seifa_compare <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">window_compare</span>(seifa_rates) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb9-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb9-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">starts_with</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate"</span>), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)),</span>
<span id="cb9-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb9-5">  )</span>
<span id="cb9-6"></span>
<span id="cb9-7">seifa_compare <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 16%">
<col style="width: 21%">
<col style="width: 12%">
<col style="width: 14%">
<col style="width: 13%">
<col style="width: 16%">
<col style="width: 4%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">dimension</th>
<th style="text-align: left;">group</th>
<th style="text-align: left;">rate_May-Oct 2025</th>
<th style="text-align: left;">rate_Nov 2025 onward</th>
<th style="text-align: right;">months_May-Oct 2025</th>
<th style="text-align: right;">months_Nov 2025 onward</th>
<th style="text-align: left;">change</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Socioeconomic quintile</td>
<td style="text-align: left;">2</td>
<td style="text-align: left;">81.3%</td>
<td style="text-align: left;">85.6%</td>
<td style="text-align: right;">6</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">4.3%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Socioeconomic quintile</td>
<td style="text-align: left;">3</td>
<td style="text-align: left;">80.6%</td>
<td style="text-align: left;">84.6%</td>
<td style="text-align: right;">6</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">4.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Socioeconomic quintile</td>
<td style="text-align: left;">4</td>
<td style="text-align: left;">74.4%</td>
<td style="text-align: left;">78.1%</td>
<td style="text-align: right;">6</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">3.7%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Socioeconomic quintile</td>
<td style="text-align: left;">1 (lowest socioeconomic area)</td>
<td style="text-align: left;">88.4%</td>
<td style="text-align: left;">92.1%</td>
<td style="text-align: right;">6</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">3.7%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Socioeconomic quintile</td>
<td style="text-align: left;">5 (highest socioeconomic area)</td>
<td style="text-align: left;">67.2%</td>
<td style="text-align: left;">69.7%</td>
<td style="text-align: right;">6</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">2.5%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">seifa_rates <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(service_month <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2023-01-01"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_relevel</span>(group, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1 (lowest socioeconomic area)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5 (highest socioeconomic area)"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(service_month, bulk_billing_rate, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> group)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> policy_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey40"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb10-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bulk billing rate"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SEIFA quintile"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/seifa-trend-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Bulk billing rates by socioeconomic quintile.</figcaption>
</figure>
</div>
</div>
</div>
</section>
<section id="payment-check" class="level2">
<h2 class="anchored" data-anchor-id="payment-check">Payment Check</h2>
<p>AIHW’s benefits measure includes Medicare benefits for bulk billed GP attendances and the matched bulk billing incentive items. It does not include the separate Bulk Billing Practice Incentive Program payments.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1">benefits <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(service_month <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2023-01-01"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(service_month, value, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> series)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> policy_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey40"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> dollar) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Monthly benefit amount"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/benefits-check-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Bulk billed GP attendance benefits and related bulk billing incentives.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1">benefit_wide <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> benefits <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(service_month <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2025-05-01"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_wider</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_from =</span> series, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_from =</span> value)</span>
<span id="cb12-4"></span>
<span id="cb12-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">all</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bulk billing incentives"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total benefit"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(benefit_wide))) {</span>
<span id="cb12-6">  benefit_wide <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb12-8">      service_month,</span>
<span id="cb12-9">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">incentive_share =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Bulk billing incentives</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Total benefit</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span></span>
<span id="cb12-10">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-11">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(service_month) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">incentive_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(incentive_share, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb12-14">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb12-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The expected incentive and total benefit series were not both present in the Tableau export."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb12-17">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">service_month</th>
<th style="text-align: left;">incentive_share</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">2025-05-01</td>
<td style="text-align: left;">18.7%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-06-01</td>
<td style="text-align: left;">18.5%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-07-01</td>
<td style="text-align: left;">19.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-08-01</td>
<td style="text-align: left;">19.1%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-09-01</td>
<td style="text-align: left;">19.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-10-01</td>
<td style="text-align: left;">18.9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-11-01</td>
<td style="text-align: left;">27.1%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-12-01</td>
<td style="text-align: left;">27.7%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2026-01-01</td>
<td style="text-align: left;">26.9%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2026-02-01</td>
<td style="text-align: left;">26.6%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2026-03-01</td>
<td style="text-align: left;">27.0%</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="geography" class="level2">
<h2 class="anchored" data-anchor-id="geography">Geography</h2>
<p>The AIHW dashboard gives a latest-month LGA map. That is not enough for an LGA-level before/after model, but it is enough to see where the current access surface is high or low. The PHN grouping below is an approximate LGA-to-PHN summary of latest LGA rates, not an attendance-weighted PHN statistic.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(</span>
<span id="cb13-2">  lga_latest <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(latest_bulk_billing_rate) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rank_type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lowest latest LGA rates"</span>),</span>
<span id="cb13-6">  lga_latest <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(latest_bulk_billing_rate)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rank_type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Highest latest LGA rates"</span>)</span>
<span id="cb13-10">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb13-12">    rank_type,</span>
<span id="cb13-13">    state,</span>
<span id="cb13-14">    lga_name,</span>
<span id="cb13-15">    remoteness_area,</span>
<span id="cb13-16">    seifa_quintile,</span>
<span id="cb13-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">latest_bulk_billing_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(latest_bulk_billing_rate, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb13-18">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 21%">
<col style="width: 9%">
<col style="width: 18%">
<col style="width: 16%">
<col style="width: 12%">
<col style="width: 21%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">rank_type</th>
<th style="text-align: left;">state</th>
<th style="text-align: left;">lga_name</th>
<th style="text-align: left;">remoteness_area</th>
<th style="text-align: right;">seifa_quintile</th>
<th style="text-align: left;">latest_bulk_billing_rate</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Lowest latest LGA rates</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">Peppermint Grove</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">47.7%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Lowest latest LGA rates</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">Cottesloe</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">47.9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Lowest latest LGA rates</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">Mosman Park</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">51.6%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Lowest latest LGA rates</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">Subiaco</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">51.9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Lowest latest LGA rates</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Mosman</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">53.4%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Lowest latest LGA rates</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">Claremont</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">54.3%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Lowest latest LGA rates</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">Nedlands</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">54.6%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Lowest latest LGA rates</td>
<td style="text-align: left;">ACT</td>
<td style="text-align: left;">Unincorporated ACT</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">55.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Lowest latest LGA rates</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">Cambridge</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">55.4%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Lowest latest LGA rates</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">East Fremantle</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">55.4%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Highest latest LGA rates</td>
<td style="text-align: left;">Queensland</td>
<td style="text-align: left;">Torres Strait Island</td>
<td style="text-align: left;">4 (Very remote)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">98.9%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Highest latest LGA rates</td>
<td style="text-align: left;">Queensland</td>
<td style="text-align: left;">Torres</td>
<td style="text-align: left;">4 (Very remote)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">98.9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Highest latest LGA rates</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Fairfield</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">98.9%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Highest latest LGA rates</td>
<td style="text-align: left;">SA</td>
<td style="text-align: left;">Whyalla</td>
<td style="text-align: left;">2 (Outer regional)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">98.8%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Highest latest LGA rates</td>
<td style="text-align: left;">NT</td>
<td style="text-align: left;">West Daly</td>
<td style="text-align: left;">3 (Remote)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">98.7%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Highest latest LGA rates</td>
<td style="text-align: left;">Tasmania</td>
<td style="text-align: left;">Flinders (Tas.)</td>
<td style="text-align: left;">4 (Very remote)</td>
<td style="text-align: right;">2</td>
<td style="text-align: left;">98.4%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Highest latest LGA rates</td>
<td style="text-align: left;">NT</td>
<td style="text-align: left;">MacDonnell</td>
<td style="text-align: left;">4 (Very remote)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">98.3%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Highest latest LGA rates</td>
<td style="text-align: left;">NT</td>
<td style="text-align: left;">Central Desert</td>
<td style="text-align: left;">4 (Very remote)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">98.3%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Highest latest LGA rates</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Cumberland</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">NA</td>
<td style="text-align: left;">98.3%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Highest latest LGA rates</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Campbelltown (NSW)</td>
<td style="text-align: left;">0 (Major cities)</td>
<td style="text-align: right;">2</td>
<td style="text-align: left;">98.2%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">lga_latest <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(remoteness_area)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_reorder</span>(remoteness_area, latest_bulk_billing_rate, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.fun =</span> median, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), latest_bulk_billing_rate)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_boxplot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d9e8f5"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey35"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outlier.alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_flip</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Latest LGA bulk billing rate"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/lga-remoteness-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Latest LGA bulk billing rates by AIHW remoteness field.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">lga_phn_latest <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(latest_lga_mean_rate) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">latest_lga_mean_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(latest_lga_mean_rate, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 63%">
<col style="width: 7%">
<col style="width: 29%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">phn</th>
<th style="text-align: right;">lgas</th>
<th style="text-align: left;">latest_lga_mean_rate</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Australian Capital Territory</td>
<td style="text-align: right;">1</td>
<td style="text-align: left;">55.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Perth North</td>
<td style="text-align: right;">18</td>
<td style="text-align: left;">61.9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Northern Sydney</td>
<td style="text-align: right;">10</td>
<td style="text-align: left;">71.6%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Perth South</td>
<td style="text-align: right;">15</td>
<td style="text-align: left;">75.5%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Adelaide</td>
<td style="text-align: right;">18</td>
<td style="text-align: left;">75.8%</td>
</tr>
<tr class="even">
<td style="text-align: left;">South Eastern Melbourne</td>
<td style="text-align: right;">14</td>
<td style="text-align: left;">77.9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Central and Eastern Sydney</td>
<td style="text-align: right;">13</td>
<td style="text-align: left;">79.4%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Brisbane South</td>
<td style="text-align: right;">4</td>
<td style="text-align: left;">79.9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Eastern Melbourne</td>
<td style="text-align: right;">13</td>
<td style="text-align: left;">80.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Central Queensland, Wide Bay, Sunshine Coast</td>
<td style="text-align: right;">11</td>
<td style="text-align: left;">82.4%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">North Western Melbourne</td>
<td style="text-align: right;">13</td>
<td style="text-align: left;">82.8%</td>
</tr>
<tr class="even">
<td style="text-align: left;">South Eastern NSW</td>
<td style="text-align: right;">12</td>
<td style="text-align: left;">83.8%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Country WA</td>
<td style="text-align: right;">98</td>
<td style="text-align: left;">83.9%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Hunter New England and Central Coast</td>
<td style="text-align: right;">23</td>
<td style="text-align: left;">83.9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Brisbane North</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">84.1%</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The Modified Monash Model source is available as a polygon feature service, but this render does not force a low-quality LGA-only MMM approximation. A proper MMM join should use a spatial intersection or a finer ABS geography concordance, then aggregate to the patient geography used by the Medicare data.</p>
</section>
<section id="phn-cross-check" class="level2">
<h2 class="anchored" data-anchor-id="phn-cross-check">PHN Cross-Check</h2>
<p>The Department’s PHN workbook is quarterly. It is useful as a second view of whether the post-policy shift is visible across PHNs, and whether the working-age pattern appears there too.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">phn_quarterly <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(phn <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Australia"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NSW"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"VIC"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"QLD"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SA"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"WA"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"TAS"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ACT"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NT"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(quarter, state, phn) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tail</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">phn_bulk_billing_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(phn_bulk_billing_rate, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 21%">
<col style="width: 35%">
<col style="width: 22%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">state</th>
<th style="text-align: left;">phn</th>
<th style="text-align: left;">quarter</th>
<th style="text-align: left;">service_type</th>
<th style="text-align: left;">phn_bulk_billing_rate</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">SA</td>
<td style="text-align: left;">SA</td>
<td style="text-align: left;">2024-25 Q4 (Jun Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">76.5%</td>
</tr>
<tr class="even">
<td style="text-align: left;">WA</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">2024-25 Q4 (Jun Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">71.9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">ACT</td>
<td style="text-align: left;">ACT</td>
<td style="text-align: left;">2025-26 Q1 (Sep Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">51.4%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Australia</td>
<td style="text-align: left;">Australia</td>
<td style="text-align: left;">2025-26 Q1 (Sep Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">77.6%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">2025-26 Q1 (Sep Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">82.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">NT</td>
<td style="text-align: left;">NT</td>
<td style="text-align: left;">2025-26 Q1 (Sep Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">76.6%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">SA</td>
<td style="text-align: left;">SA</td>
<td style="text-align: left;">2025-26 Q1 (Sep Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">74.5%</td>
</tr>
<tr class="even">
<td style="text-align: left;">WA</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">2025-26 Q1 (Sep Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">69.9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">ACT</td>
<td style="text-align: left;">ACT</td>
<td style="text-align: left;">2025-26 Q2 (Dec Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">53.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Australia</td>
<td style="text-align: left;">Australia</td>
<td style="text-align: left;">2025-26 Q2 (Dec Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">80.1%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">2025-26 Q2 (Dec Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">84.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">NT</td>
<td style="text-align: left;">NT</td>
<td style="text-align: left;">2025-26 Q2 (Dec Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">85.6%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">SA</td>
<td style="text-align: left;">SA</td>
<td style="text-align: left;">2025-26 Q2 (Dec Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">78.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">WA</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">2025-26 Q2 (Dec Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">72.2%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">ACT</td>
<td style="text-align: left;">ACT</td>
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">54.1%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Australia</td>
<td style="text-align: left;">Australia</td>
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">81.9%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">85.6%</td>
</tr>
<tr class="even">
<td style="text-align: left;">NT</td>
<td style="text-align: left;">NT</td>
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">89.8%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">SA</td>
<td style="text-align: left;">SA</td>
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">80.4%</td>
</tr>
<tr class="even">
<td style="text-align: left;">WA</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Total GP Non-Referred Attendances</td>
<td style="text-align: left;">74.0%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">latest_phn_quarter <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> phn_quarterly<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb17-2"></span>
<span id="cb17-3">phn_quarterly <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> latest_phn_quarter, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span>phn <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Australia"</span>, state)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(phn_bulk_billing_rate) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb17-8">    quarter,</span>
<span id="cb17-9">    state,</span>
<span id="cb17-10">    phn,</span>
<span id="cb17-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">phn_bulk_billing_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(phn_bulk_billing_rate, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb17-12">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 22%">
<col style="width: 6%">
<col style="width: 47%">
<col style="width: 23%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">quarter</th>
<th style="text-align: left;">state</th>
<th style="text-align: left;">phn</th>
<th style="text-align: left;">phn_bulk_billing_rate</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">ACT</td>
<td style="text-align: left;">Australian Capital Territory</td>
<td style="text-align: left;">54.1%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">Perth North</td>
<td style="text-align: left;">68.0%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Qld</td>
<td style="text-align: left;">Brisbane North</td>
<td style="text-align: left;">70.9%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Northern Sydney</td>
<td style="text-align: left;">73.5%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">Perth South</td>
<td style="text-align: left;">76.4%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Hunter New England and Central Coast</td>
<td style="text-align: left;">77.8%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Tas</td>
<td style="text-align: left;">Tasmania</td>
<td style="text-align: left;">78.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">SA</td>
<td style="text-align: left;">Adelaide</td>
<td style="text-align: left;">79.1%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Central and Eastern Sydney</td>
<td style="text-align: left;">79.4%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Qld</td>
<td style="text-align: left;">Brisbane South</td>
<td style="text-align: left;">79.6%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Qld</td>
<td style="text-align: left;">Central Queensland, Wide Bay, Sunshine Coast</td>
<td style="text-align: left;">79.6%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Vic</td>
<td style="text-align: left;">Eastern Melbourne</td>
<td style="text-align: left;">80.7%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">Country WA</td>
<td style="text-align: left;">81.6%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Vic</td>
<td style="text-align: left;">South Eastern Melbourne</td>
<td style="text-align: left;">81.7%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">Qld</td>
<td style="text-align: left;">Northern Queensland</td>
<td style="text-align: left;">82.0%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">phn_age <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> latest_phn_quarter, phn <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Australia"</span>, age_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"All ages"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb18-4">    quarter,</span>
<span id="cb18-5">    age_group,</span>
<span id="cb18-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bulk_billing_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(bulk_billing_rate, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb18-7">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">quarter</th>
<th style="text-align: left;">age_group</th>
<th style="text-align: left;">bulk_billing_rate</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">0-15</td>
<td style="text-align: left;">90.8%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">16-64</td>
<td style="text-align: left;">76.2%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">65+</td>
<td style="text-align: left;">88.5%</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="visit-access" class="level2">
<h2 class="anchored" data-anchor-id="visit-access">Visit Access</h2>
<p>The next test is stricter: did areas with more room for the incentive to shift billing also see more GP attendances? For this, the lowest-level public panel in the current official releases is SA3 by quarter. The December quarter 2025 is mixed, because October was pre-policy and November-December were post-policy, so it is labelled as a transition quarter and excluded from the fixed-effects model.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">exposure_baseline_quarters <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sa3_panel <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> transition_quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>(quarter, quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(quarter_date)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(quarter_date)</span>
<span id="cb19-7"></span>
<span id="cb19-8">visit_access_audit <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb19-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">metric =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb19-10">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Latest SA3 quarter"</span>,</span>
<span id="cb19-11">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Usable pre-policy quarters"</span>,</span>
<span id="cb19-12">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Exposure baseline window"</span>,</span>
<span id="cb19-13">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Transition quarter"</span>,</span>
<span id="cb19-14">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Visit model window starts"</span>,</span>
<span id="cb19-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Clean post-policy quarters"</span>,</span>
<span id="cb19-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SA3s in model panel"</span>,</span>
<span id="cb19-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rows with missing model fields"</span>,</span>
<span id="cb19-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Largest rate validation difference"</span></span>
<span id="cb19-19">  ),</span>
<span id="cb19-20">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">value =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb19-21">    sa3_panel <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-22">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-23">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(quarter) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-24">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(),</span>
<span id="cb19-25">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(sa3_panel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date[sa3_panel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> transition_quarter_date]),</span>
<span id="cb19-26">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(exposure_baseline_quarters<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" to "</span>),</span>
<span id="cb19-27">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2025-26 Q2 (Dec Qtr), excluded from the model"</span>,</span>
<span id="cb19-28">    sa3_panel <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-29">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> visit_model_start_quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-30">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(quarter) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-31">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(),</span>
<span id="cb19-32">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(sa3_panel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date[sa3_panel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> clean_post_quarter_date]),</span>
<span id="cb19-33">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(sa3_panel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>sa3_key),</span>
<span id="cb19-34">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">complete.cases</span>(sa3_panel[, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"services"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bulk_billed_services"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bulk_billing_rate"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pre_policy_gap_10pp"</span>)])),</span>
<span id="cb19-35">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(sa3_panel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>rate_difference), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span>)</span>
<span id="cb19-36">  )</span>
<span id="cb19-37">)</span>
<span id="cb19-38"></span>
<span id="cb19-39">visit_access_audit <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 27%">
<col style="width: 72%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">metric</th>
<th style="text-align: left;">value</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Latest SA3 quarter</td>
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
</tr>
<tr class="even">
<td style="text-align: left;">Usable pre-policy quarters</td>
<td style="text-align: left;">21</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Exposure baseline window</td>
<td style="text-align: left;">2024-25 Q2 (Dec Qtr) to 2024-25 Q3 (Mar Qtr) to 2024-25 Q4 (Jun Qtr) to 2025-26 Q1 (Sep Qtr)</td>
</tr>
<tr class="even">
<td style="text-align: left;">Transition quarter</td>
<td style="text-align: left;">2025-26 Q2 (Dec Qtr), excluded from the model</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Visit model window starts</td>
<td style="text-align: left;">2023-24 Q1 (Sep Qtr)</td>
</tr>
<tr class="even">
<td style="text-align: left;">Clean post-policy quarters</td>
<td style="text-align: left;">1</td>
</tr>
<tr class="odd">
<td style="text-align: left;">SA3s in model panel</td>
<td style="text-align: left;">332</td>
</tr>
<tr class="even">
<td style="text-align: left;">Rows with missing model fields</td>
<td style="text-align: left;">0</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Largest rate validation difference</td>
<td style="text-align: left;">0.000%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">sa3_national_visits <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sa3_panel <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_date, quarter_status) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(services, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>)</span>
<span id="cb20-4"></span>
<span id="cb20-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(sa3_national_visits, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, services)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb20-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> transition_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey45"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb20-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> clean_post_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey25"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb20-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb20-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">shape =</span> quarter_status), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb20-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> comma) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb20-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GP NRA services"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">shape =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/national-quarterly-visits-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Quarterly GP non-referred attendance services summed across SA3s.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1">sa3_growth <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sa3_panel <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">window =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb21-3">    quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> exposure_baseline_quarters<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline"</span>,</span>
<span id="cb21-4">    quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> clean_post_quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"post"</span>,</span>
<span id="cb21-5">    <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb21-6">  )) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(window)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(sa3_key, state, sa3, exposure_band, pre_policy_non_bulk_billed_share, baseline_services, window) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb21-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(services, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb21-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bb_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">weighted_rate</span>(bulk_billed_services, services),</span>
<span id="cb21-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb21-13">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_wider</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_from =</span> window, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_from =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(services, bb_rate)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb21-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">visit_growth =</span> services_post <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> services_baseline <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb21-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bulk_billing_rate_change =</span> bb_rate_post <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> bb_rate_baseline,</span>
<span id="cb21-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">exposure_label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(exposure_band)</span>
<span id="cb21-19">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(visit_growth), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(pre_policy_non_bulk_billed_share))</span>
<span id="cb21-21"></span>
<span id="cb21-22"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(sa3_growth, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(visit_growth)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb21-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_histogram</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">bins =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d9e8f5"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"white"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb21-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey35"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb21-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb21-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Visit growth"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SA3s"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/sa3-visit-growth-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>SA3 visit growth from the pre-policy exposure window to clean post-policy quarters.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1">band_trends <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sa3_panel <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(exposure_band, quarter_date, quarter_status) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(services, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(exposure_band) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb22-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">baseline_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(services[quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> exposure_baseline_quarters<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb22-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">visit_index =</span> services <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> baseline_services</span>
<span id="cb22-8">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>()</span>
<span id="cb22-10"></span>
<span id="cb22-11"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(band_trends, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, visit_index, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> exposure_band)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> transition_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey45"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> clean_post_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey25"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb22-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Visit volume index"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pre-policy non-bulk-billed share"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/exposure-band-trends-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Longer-run quarterly GP visit volume indexed to the four-quarter pre-policy exposure window.</figcaption>
</figure>
</div>
</div>
</div>
<p>The 2021-22 peak is real in the official service counts, not an indexing artefact. It lines up with the pandemic-era disruption and rebound in GP claiming, so it is a poor baseline for the 2025 policy question. The chart below keeps the same index but starts after that shock; the visit-volume models also use this flatter window.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1">band_trends <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb23-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> visit_model_start_quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb23-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, visit_index, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> exposure_band)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb23-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> transition_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey45"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb23-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> clean_post_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey25"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb23-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb23-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb23-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Visit volume index"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pre-policy non-bulk-billed share"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/exposure-band-trends-flat-window-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Post-spike quarterly GP visit volume indexed to the four-quarter pre-policy exposure window.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(sa3_growth, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(pre_policy_non_bulk_billed_share, visit_growth)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb24-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey50"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb24-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> baseline_services), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb24-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_smooth</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">weight =</span> baseline_services), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">method =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lm"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">se =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#c44e52"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb24-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb24-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb24-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_size_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> comma, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">range =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb24-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb24-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pre-policy non-bulk-billed share"</span>,</span>
<span id="cb24-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Visit growth"</span>,</span>
<span id="cb24-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Baseline services"</span></span>
<span id="cb24-12">  )</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/exposure-growth-scatter-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Areas with lower pre-policy bulk billing had more room for the incentives to shift billing behaviour.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(sa3_growth, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(bulk_billing_rate_change, visit_growth)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb25-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey50"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb25-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey50"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb25-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> baseline_services), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb25-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_smooth</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">weight =</span> baseline_services), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">method =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lm"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">se =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#c44e52"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb25-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb25-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb25-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_size_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> comma, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">range =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb25-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb25-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Observed bulk billing rate change"</span>,</span>
<span id="cb25-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Visit growth"</span>,</span>
<span id="cb25-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Baseline services"</span></span>
<span id="cb25-13">  )</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/observed-billing-visit-scatter-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Observed SA3 bulk billing rate change versus visit growth.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1">access_model_panel <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> sa3_panel <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb26-3">    quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> visit_model_start_quarter_date,</span>
<span id="cb26-4">    quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> transition_quarter_date</span>
<span id="cb26-5">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">post_x_gap_10pp =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(clean_post_policy) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> pre_policy_gap_10pp)</span>
<span id="cb26-7"></span>
<span id="cb26-8">fit_access_model <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(outcome, label, outcome_type) {</span>
<span id="cb26-9">  model_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> access_model_panel <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb26-11">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(.data[[outcome]]),</span>
<span id="cb26-12">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(post_x_gap_10pp),</span>
<span id="cb26-13">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(baseline_services),</span>
<span id="cb26-14">      baseline_services <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb26-15">    )</span>
<span id="cb26-16"></span>
<span id="cb26-17">  model <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(</span>
<span id="cb26-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">reformulate</span>(</span>
<span id="cb26-19">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"factor(sa3_key)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"factor(quarter_date)"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"post_x_gap_10pp"</span>),</span>
<span id="cb26-20">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">response =</span> outcome</span>
<span id="cb26-21">    ),</span>
<span id="cb26-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> model_data,</span>
<span id="cb26-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">weights =</span> baseline_services</span>
<span id="cb26-24">  )</span>
<span id="cb26-25"></span>
<span id="cb26-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tidy</span>(model, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conf.int =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-27">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(term <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"post_x_gap_10pp"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb26-29">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcome =</span> label,</span>
<span id="cb26-30">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">interpretation =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Clean post-policy change per 10 percentage point higher pre-policy non-bulk-billed share"</span>,</span>
<span id="cb26-31">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">estimate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format_model_estimate</span>(estimate, outcome_type),</span>
<span id="cb26-32">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conf_low =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format_model_estimate</span>(conf.low, outcome_type),</span>
<span id="cb26-33">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conf_high =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format_model_estimate</span>(conf.high, outcome_type),</span>
<span id="cb26-34">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rows =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(model_data),</span>
<span id="cb26-35">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sa3s =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(model_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>sa3_key)</span>
<span id="cb26-36">    )</span>
<span id="cb26-37">}</span>
<span id="cb26-38"></span>
<span id="cb26-39">access_model_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(</span>
<span id="cb26-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fit_access_model</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_services"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GP visit volume"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log"</span>),</span>
<span id="cb26-41">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fit_access_model</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bulk_billing_rate"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Bulk billing rate"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate"</span>),</span>
<span id="cb26-42">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fit_access_model</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"avg_patient_contribution_patient_billed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Patient contribution among patient-billed services"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dollar"</span>)</span>
<span id="cb26-43">)</span>
<span id="cb26-44"></span>
<span id="cb26-45">access_model_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 28%">
<col style="width: 50%">
<col style="width: 5%">
<col style="width: 5%">
<col style="width: 5%">
<col style="width: 2%">
<col style="width: 2%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">outcome</th>
<th style="text-align: left;">interpretation</th>
<th style="text-align: left;">estimate</th>
<th style="text-align: left;">conf_low</th>
<th style="text-align: left;">conf_high</th>
<th style="text-align: right;">rows</th>
<th style="text-align: right;">sa3s</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">GP visit volume</td>
<td style="text-align: left;">Clean post-policy change per 10 percentage point higher pre-policy non-bulk-billed share</td>
<td style="text-align: left;">-0.4%</td>
<td style="text-align: left;">-0.6%</td>
<td style="text-align: left;">-0.1%</td>
<td style="text-align: right;">3320</td>
<td style="text-align: right;">332</td>
</tr>
<tr class="even">
<td style="text-align: left;">Bulk billing rate</td>
<td style="text-align: left;">Clean post-policy change per 10 percentage point higher pre-policy non-bulk-billed share</td>
<td style="text-align: left;">-0.43%</td>
<td style="text-align: left;">-0.59%</td>
<td style="text-align: left;">-0.27%</td>
<td style="text-align: right;">3320</td>
<td style="text-align: right;">332</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Patient contribution among patient-billed services</td>
<td style="text-align: left;">Clean post-policy change per 10 percentage point higher pre-policy non-bulk-billed share</td>
<td style="text-align: left;">-$1.11</td>
<td style="text-align: left;">-$1.30</td>
<td style="text-align: left;">-$0.93</td>
<td style="text-align: right;">3320</td>
<td style="text-align: right;">332</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The first row is the key access test. A positive estimate would mean higher-exposure areas had faster visit-volume growth after the clean post-policy quarter. The second and third rows are mechanism checks: the policy story is stronger if the same high-exposure areas also show larger bulk billing rate gains or lower patient contributions.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1">reference_quarter <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(access_model_panel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date[access_model_panel<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> transition_quarter_date], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb27-2"></span>
<span id="cb27-3">event_study_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> access_model_panel <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(sa3_key, quarter_date, log_services, pre_policy_gap_10pp, baseline_services) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(</span>
<span id="cb27-6">    access_model_panel <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-7">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> reference_quarter) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-8">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(sa3_key, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">reference_log_services =</span> log_services),</span>
<span id="cb27-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sa3_key"</span></span>
<span id="cb27-10">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">delta_log_services =</span> log_services <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> reference_log_services) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(delta_log_services), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(pre_policy_gap_10pp), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(baseline_services))</span>
<span id="cb27-13"></span>
<span id="cb27-14">event_study <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> event_study_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_modify</span>(\(.x, .y) {</span>
<span id="cb27-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tidy</span>(</span>
<span id="cb27-18">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(delta_log_services <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> pre_policy_gap_10pp, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">weights =</span> baseline_services),</span>
<span id="cb27-19">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conf.int =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb27-20">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-21">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(term <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pre_policy_gap_10pp"</span>)</span>
<span id="cb27-22">  }) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb27-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">estimate_pct =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exp</span>(estimate) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb27-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conf_low_pct =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exp</span>(conf.low) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb27-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">conf_high_pct =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">exp</span>(conf.high) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb27-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_status =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb27-29">      quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> transition_quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pre-policy"</span>,</span>
<span id="cb27-30">      quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> clean_post_quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Clean post-policy"</span>,</span>
<span id="cb27-31">      <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Transition quarter"</span></span>
<span id="cb27-32">    )</span>
<span id="cb27-33">  )</span>
<span id="cb27-34"></span>
<span id="cb27-35"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(event_study, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, estimate_pct)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb27-36">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey55"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb27-37">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> transition_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey45"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb27-38">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> clean_post_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey25"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb27-39">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_ribbon</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ymin =</span> conf_low_pct, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ymax =</span> conf_high_pct), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d9e8f5"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb27-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb27-41">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">shape =</span> quarter_status), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb27-42">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb27-43">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(</span>
<span id="cb27-44">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>,</span>
<span id="cb27-45">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Differential visit change per 10pp exposure"</span>,</span>
<span id="cb27-46">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">shape =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span></span>
<span id="cb27-47">  )</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/sa3-event-study-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Differential SA3 visit-volume change by pre-policy non-bulk-billed share, relative to September quarter 2025.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1">mmm_trends <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> mmm_visits <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(modified_monash <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Unknown"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(modified_monash, quarter_date, quarter_status) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(services, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(modified_monash) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb28-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">baseline_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(services[quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> exposure_baseline_quarters<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb28-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">visit_index =</span> services <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> baseline_services</span>
<span id="cb28-9">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>()</span>
<span id="cb28-11"></span>
<span id="cb28-12"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(mmm_trends, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, visit_index, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> modified_monash)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb28-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> transition_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dotted"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey45"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb28-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_vline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xintercept =</span> clean_post_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey25"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb28-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb28-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb28-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Visit volume index"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Modified Monash"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/index_files/figure-html/mmm-visit-trends-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Modified Monash GP visit volume indexed to the four-quarter pre-policy exposure window.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1">unknown_mmm <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> mmm_visits <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb29-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter, quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb29-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb29-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">total_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(services, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb29-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">unknown_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(services[modified_monash <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Unknown"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb29-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">unknown_share =</span> unknown_services <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> total_services,</span>
<span id="cb29-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb29-8">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb29-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2023-09-01"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb29-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(quarter_date)</span>
<span id="cb29-11"></span>
<span id="cb29-12">unknown_mmm <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb29-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb29-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">total_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(total_services),</span>
<span id="cb29-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">unknown_services =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(unknown_services),</span>
<span id="cb29-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">unknown_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(unknown_share, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.001</span>)</span>
<span id="cb29-17">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb29-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 26%">
<col style="width: 16%">
<col style="width: 18%">
<col style="width: 21%">
<col style="width: 17%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">quarter</th>
<th style="text-align: left;">quarter_date</th>
<th style="text-align: left;">total_services</th>
<th style="text-align: left;">unknown_services</th>
<th style="text-align: left;">unknown_share</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">2023-24 Q1 (Sep Qtr)</td>
<td style="text-align: left;">2023-09-01</td>
<td style="text-align: left;">41,611,756</td>
<td style="text-align: left;">419</td>
<td style="text-align: left;">0.001%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2023-24 Q2 (Dec Qtr)</td>
<td style="text-align: left;">2023-12-01</td>
<td style="text-align: left;">39,169,904</td>
<td style="text-align: left;">402</td>
<td style="text-align: left;">0.001%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2023-24 Q3 (Mar Qtr)</td>
<td style="text-align: left;">2024-03-01</td>
<td style="text-align: left;">39,909,885</td>
<td style="text-align: left;">861</td>
<td style="text-align: left;">0.002%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2023-24 Q4 (Jun Qtr)</td>
<td style="text-align: left;">2024-06-01</td>
<td style="text-align: left;">43,838,981</td>
<td style="text-align: left;">9,111</td>
<td style="text-align: left;">0.021%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2024-25 Q1 (Sep Qtr)</td>
<td style="text-align: left;">2024-09-01</td>
<td style="text-align: left;">43,278,054</td>
<td style="text-align: left;">8,829</td>
<td style="text-align: left;">0.020%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2024-25 Q2 (Dec Qtr)</td>
<td style="text-align: left;">2024-12-01</td>
<td style="text-align: left;">40,206,213</td>
<td style="text-align: left;">8,403</td>
<td style="text-align: left;">0.021%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2024-25 Q3 (Mar Qtr)</td>
<td style="text-align: left;">2025-03-01</td>
<td style="text-align: left;">40,481,593</td>
<td style="text-align: left;">8,076</td>
<td style="text-align: left;">0.020%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2024-25 Q4 (Jun Qtr)</td>
<td style="text-align: left;">2025-06-01</td>
<td style="text-align: left;">43,733,040</td>
<td style="text-align: left;">7,893</td>
<td style="text-align: left;">0.018%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-26 Q1 (Sep Qtr)</td>
<td style="text-align: left;">2025-09-01</td>
<td style="text-align: left;">42,347,110</td>
<td style="text-align: left;">7,466</td>
<td style="text-align: left;">0.018%</td>
</tr>
<tr class="even">
<td style="text-align: left;">2025-26 Q2 (Dec Qtr)</td>
<td style="text-align: left;">2025-12-01</td>
<td style="text-align: left;">39,768,686</td>
<td style="text-align: left;">7,030</td>
<td style="text-align: left;">0.018%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">2025-26 Q3 (Mar Qtr)</td>
<td style="text-align: left;">2026-03-01</td>
<td style="text-align: left;">39,968,536</td>
<td style="text-align: left;">6,986</td>
<td style="text-align: left;">0.017%</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The <code>Unknown</code> Modified Monash category is excluded from the indexed MMM chart because it is tiny in absolute terms and appears to have a classification break around the June quarter 2024. It rises from hundreds of services per quarter to roughly 7,000-9,000, but still remains around 0.021% of GP non-referred attendances. That makes it visually noisy as an index and not a meaningful access geography.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1">sa3_growth <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(exposure_band) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb30-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sa3s =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(),</span>
<span id="cb30-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_pre_policy_non_bulk_billed_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(pre_policy_non_bulk_billed_share, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb30-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_visit_growth =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(visit_growth, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb30-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">weighted_visit_growth =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">weighted.mean</span>(visit_growth, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">w =</span> baseline_services, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb30-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb30-9">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb30-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_pre_policy_non_bulk_billed_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(median_pre_policy_non_bulk_billed_share, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb30-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_visit_growth =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(median_visit_growth, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb30-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">weighted_visit_growth =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(weighted_visit_growth, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb30-14">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 18%">
<col style="width: 4%">
<col style="width: 37%">
<col style="width: 18%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">exposure_band</th>
<th style="text-align: right;">sa3s</th>
<th style="text-align: left;">median_pre_policy_non_bulk_billed_share</th>
<th style="text-align: left;">median_visit_growth</th>
<th style="text-align: left;">weighted_visit_growth</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Lower room to move</td>
<td style="text-align: right;">111</td>
<td style="text-align: left;">14.7%</td>
<td style="text-align: left;">-3.8%</td>
<td style="text-align: left;">-3.8%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Middle</td>
<td style="text-align: right;">111</td>
<td style="text-align: left;">22.9%</td>
<td style="text-align: left;">-4.5%</td>
<td style="text-align: left;">-3.8%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Higher room to move</td>
<td style="text-align: right;">110</td>
<td style="text-align: left;">34.3%</td>
<td style="text-align: left;">-5.3%</td>
<td style="text-align: left;">-5.0%</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
<section id="early-answer" class="level2">
<h2 class="anchored" data-anchor-id="early-answer">Early Answer</h2>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1">national_delta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">window_compare</span>(national)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>change[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb31-2">age_delta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">window_compare</span>(age_rates) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(group, change) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(change))</span>
<span id="cb31-5">seifa_delta <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">window_compare</span>(seifa_rates) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(group, change) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(change))</span>
<span id="cb31-8">visit_access_estimate <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> access_model_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(outcome <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"GP visit volume"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(estimate) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>()</span>
<span id="cb31-12"></span>
<span id="cb31-13"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb31-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">question =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb31-15">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Did the national rate move after 1 November 2025?"</span>,</span>
<span id="cb31-16">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Was the largest age signal in working-age adults?"</span>,</span>
<span id="cb31-17">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Did lower and higher socioeconomic areas both move?"</span>,</span>
<span id="cb31-18">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Did higher-exposure SA3s also show more GP visits?"</span>,</span>
<span id="cb31-19">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Can we call this access rather than billing?"</span></span>
<span id="cb31-20">  ),</span>
<span id="cb31-21">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">early_read =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb31-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"National before/after change: "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(national_delta, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>),</span>
<span id="cb31-23">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Largest age-band change: "</span>, age_delta<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>group[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" at "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(age_delta<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>change[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>),</span>
<span id="cb31-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Largest SEIFA change: "</span>, seifa_delta<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>group[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" at "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(seifa_delta<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>change[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>),</span>
<span id="cb31-25">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SA3 fixed-effects visit estimate: "</span>, visit_access_estimate, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" per 10 percentage point higher pre-policy non-bulk-billed share."</span>),</span>
<span id="cb31-26">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Not fully. The data show billing and service-use/payment signals, not unmet need or appointment availability."</span></span>
<span id="cb31-27">  )</span>
<span id="cb31-28">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 32%">
<col style="width: 67%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">question</th>
<th style="text-align: left;">early_read</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Did the national rate move after 1 November 2025?</td>
<td style="text-align: left;">National before/after change: 3.6%.</td>
</tr>
<tr class="even">
<td style="text-align: left;">Was the largest age signal in working-age adults?</td>
<td style="text-align: left;">Largest age-band change: 16-64 at 6.2%.</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Did lower and higher socioeconomic areas both move?</td>
<td style="text-align: left;">Largest SEIFA change: 2 at 4.3%.</td>
</tr>
<tr class="even">
<td style="text-align: left;">Did higher-exposure SA3s also show more GP visits?</td>
<td style="text-align: left;">SA3 fixed-effects visit estimate: -0.4% per 10 percentage point higher pre-policy non-bulk-billed share.</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Can we call this access rather than billing?</td>
<td style="text-align: left;">Not fully. The data show billing and service-use/payment signals, not unmet need or appointment availability.</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The early read is that the 1 November 2025 changes should be treated as having shifted measured bulk billing access if the post-November lift is visible nationally, strongest for <code>16-64</code>, and not limited to places that already had high bulk billing. The broader access case is stronger if the SA3 visit-volume model shows higher-exposure areas also gaining visits after the clean post-policy quarter. The evidence is weaker if the rise is small relative to normal monthly volatility, if it does not persist in the rolling average, or if service-use checks deteriorate.</p>
</section>
<section id="caveats" class="level2">
<h2 class="anchored" data-anchor-id="caveats">Caveats</h2>
<ul>
<li>AIHW’s monthly dashboard is based on date of service; Department Medicare statistics can differ because official Medicare statistics are generally processed-date based.</li>
<li>AIHW notes that the last 3 months of monthly dashboard data are preliminary.</li>
<li>Bulk billing rate is a claim-level access proxy, not a direct measure of unmet need, waiting time or clinic availability.</li>
<li>The AIHW benefits series excludes Bulk Billing Practice Incentive Program payments.</li>
<li>LGA statistics are based on patient location. People can travel outside their LGA for care.</li>
<li>The SA3 visit model uses service counts rather than per-capita rates. SA3 fixed effects absorb stable differences between areas, but population growth can still affect visit volumes.</li>
<li>The December quarter 2025 is excluded from the visit model because it mixes one pre-policy month with two post-policy months.</li>
<li>PHN and LGA summaries in this post mix monthly AIHW dashboard data and quarterly Department statistics; they are used as triangulation, not as one single modelled dataset.</li>
<li>Modified Monash should be added with a proper spatial or fine-geography concordance before making MMM-specific claims.</li>
</ul>


<!-- -->

</section>

 ]]></description>
  <category>medicare</category>
  <category>bulk-billing</category>
  <category>health-policy</category>
  <category>australia</category>
  <guid>https://blog.aydins-workbench.com/posts/bulk-billing-changes-impact/</guid>
  <pubDate>Thu, 28 May 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>Questions, Data Sources and Half-Decent Rabbit Holes</title>
  <dc:creator>Aydin </dc:creator>
  <link>https://blog.aydins-workbench.com/posts/australian-data-sources/</link>
  <description><![CDATA[ 




<p>This site is basically a place to ask public policy questions and see whether public data can give us better context, maybe even the occasional answer.</p>
<p>The vibe is: pick a real policy question, find the best public dataset I can, do the analysis transparently, and be honest about what the data cannot tell us. A lot of this is for fun, interest, and keeping the data muscles from getting too creaky. So, as ever: grain of salt, ideally iodised.</p>
<p>Public datasets are useful, but they are rarely complete. They usually show service use, claims, budgets, or reported outcomes. They do not magically reveal need, quality, unmet demand, implementation messiness, or the lived experience behind the row counts. Still, they are often enough to make a policy conversation a bit less foggy.</p>
<section id="how-i-want-posts-to-work" class="level2">
<h2 class="anchored" data-anchor-id="how-i-want-posts-to-work">How I Want Posts To Work</h2>
<p>The rough template is:</p>
<ol type="1">
<li>Ask one question.</li>
<li>Find one credible dataset.</li>
<li>Make a couple of clear charts.</li>
<li>Explain the main pattern.</li>
<li>Say what would change my mind.</li>
</ol>
<p>That last part matters. The goal is to be interesting without pretending to be the final word.</p>
</section>
<section id="datasets-worth-keeping-handy" class="level2">
<h2 class="anchored" data-anchor-id="datasets-worth-keeping-handy">Datasets Worth Keeping Handy</h2>
<section id="health-care-and-disability" class="level3">
<h3 class="anchored" data-anchor-id="health-care-and-disability">Health, Care And Disability</h3>
<ul>
<li><a href="https://www.aihw.gov.au/reports-data">Australian Institute of Health and Welfare</a>: national reports, data tables, health and welfare statistics, hospitals, Medicare and service-access indicators.</li>
<li><a href="https://www.aihw.gov.au/about-our-data/our-data-collections">AIHW data collections</a>: a useful map of AIHW’s major data holdings.</li>
<li><a href="https://www.health.gov.au/resources/collections/medicare-statistics-collection">Medicare statistics collection</a>: MBS service counts, benefits, bulk billing, provider geography and item-level trends.</li>
<li><a href="https://www.pbs.gov.au/info/browse/statistics">PBS statistics</a>: prescriptions, expenditure, medicine groups and affordability signals.</li>
<li><a href="https://www.abs.gov.au/statistics/health/health-conditions-and-risks/national-health-survey/2022">ABS National Health Survey</a>: chronic conditions, risk factors, disability and self-assessed health.</li>
<li><a href="https://www.abs.gov.au/statistics/health/health-services/patient-experiences">ABS Patient Experiences</a>: access, affordability, delayed care, GP, specialist, dental and prescription barriers.</li>
<li><a href="https://dataresearch.ndis.gov.au/datasets">NDIS datasets</a>: participant numbers, plan budgets, utilisation, disability group, payments, providers and regional summaries.</li>
<li><a href="https://www.health.gov.au/contacts/gen-aged-care-data">GEN Aged Care Data</a>: aged care services, places, providers, use and links into hospital pressure.</li>
<li><a href="https://www.servicesaustralia.gov.au/australian-immunisation-register-statistics">Australian Immunisation Register statistics</a>: vaccine coverage and trend summaries.</li>
</ul>
</section>
<section id="population-places-and-context" class="level3">
<h3 class="anchored" data-anchor-id="population-places-and-context">Population, Places And Context</h3>
<ul>
<li><a href="https://www.abs.gov.au/about/data-services/application-programming-interfaces-apis/data-api-user-guide">ABS Data API</a>: programmatic access to Census, labour, demographic and regional data.</li>
<li><a href="https://www.abs.gov.au/statistics/people/population/regional-population">ABS regional data</a>: regional population, age structure and place-based context.</li>
<li><a href="https://www.abs.gov.au/statistics/people/people-and-communities/socio-economic-indexes-areas-seifa-australia/2021">SEIFA</a>: area-level socioeconomic context.</li>
<li><a href="https://www.pc.gov.au/ongoing/report-on-government-services">Report on Government Services</a>: comparable data across health, housing, justice, education and community services.</li>
<li><a href="https://www.pc.gov.au/research">Productivity Commission research</a>: reform work, policy reviews and background evidence.</li>
<li><a href="https://data.gov.au/">Australian Government data portal</a>: broad open data catalogue. Sometimes treasure, sometimes cupboard of mystery jars.</li>
</ul>
</section>
<section id="housing-and-cost-of-living" class="level3">
<h3 class="anchored" data-anchor-id="housing-and-cost-of-living">Housing And Cost Of Living</h3>
<ul>
<li><a href="https://www.abs.gov.au/statistics/economy/price-indexes-and-inflation/total-value-dwellings/latest-release">ABS Total Value of Dwellings</a>: mean dwelling prices, dwelling stock values and state comparisons.</li>
<li><a href="https://www.abs.gov.au/statistics/economy/finance/lending-indicators/latest-release">ABS Lending Indicators</a>: owner-occupier, investor and first-home buyer loan commitments.</li>
<li><a href="https://www.abs.gov.au/statistics/industry/building-and-construction/building-approvals-australia/latest-release">ABS Building Approvals</a>: dwelling approvals and construction pipeline signals.</li>
<li><a href="https://www.housingaustralia.gov.au/">Housing Australia</a>: housing programs, guarantees, shared equity and related scheme information.</li>
</ul>
</section>
</section>
<section id="running-policy-question-list" class="level2">
<h2 class="anchored" data-anchor-id="running-policy-question-list">Running Policy Question List</h2>
<section id="health-access" class="level3">
<h3 class="anchored" data-anchor-id="health-access">Health Access</h3>
<ul>
<li>Did the expanded bulk billing incentives from 1 November 2025 change GP bulk billing rates, appointment volumes, or just the billing mix?</li>
<li>Did the new Bulk Billing Practice Incentive Program show up differently in metropolitan, regional and remote areas?</li>
<li>Are areas with low GP bulk billing also showing more emergency department pressure?</li>
<li>Are MBS telehealth patterns settling into a stable access role, or fading back toward pre-pandemic geography?</li>
<li>Do areas with lower specialist service use have higher potentially preventable hospitalisations?</li>
<li>After PBS co-payment changes, are chronic-disease medicine claims changing more for concession-heavy areas?</li>
</ul>
</section>
<section id="ndis-disability-and-outcomes" class="level3">
<h3 class="anchored" data-anchor-id="ndis-disability-and-outcomes">NDIS, Disability And Outcomes</h3>
<ul>
<li>Is NDIS participation growing faster than the population, and where is that growth most concentrated?</li>
<li>Are utilisation gaps more about provider supply, participant mix, thin markets, administrative friction, or plan timing?</li>
<li>Which disability groups are driving payment growth, and are those changes broad-based or concentrated in particular supports?</li>
<li>As new NDIS framework planning begins from mid-2026, do plan budgets become more consistent for similar public-data groups?</li>
<li>Can participant outcome indicators be treated as investment signals, not just nice-to-have survey outcomes?</li>
<li>Are regions with stronger service access also showing better NDIS outcomes over time?</li>
</ul>
</section>
<section id="aged-care" class="level3">
<h3 class="anchored" data-anchor-id="aged-care">Aged Care</h3>
<ul>
<li>After the new Aged Care Act and Support at Home started on 1 November 2025, do hospital discharge and aged-care access indicators move differently by region?</li>
<li>Are home-care service volumes changing in ways that suggest substitution away from residential care or hospital stays?</li>
<li>Which regions have the biggest mismatch between ageing population growth and aged-care service availability?</li>
</ul>
</section>
<section id="housing-and-cost-of-living-1" class="level3">
<h3 class="anchored" data-anchor-id="housing-and-cost-of-living-1">Housing And Cost Of Living</h3>
<ul>
<li>After the 5% Deposit Scheme expansion from 1 October 2025, did first-home buyer loan commitments rise in the places where prices were already moving fastest?</li>
<li>Are first-home buyer supports being offset by higher mean dwelling prices, or are they mainly changing who can enter the market?</li>
<li>Are building approvals rising in the places with the fastest dwelling-price growth, or are supply signals lagging demand signals?</li>
<li>Are investor lending changes leading or following price changes across states?</li>
<li>Do rents, dwelling prices, income and population growth tell the same story by region, or are they pulling in different directions?</li>
</ul>
</section>
<section id="climate-housing-and-health" class="level3">
<h3 class="anchored" data-anchor-id="climate-housing-and-health">Climate, Housing And Health</h3>
<ul>
<li>Which urban areas combine heat exposure, poor housing quality, low income and higher chronic disease risk?</li>
<li>Do energy-bill relief or efficiency programs show up in hardship, health or consumption indicators?</li>
<li>Are climate-related health risks visible in emergency presentations, ambulance callouts or mortality data by region?</li>
</ul>
</section>
</section>
<section id="modelling-notes" class="level2">
<h2 class="anchored" data-anchor-id="modelling-notes">Modelling Notes</h2>
<ul>
<li>Treat MBS and PBS as claims and service-use datasets, not direct measures of health need.</li>
<li>Treat budgets, payments and outcomes as different things. They overlap, but they do not answer the same question.</li>
<li>For regional modelling, add ABS context: age structure, income, labour force status, housing, remoteness, disability prevalence, language and area disadvantage.</li>
<li>Use time-aware validation when possible: train on earlier periods, test on later ones, and keep policy-change dates explicit.</li>
<li>Do not turn prediction into allocation advice. For public writing, models are better framed as descriptive, diagnostic or forecasting tools.</li>
</ul>
</section>
<section id="post-selection-checklist" class="level2">
<h2 class="anchored" data-anchor-id="post-selection-checklist">Post Selection Checklist</h2>
<p>Before starting an analysis:</p>
<ul>
<li>Is the question specific enough for one post?</li>
<li>Is the dataset public and stable enough to rerender?</li>
<li>Are the definitions readable for someone who is not already living inside the spreadsheet?</li>
<li>Can the analysis be reproduced from code?</li>
<li>Is there a caveat section that actually says something useful?</li>
</ul>
<p>That is the whole operating system, really. Ask the question, check the data, stay curious, do not overclaim.</p>


<!-- -->

</section>

 ]]></description>
  <category>data</category>
  <category>australia</category>
  <category>health</category>
  <category>policy</category>
  <category>methods</category>
  <guid>https://blog.aydins-workbench.com/posts/australian-data-sources/</guid>
  <pubDate>Tue, 26 May 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>What Is Driving NDIS Spend Growth?</title>
  <dc:creator>Aydin </dc:creator>
  <link>https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/</link>
  <description><![CDATA[ 




<p>The National Disability Insurance Scheme is usually discussed through one big number: total spend. That is not wrong, but it hides several different mechanisms. Spend can grow because more people enter the scheme, because average plan budgets rise, because participants use more of their approved supports, or because the participant mix changes toward groups with higher support needs.</p>
<p>This post uses the short public quarterly window to tell a descriptive spend-growth story:</p>
<ol type="1">
<li>How quickly is observed NDIS spend growing?</li>
<li>Is scheme participation growing faster than the Australian population?</li>
<li>Is spend pressure coming more from participant growth, average budgets, or utilisation?</li>
<li>Which disability groups appear largest, most expensive, and fastest growing?</li>
<li>What public explanatory factors help describe grouped quarterly spend?</li>
</ol>
<p>The models are descriptive, not funding advice and not a participant-level forecast. I deliberately avoid lagged payment and lagged budget features in the overall spend model: those improve fit, but they mostly tell us that last quarter predicts this quarter. The aim here is to describe observable drivers.</p>
<section id="data-sources" class="level2">
<h2 class="anchored" data-anchor-id="data-sources">Data Sources</h2>
<p>The workflow downloads source files from the <a href="https://dataresearch.ndis.gov.au/datasets/participant-datasets">NDIS participant datasets</a>, <a href="https://dataresearch.ndis.gov.au/datasets/provider-datasets">NDIS provider datasets</a>, and <a href="https://dataresearch.ndis.gov.au/datasets/payments-datasets">NDIS payments datasets</a>. It focuses on plan budgets, utilisation, providers, market concentration, payments, and LGA mapping files. It also uses ABS estimated resident population from <a href="https://www.abs.gov.au/statistics/people/population/national-state-and-territory-population/latest-release">National, state and territory population</a>, then tries to add regional context from <a href="https://www.abs.gov.au/statistics/people/people-and-communities/socio-economic-indexes-areas-seifa-australia/2021">SEIFA 2021</a> and population age structure. If the ABS files change shape, the NDIS-only analysis still runs and reports the missing context.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1">clean_names <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-2">  x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&amp;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"and"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"[^a-z0-9]+"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^_|_$"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb1-7">}</span>
<span id="cb1-8"></span>
<span id="cb1-9">clean_df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(x) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_names</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(x))</span>
<span id="cb1-11">  x</span>
<span id="cb1-12">}</span>
<span id="cb1-13"></span>
<span id="cb1-14">as_number <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-15">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.numeric</span>(x)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(x)</span>
<span id="cb1-16">  x_chr <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(x)</span>
<span id="cb1-17">  out <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">parse_number</span>(x_chr, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NA"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"n/a"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Not applicable"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No data available"</span>))</span>
<span id="cb1-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(x_chr, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">s*&lt;"</span>), <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, out)</span>
<span id="cb1-19">}</span>
<span id="cb1-20"></span>
<span id="cb1-21">as_rate <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-22">  out <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(x)</span>
<span id="cb1-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(out <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, out <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>, out)</span>
<span id="cb1-24">}</span>
<span id="cb1-25"></span>
<span id="cb1-26">safe_sum <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-27">  x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(x)]</span>
<span id="cb1-28">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>)</span>
<span id="cb1-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(x)</span>
<span id="cb1-30">}</span>
<span id="cb1-31"></span>
<span id="cb1-32">safe_mean <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-33">  x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(x)]</span>
<span id="cb1-34">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>)</span>
<span id="cb1-35">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(x)</span>
<span id="cb1-36">}</span>
<span id="cb1-37"></span>
<span id="cb1-38">safe_median <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-39">  x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(x)]</span>
<span id="cb1-40">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>)</span>
<span id="cb1-41">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(x)</span>
<span id="cb1-42">}</span>
<span id="cb1-43"></span>
<span id="cb1-44">safe_mode_character <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-45">  x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(x)</span>
<span id="cb1-46">  x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x[<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>]</span>
<span id="cb1-47">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>)</span>
<span id="cb1-48">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">table</span>(x), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">decreasing =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb1-49">}</span>
<span id="cb1-50"></span>
<span id="cb1-51">collapse_top_values <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>) {</span>
<span id="cb1-52">  x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(x)</span>
<span id="cb1-53">  x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(x[<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>])</span>
<span id="cb1-54">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>)</span>
<span id="cb1-55">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(x), n), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>)</span>
<span id="cb1-56">}</span>
<span id="cb1-57"></span>
<span id="cb1-58">safe_weighted_mean <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x, w) {</span>
<span id="cb1-59">  x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(x)</span>
<span id="cb1-60">  w <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(w)</span>
<span id="cb1-61">  keep <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(w) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> w <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb1-62">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(keep)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">weighted.mean</span>(x[keep], w[keep]))</span>
<span id="cb1-63">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(x)</span>
<span id="cb1-64">}</span>
<span id="cb1-65"></span>
<span id="cb1-66">has_enough_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data, cols, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">min_rows =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) {</span>
<span id="cb1-67">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(data) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> min_rows) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb1-68">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">all</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_lgl</span>(cols, \(col) col <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(data) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(data[[col]])) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> min_rows))</span>
<span id="cb1-69">}</span>
<span id="cb1-70"></span>
<span id="cb1-71">format_optional_number <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">suffix =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) {</span>
<span id="cb1-72">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(x), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Not joined"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> accuracy), suffix))</span>
<span id="cb1-73">}</span>
<span id="cb1-74"></span>
<span id="cb1-75">format_optional_percent <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>) {</span>
<span id="cb1-76">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(x), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Not joined"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> accuracy))</span>
<span id="cb1-77">}</span>
<span id="cb1-78"></span>
<span id="cb1-79">index_to_first <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-80">  bases <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]</span>
<span id="cb1-81">  base <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(bases) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) bases[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span></span>
<span id="cb1-82">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(base) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">||</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(base)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(x)))</span>
<span id="cb1-83">  x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> base <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb1-84">}</span>
<span id="cb1-85"></span>
<span id="cb1-86">pretty_feature <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-87">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">recode</span>(</span>
<span id="cb1-88">    x,</span>
<span id="cb1-89">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_index =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"time"</span>,</span>
<span id="cb1-90">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participant count"</span>,</span>
<span id="cb1-91">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_providers =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"active providers"</span>,</span>
<span id="cb1-92">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants_per_provider =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participants per active provider"</span>,</span>
<span id="cb1-93">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"top-10 provider payment share"</span>,</span>
<span id="cb1-94">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_score =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SEIFA disadvantage score"</span>,</span>
<span id="cb1-95">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SEIFA disadvantage decile"</span>,</span>
<span id="cb1-96">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ier_score =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"economic resources score"</span>,</span>
<span id="cb1-97">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ier_decile =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"economic resources decile"</span>,</span>
<span id="cb1-98">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ieo_score =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"education/occupation score"</span>,</span>
<span id="cb1-99">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ieo_decile =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"education/occupation decile"</span>,</span>
<span id="cb1-100">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_age =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"median local age"</span>,</span>
<span id="cb1-101">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_0_14 =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local population aged 0-14"</span>,</span>
<span id="cb1-102">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_15_64 =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local population aged 15-64"</span>,</span>
<span id="cb1-103">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local population aged 65+"</span>,</span>
<span id="cb1-104">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_lga_population =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local population"</span>,</span>
<span id="cb1-105">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_rank =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness"</span>,</span>
<span id="cb1-106">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_major_cities_share =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"major-cities share"</span>,</span>
<span id="cb1-107">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_inner_regional_share =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"inner-regional share"</span>,</span>
<span id="cb1-108">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_outer_regional_share =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outer-regional share"</span>,</span>
<span id="cb1-109">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_remote_share =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remote share"</span>,</span>
<span id="cb1-110">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_very_remote_share =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"very-remote share"</span>,</span>
<span id="cb1-111">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_budget =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"average support budget"</span>,</span>
<span id="cb1-112">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>,</span>
<span id="cb1-113">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service district"</span>,</span>
<span id="cb1-114">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">age_group =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age group"</span>,</span>
<span id="cb1-115">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">disability_group =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability group"</span>,</span>
<span id="cb1-116">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_class =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support class"</span>,</span>
<span id="cb1-117">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness"</span>,</span>
<span id="cb1-118">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.default =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(x, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>)</span>
<span id="cb1-119">  )</span>
<span id="cb1-120">}</span>
<span id="cb1-121"></span>
<span id="cb1-122">top_rf_predictors <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(model, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) {</span>
<span id="cb1-123">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">importance</span>(model) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-124">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-125">    tibble<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames_to_column</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feature"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-126">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(IncNodePurity)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-127">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> n) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-128">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(feature) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-129">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pretty_feature</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-130">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>)</span>
<span id="cb1-131">}</span>
<span id="cb1-132"></span>
<span id="cb1-133">first_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data, patterns, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) {</span>
<span id="cb1-134">  hits <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(data)[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_lgl</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(data), \(nm) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(nm, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">regex</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(patterns, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ignore_case =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))))]</span>
<span id="cb1-135">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(hits) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb1-136">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (required) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">stop</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Could not find column matching: "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(patterns, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>))</span>
<span id="cb1-137">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>)</span>
<span id="cb1-138">  }</span>
<span id="cb1-139">  hits[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb1-140">}</span>
<span id="cb1-141"></span>
<span id="cb1-142">sample_rows <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8000</span>) {</span>
<span id="cb1-143">  data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_sample</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(data), n))</span>
<span id="cb1-144">}</span>
<span id="cb1-145"></span>
<span id="cb1-146">normalise_service_district <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {</span>
<span id="cb1-147">  x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-148">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-149">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^[A-Z]{2,3}~"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-150">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_squish</span>()</span>
<span id="cb1-151">}</span>
<span id="cb1-152"></span>
<span id="cb1-153">read_page <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(url) {</span>
<span id="cb1-154">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">readLines</span>(url, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">warn =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">encoding =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"UTF-8"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\n</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span>)</span>
<span id="cb1-155">}</span>
<span id="cb1-156"></span>
<span id="cb1-157">extract_links <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(url) {</span>
<span id="cb1-158">  html <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_page</span>(url)</span>
<span id="cb1-159">  base_url <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace</span>(url, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^(https?://[^/]+).*$"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">1"</span>)</span>
<span id="cb1-160">  matches <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gregexpr</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;a[^&gt;]+href=[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">']([^</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">']+)[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'][^&gt;]*&gt;(.*?)&lt;/a&gt;"</span>, html, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">perl =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb1-161">  pieces <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">regmatches</span>(html, matches)[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]]</span>
<span id="cb1-162">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(pieces) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>()))</span>
<span id="cb1-163">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">raw =</span> pieces) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-164">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-165">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">href =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_match</span>(raw, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"href=[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">']([^</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">']+)[</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">']"</span>)[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>],</span>
<span id="cb1-166">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> raw <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-167">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;[^&gt;]+&gt;"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-168">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_squish</span>(),</span>
<span id="cb1-169">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb1-170">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(href, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^https?://"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> href,</span>
<span id="cb1-171">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(href, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^/"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(base_url, href),</span>
<span id="cb1-172">        <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_remove</span>(url, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/[^/]*$"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/"</span>, href)</span>
<span id="cb1-173">      )</span>
<span id="cb1-174">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-175">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(label, url)</span>
<span id="cb1-176">}</span>
<span id="cb1-177"></span>
<span id="cb1-178">quarter_from_label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(label) {</span>
<span id="cb1-179">  month <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_match</span>(label, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(March|June|September|December)"</span>)[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb1-180">  year <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_match</span>(label, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"(20[0-9]{2})"</span>)[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb1-181">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(month, year)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-182">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(analysis_quarters, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_label"</span>)</span>
<span id="cb1-183">}</span>
<span id="cb1-184"></span>
<span id="cb1-185">download_one <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(url, filename) {</span>
<span id="cb1-186">  path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.path</span>(raw_dir, filename)</span>
<span id="cb1-187">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(path) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">||</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(filename, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">.xlsx?$"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is_xlsx_file</span>(path))) {</span>
<span id="cb1-188">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download.file</span>(url, path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mode =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"wb"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb1-189">  }</span>
<span id="cb1-190">  path</span>
<span id="cb1-191">}</span>
<span id="cb1-192"></span>
<span id="cb1-193">download_quarterly <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(page_url, label_regex, prefix) {</span>
<span id="cb1-194">  links <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">extract_links</span>(page_url) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-195">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(label, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">regex</span>(label_regex, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ignore_case =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-196">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">row_id =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">row_number</span>()) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-197">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_cols</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quarter_from_label</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">extract_links</span>(page_url) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-198">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(label, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">regex</span>(label_regex, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ignore_case =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-199">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(label))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-200">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>row_id) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-201">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(quarter_date), quarter_label <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> analysis_quarters<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_label) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-202">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>(quarter_label, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.keep_all =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-203">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(quarter_date)</span>
<span id="cb1-204"></span>
<span id="cb1-205">  missing <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setdiff</span>(analysis_quarters<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_label, links<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_label)</span>
<span id="cb1-206">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(missing) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb1-207">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">message</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Missing visible links for "</span>, prefix, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">": "</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(missing, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>))</span>
<span id="cb1-208">  }</span>
<span id="cb1-209"></span>
<span id="cb1-210">  links <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-211">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-212">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">path =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map2_chr</span>(url, quarter_label, \(u, q) {</span>
<span id="cb1-213">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_one</span>(u, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(prefix, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>(q), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" "</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".csv"</span>))</span>
<span id="cb1-214">      })</span>
<span id="cb1-215">    )</span>
<span id="cb1-216">}</span>
<span id="cb1-217"></span>
<span id="cb1-218">is_xlsx_file <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(path) {</span>
<span id="cb1-219">  sig <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">readBin</span>(path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">what =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"raw"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb1-220">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">identical</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(sig[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.integer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">charToRaw</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"PK"</span>)))</span>
<span id="cb1-221">}</span>
<span id="cb1-222"></span>
<span id="cb1-223">read_public_table <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(path) {</span>
<span id="cb1-224">  out <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is_xlsx_file</span>(path) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">||</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(path, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">regex</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">.xls$|</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">.xlsx$"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ignore_case =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))) {</span>
<span id="cb1-225">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(path) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>()</span>
<span id="cb1-226">  } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb1-227">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_csv</span>(path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">show_col_types =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>()</span>
<span id="cb1-228">  }</span>
<span id="cb1-229">  out <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">everything</span>(), as.character))</span>
<span id="cb1-230">}</span>
<span id="cb1-231"></span>
<span id="cb1-232">read_quarterly_csvs <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(links) {</span>
<span id="cb1-233">  links <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-234">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(path, read_public_table)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-235">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(quarter_label, quarter_date, quarter_index, data) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-236">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unnest</span>(data)</span>
<span id="cb1-237">}</span>
<span id="cb1-238"></span>
<span id="cb1-239">download_named <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(page_url, label_regex, filename) {</span>
<span id="cb1-240">  link <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">extract_links</span>(page_url) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-241">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(label, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">regex</span>(label_regex, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ignore_case =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-242">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb1-243">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(link) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>)</span>
<span id="cb1-244">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_one</span>(link<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>url[[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]], filename)</span>
<span id="cb1-245">}</span>
<span id="cb1-246"></span>
<span id="cb1-247">extension_from_url <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(url, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">default =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">".csv"</span>) {</span>
<span id="cb1-248">  ext <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_match</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>(url), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">.(csv|xlsx|xls|zip)(</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">?|$)"</span>)[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]</span>
<span id="cb1-249">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(ext), default, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"."</span>, ext))</span>
<span id="cb1-250">}</span>
<span id="cb1-251"></span>
<span id="cb1-252">download_matching <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(page_url, label_regex, prefix, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">limit =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">Inf</span>) {</span>
<span id="cb1-253">  links <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">extract_links</span>(page_url) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-254">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(label, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">regex</span>(label_regex, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ignore_case =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-255">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>(label, url) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-256">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> limit)</span>
<span id="cb1-257"></span>
<span id="cb1-258">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(links) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb1-259">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">url =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">path =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>()))</span>
<span id="cb1-260">  }</span>
<span id="cb1-261"></span>
<span id="cb1-262">  links <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-263">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-264">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">path =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmap_chr</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(url, label, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">row_number</span>()), \(u, lab, i) {</span>
<span id="cb1-265">        safe_label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> lab <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-266">          <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-267">          <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"[^a-z0-9]+"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-268">          <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^_|_$"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb1-269">          <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_trunc</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ellipsis =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb1-270">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_one</span>(u, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(prefix, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_pad</span>(i, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pad =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_"</span>, safe_label, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">extension_from_url</span>(u)))</span>
<span id="cb1-271">      })</span>
<span id="cb1-272">    )</span>
<span id="cb1-273">}</span></code></pre></div></div>
</details>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1">budget_links <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_quarterly</span>(</span>
<span id="cb2-2">  page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>participant,</span>
<span id="cb2-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Participant numbers and plan budgets data"</span>,</span>
<span id="cb2-4">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participant_plan_budgets"</span></span>
<span id="cb2-5">)</span>
<span id="cb2-6"></span>
<span id="cb2-7">utilisation_links <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_quarterly</span>(</span>
<span id="cb2-8">  page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>participant,</span>
<span id="cb2-9">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Utilisation of Plan budgets data"</span>,</span>
<span id="cb2-10">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"plan_utilisation"</span></span>
<span id="cb2-11">)</span>
<span id="cb2-12"></span>
<span id="cb2-13">provider_links <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_quarterly</span>(</span>
<span id="cb2-14">  page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>provider,</span>
<span id="cb2-15">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Active providers data"</span>,</span>
<span id="cb2-16">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"active_providers"</span></span>
<span id="cb2-17">)</span>
<span id="cb2-18"></span>
<span id="cb2-19">budget_raw <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_quarterly_csvs</span>(budget_links)</span>
<span id="cb2-20">utilisation_raw <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_quarterly_csvs</span>(utilisation_links)</span>
<span id="cb2-21">provider_raw <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_quarterly_csvs</span>(provider_links)</span>
<span id="cb2-22"></span>
<span id="cb2-23">lga_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_named</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>participant, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Participants by LGA data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participants_by_lga.csv"</span>)</span>
<span id="cb2-24">service_lga_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_named</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>participant, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Service District to LGA 2021 data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district_to_lga_2021.csv"</span>)</span>
<span id="cb2-25">market_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_named</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>provider, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Market Concentration data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"market_concentration.csv"</span>)</span>
<span id="cb2-26">payments_links <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_quarterly</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>payments, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Payments data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"payments"</span>)</span>
<span id="cb2-27">payments_raw <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_quarterly_csvs</span>(payments_links)</span>
<span id="cb2-28"></span>
<span id="cb2-29">baseline_outcomes_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_named</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>participant, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Baseline Outcomes data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"baseline_outcomes.csv"</span>)</span>
<span id="cb2-30">longitudinal_outcomes_path <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_named</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>participant, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^Longitudinal Outcomes data"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"longitudinal_outcomes.csv"</span>)</span>
<span id="cb2-31">regional_outcome_links <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_matching</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>outcomes, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"by Service District Accessible"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"regional_outcomes_service_district"</span>)</span></code></pre></div></div>
</details>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1">standardise_budget <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data) {</span>
<span id="cb3-2">  state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_territory"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-3">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_cd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"statecd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-4">  service <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvc_dstrct_nm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvcdstrctnm"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-5">  age <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^age"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_band"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_bnd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"agebnd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-6">  disability <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsblty_grp_nm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsbltygrpnm"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-7">  support <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_category"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"supp_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"suppclass"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-8">  participants <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"active.*participant"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"actv_prtcpnt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"actvprtcpnt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"number.*participant"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participant.*count"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participants"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-9">  budget <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"average.*support"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"average.*budget"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"average.*annual"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"avg.*annual"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"avg_anlsd_cmtd_supp_bdgt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"avganlsdcmtdsuppbdgt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"committed"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb3-10"></span>
<span id="cb3-11">  data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb3-13">      quarter_label, quarter_date, quarter_index,</span>
<span id="cb3-14">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) .data[[state]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-15">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">normalise_service_district</span>(.data[[service]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-16">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">age_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(age)) .data[[age]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-17">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">disability_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(disability)) .data[[disability]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-18">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_class =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(support)) .data[[support]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-19">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_count =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(participants)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[participants]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb3-20">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_support_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[budget]])</span>
<span id="cb3-21">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(avg_support_budget), state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, service_district <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, age_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, disability_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>)</span>
<span id="cb3-23">}</span>
<span id="cb3-24"></span>
<span id="cb3-25">standardise_national_participants <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data) {</span>
<span id="cb3-26">  state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_territory"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-27">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_cd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"statecd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-28">  service <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvc_dstrct_nm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvcdstrctnm"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-29">  age <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^age"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_band"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_bnd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"agebnd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-30">  disability <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsblty_grp_nm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsbltygrpnm"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-31">  support <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_category"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"supp_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"suppclass"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-32">  participants <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"active.*participant"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"actv_prtcpnt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"actvprtcpnt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"number.*participant"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participant.*count"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participants"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-33"></span>
<span id="cb3-34">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(participants)) {</span>
<span id="cb3-35">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb3-36">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_label =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>()),</span>
<span id="cb3-37">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_index =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ndis_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb3-38">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_basis =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>()</span>
<span id="cb3-39">    ))</span>
<span id="cb3-40">  }</span>
<span id="cb3-41"></span>
<span id="cb3-42">  data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-43">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb3-44">      quarter_label, quarter_date, quarter_index,</span>
<span id="cb3-45">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) .data[[state]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-46">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">normalise_service_district</span>(.data[[service]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-47">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">age_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(age)) .data[[age]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-48">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">disability_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(disability)) .data[[disability]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-49">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_class =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(support)) .data[[support]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-50">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_count =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[participants]])</span>
<span id="cb3-51">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-52">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(participant_count), participant_count <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-53">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb3-54">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">detail_count =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rowSums</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(</span>
<span id="cb3-55">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(state, service_district, age_group, disability_group, support_class),</span>
<span id="cb3-56">        \(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span></span>
<span id="cb3-57">      ))</span>
<span id="cb3-58">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-59">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_label, quarter_date, quarter_index) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-60">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(detail_count <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(detail_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-61">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb3-62">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ndis_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb3-63">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">detail_count =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(detail_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb3-64">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_basis =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(detail_count <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"National aggregate row"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Least-detailed rows summed"</span>),</span>
<span id="cb3-65">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb3-66">    )</span>
<span id="cb3-67">}</span>
<span id="cb3-68"></span>
<span id="cb3-69">standardise_utilisation <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data) {</span>
<span id="cb3-70">  state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_territory"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-71">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_cd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"statecd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-72">  service <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvc_dstrct_nm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvcdstrctnm"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-73">  age <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^age"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_band"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_bnd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"agebnd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-74">  disability <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsblty_grp_nm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsbltygrpnm"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-75">  support <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_category"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"supp_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"suppclass"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-76">  sil_sda <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sil_or_sda"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"silorsda"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sil.*sda"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-77">  utilisation <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"utilisation"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"utilization"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"utlstn"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb3-78"></span>
<span id="cb3-79">  data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-80">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb3-81">      quarter_label, quarter_date, quarter_index,</span>
<span id="cb3-82">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) .data[[state]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-83">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">normalise_service_district</span>(.data[[service]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-84">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">age_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(age)) .data[[age]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-85">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">disability_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(disability)) .data[[disability]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-86">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_class =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(support)) .data[[support]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-87">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sil_or_sda =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(sil_sda)) .data[[sil_sda]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-88">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_rate</span>(.data[[utilisation]])</span>
<span id="cb3-89">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-90">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(utilisation_rate), state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, service_district <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, age_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, disability_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>)</span>
<span id="cb3-91">}</span>
<span id="cb3-92"></span>
<span id="cb3-93">standardise_provider <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data) {</span>
<span id="cb3-94">  state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_territory"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-95">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_cd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"statecd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-96">  age <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^age"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_band"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_bnd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"agebnd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-97">  disability <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsblty_grp_nm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dsbltygrpnm"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-98">  support <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_category"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"supp_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"suppclass"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-99">  providers <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"active.*provider"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prvdr_cnt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prvdrcnt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"number.*provider"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"provider.*count"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"providers"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb3-100"></span>
<span id="cb3-101">  data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-102">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb3-103">      quarter_label, quarter_date, quarter_index,</span>
<span id="cb3-104">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) .data[[state]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-105">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">age_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(age)) .data[[age]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-106">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">disability_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(disability)) .data[[disability]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-107">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_class =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(support)) .data[[support]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-108">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">active_providers =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[providers]])</span>
<span id="cb3-109">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-110">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, age_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, disability_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-111">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_label, quarter_date, quarter_index, state, age_group, disability_group, support_class) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-112">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">active_providers =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(active_providers, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>)</span>
<span id="cb3-113">}</span>
<span id="cb3-114"></span>
<span id="cb3-115">standardise_payments <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data) {</span>
<span id="cb3-116">  support_class <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^supp_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^suppclass"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-117">  support_category <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"supp_cat_nm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"suppcatnm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_category"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-118">  support_item_number <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"supp_item_nmbr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"suppitemnmbr"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"item_number"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-119">  support_item_desc <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"supp_item_desc"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"suppitemdesc"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"item_desc"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-120">  state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rsds_in_state_cd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rsdsinstatecd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^state"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-121">  service <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rsds_in_srvc_dstrct_nm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rsdsinsrvcdstrctnm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-122">  disability <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ndis_dsblty_grp_nm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ndisdsbltygrpnm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-123">  age <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ndia_age_bnd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ndiaagebnd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-124">  payments <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pmt_amt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pmtamt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"payment"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb3-125">  participants <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"count_of_participants"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"countofparticipants"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participant"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-126"></span>
<span id="cb3-127">  data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-128">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb3-129">      quarter_label, quarter_date, quarter_index,</span>
<span id="cb3-130">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_class =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(support_class)) .data[[support_class]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-131">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_category =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(support_category)) .data[[support_category]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-132">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_item_number =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(support_item_number)) .data[[support_item_number]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-133">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_item_desc =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(support_item_desc)) .data[[support_item_desc]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-134">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) .data[[state]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-135">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">normalise_service_district</span>(.data[[service]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-136">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">disability_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(disability)) .data[[disability]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-137">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">age_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(age)) .data[[age]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-138">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[payments]]),</span>
<span id="cb3-139">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_participants =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(participants)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[participants]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span></span>
<span id="cb3-140">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-141">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> payment_amount <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> payment_participants)</span>
<span id="cb3-142">}</span>
<span id="cb3-143"></span>
<span id="cb3-144">standardise_market <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(path) {</span>
<span id="cb3-145">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(path) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">||</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(path)) {</span>
<span id="cb3-146">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb3-147">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">market_quarter_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>()),</span>
<span id="cb3-148">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb3-149">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb3-150">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_class =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb3-151">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb3-152">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_band =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>()</span>
<span id="cb3-153">    ))</span>
<span id="cb3-154">  }</span>
<span id="cb3-155"></span>
<span id="cb3-156">  data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_public_table</span>(path)</span>
<span id="cb3-157">  report <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rprt_dt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rprtdt"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-158">  state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_cd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"statecd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-159">  service <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvc_dstrct_nm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvcdstrctnm"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-160">  support <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"supp_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"suppclass"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-161">  share <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymnt_share_of_top10"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymntshareoftop10"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"share.*top10"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-162">  band <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymnt_bnd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pymntbnd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"payment.*band"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-163"></span>
<span id="cb3-164">  data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-165">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb3-166">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">market_report =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(report)) .data[[report]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-167">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) .data[[state]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-168">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">normalise_service_district</span>(.data[[service]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-169">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_class =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(support)) .data[[support]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-170">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(share)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_rate</span>(.data[[share]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb3-171">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_band =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(band)) .data[[band]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb3-172">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-173">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb3-174">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">market_quarter_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dmy</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_replace_all</span>(market_report, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"([0-9]{2})([A-Z]{3})([0-9]{4})"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">1-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">2-</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">3"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb3-175">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-176">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, service_district <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>)</span>
<span id="cb3-177">}</span>
<span id="cb3-178"></span>
<span id="cb3-179">read_optional_table <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(path) {</span>
<span id="cb3-180">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(path) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">||</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(path)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>())</span>
<span id="cb3-181">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_public_table</span>(path), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> \(e) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>())</span>
<span id="cb3-182">}</span>
<span id="cb3-183"></span>
<span id="cb3-184">standardise_outcomes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(path, source_label) {</span>
<span id="cb3-185">  data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_optional_table</span>(path)</span>
<span id="cb3-186">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(data) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb3-187">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb3-188">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">source =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">respondent_group =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb3-189">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">domain =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">indicator =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcome_value =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sample_n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>()</span>
<span id="cb3-190">    ))</span>
<span id="cb3-191">  }</span>
<span id="cb3-192"></span>
<span id="cb3-193">  state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_territory"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_cd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"statecd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-194">  respondent <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"questionnaire"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"respondent"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cohort"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participant"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"family"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"carer"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-195">  domain <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"domain"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"area"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outcome_area"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-196">  indicator <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"indicator_description"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"indicator.*description"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"indicator"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measure"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"question"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outcome"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-197">  value <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"percent"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"percentage"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"proportion"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"value"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"result"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rate"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-198">  sample <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sample"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"denominator"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"respondents"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^n$"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-199"></span>
<span id="cb3-200">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(value)) {</span>
<span id="cb3-201">    numeric_candidates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(data)[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_lgl</span>(data, \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(x))))]</span>
<span id="cb3-202">    value <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> numeric_candidates[[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(numeric_candidates), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)]]</span>
<span id="cb3-203">  }</span>
<span id="cb3-204"></span>
<span id="cb3-205">  data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-206">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb3-207">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">source =</span> source_label,</span>
<span id="cb3-208">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) .data[[state]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-209">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">respondent_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(respondent)) .data[[respondent]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-210">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">domain =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(domain)) .data[[domain]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-211">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">indicator =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(indicator)) .data[[indicator]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-212">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcome_value =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(value)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_rate</span>(.data[[value]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb3-213">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sample_n =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(sample)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[sample]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span></span>
<span id="cb3-214">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-215">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb3-216">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">domain =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb3-217">        <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(domain) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> domain,</span>
<span id="cb3-218">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>(indicator), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"choice|control|decide|say|want"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Choice and control"</span>,</span>
<span id="cb3-219">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>(indicator), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"health|wellbeing|well-being"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Health and wellbeing"</span>,</span>
<span id="cb3-220">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>(indicator), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"work|job|employment|learning|school|education"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Work and learning"</span>,</span>
<span id="cb3-221">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>(indicator), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"community|social|relationship|friend|family"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Community and relationships"</span>,</span>
<span id="cb3-222">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>(indicator), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"daily|self-care|home|living|independent"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Daily living"</span>,</span>
<span id="cb3-223">        <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Other outcomes"</span></span>
<span id="cb3-224">      )</span>
<span id="cb3-225">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-226">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(outcome_value), outcome_value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, outcome_value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb3-227">}</span>
<span id="cb3-228"></span>
<span id="cb3-229">read_excel_all_sheets <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(path) {</span>
<span id="cb3-230">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>({</span>
<span id="cb3-231">    sheets <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">excel_sheets</span>(path)</span>
<span id="cb3-232">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_dfr</span>(sheets, \(sheet) {</span>
<span id="cb3-233">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> sheet) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-234">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-235">        <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">everything</span>(), as.character), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> sheet, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.before =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb3-236">    })</span>
<span id="cb3-237">  }, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> \(e) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>())</span>
<span id="cb3-238">}</span>
<span id="cb3-239"></span>
<span id="cb3-240">standardise_regional_outcomes_file <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(path, label) {</span>
<span id="cb3-241">  data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel_all_sheets</span>(path)</span>
<span id="cb3-242">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(data) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb3-243">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb3-244">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">source_file =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb3-245">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">respondent_group =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">domain =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">indicator =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb3-246">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcome_value =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sample_n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>()</span>
<span id="cb3-247">    ))</span>
<span id="cb3-248">  }</span>
<span id="cb3-249"></span>
<span id="cb3-250">  service <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvc_dstrct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"district"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-251">  state <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_territory"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_cd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-252">  respondent <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"questionnaire"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"respondent"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participant"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"family"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"carer"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-253">  domain <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"domain"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"area"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outcome_area"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-254">  indicator <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"indicator"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measure"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"question"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outcome"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-255">  sample <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sample"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"denominator"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"respondents"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^n$"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb3-256"></span>
<span id="cb3-257">  value_cols <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(data)[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_lgl</span>(data, \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(x))))] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-258">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">setdiff</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(sample))</span>
<span id="cb3-259"></span>
<span id="cb3-260">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">||</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(value_cols) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb3-261">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb3-262">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">source_file =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb3-263">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">respondent_group =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">domain =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">indicator =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb3-264">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcome_value =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sample_n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>()</span>
<span id="cb3-265">    ))</span>
<span id="cb3-266">  }</span>
<span id="cb3-267"></span>
<span id="cb3-268">  data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-269">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb3-270">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">source_file =</span> label,</span>
<span id="cb3-271">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state)) .data[[state]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_match</span>(label, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dashboard ([A-Z]{2,3}) by"</span>)[, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>],</span>
<span id="cb3-272">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">normalise_service_district</span>(.data[[service]]),</span>
<span id="cb3-273">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">respondent_group =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(respondent)) .data[[respondent]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> sheet,</span>
<span id="cb3-274">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">domain =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(domain)) .data[[domain]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> sheet,</span>
<span id="cb3-275">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">indicator =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(indicator)) .data[[indicator]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb3-276">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sample_n =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(sample)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[sample]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb3-277">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">all_of</span>(value_cols), as_rate)</span>
<span id="cb3-278">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-279">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_longer</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">all_of</span>(value_cols), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measure"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"outcome_value"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-280">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">indicator =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(indicator, measure)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-281">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>measure) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-282">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service_district), service_district <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(outcome_value), outcome_value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, outcome_value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb3-283">}</span>
<span id="cb3-284"></span>
<span id="cb3-285">budget <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_budget</span>(budget_raw)</span>
<span id="cb3-286">national_participants <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_national_participants</span>(budget_raw)</span>
<span id="cb3-287">utilisation <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_utilisation</span>(utilisation_raw)</span>
<span id="cb3-288">providers <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_provider</span>(provider_raw)</span>
<span id="cb3-289">payments <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_payments</span>(payments_raw)</span>
<span id="cb3-290">market_concentration <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_market</span>(market_path)</span>
<span id="cb3-291">baseline_outcomes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_outcomes</span>(baseline_outcomes_path, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Baseline outcomes"</span>)</span>
<span id="cb3-292">longitudinal_outcomes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">standardise_outcomes</span>(longitudinal_outcomes_path, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Longitudinal outcomes"</span>)</span>
<span id="cb3-293">national_outcomes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(baseline_outcomes, longitudinal_outcomes)</span>
<span id="cb3-294">regional_outcomes <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmap_dfr</span>(</span>
<span id="cb3-295">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(regional_outcome_links<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>path, regional_outcome_links<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>label),</span>
<span id="cb3-296">  standardise_regional_outcomes_file</span>
<span id="cb3-297">)</span>
<span id="cb3-298"></span>
<span id="cb3-299">latest_market <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> market_concentration <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-300">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(market_quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(market_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-301">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(state, service_district, support_class, payment_share_top10, payment_band)</span>
<span id="cb3-302"></span>
<span id="cb3-303">utilisation_for_model <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> utilisation <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-304">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(sil_or_sda) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> sil_or_sda <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>)</span>
<span id="cb3-305"></span>
<span id="cb3-306">model_base <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> budget <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-307">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(</span>
<span id="cb3-308">    utilisation_for_model,</span>
<span id="cb3-309">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_label"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_date"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_index"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>)</span>
<span id="cb3-310">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-311">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(</span>
<span id="cb3-312">    providers,</span>
<span id="cb3-313">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_label"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_date"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_index"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>)</span>
<span id="cb3-314">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-315">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(</span>
<span id="cb3-316">    latest_market,</span>
<span id="cb3-317">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>)</span>
<span id="cb3-318">  )</span>
<span id="cb3-319"></span>
<span id="cb3-320">payments_support_class <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> payments <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-321">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb3-322">    state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, service_district <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, disability_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, age_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>,</span>
<span id="cb3-323">    support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_category <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_item_number <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span></span>
<span id="cb3-324">  )</span>
<span id="cb3-325"></span>
<span id="cb3-326">payments_category <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> payments <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-327">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb3-328">    state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, service_district <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, disability_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, age_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>,</span>
<span id="cb3-329">    support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_category <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_item_number <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span></span>
<span id="cb3-330">  )</span>
<span id="cb3-331"></span>
<span id="cb3-332">payments_item <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> payments <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-333">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb3-334">    state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, service_district <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, disability_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, age_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>,</span>
<span id="cb3-335">    support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_category <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_item_number <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span></span>
<span id="cb3-336">  )</span>
<span id="cb3-337"></span>
<span id="cb3-338">payments_grouped <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> payments <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-339">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb3-340">    state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, service_district <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, disability_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, age_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>,</span>
<span id="cb3-341">    support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_category <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_item_number <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span></span>
<span id="cb3-342">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-343">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_label, quarter_date, quarter_index, state, service_district, disability_group, age_group, support_class) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-344">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb3-345">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb3-346">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_participants, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb3-347">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb3-348">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-349">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> payment_amount <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> payment_participants)</span>
<span id="cb3-350"></span>
<span id="cb3-351">model_base <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> model_base <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-352">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(</span>
<span id="cb3-353">    payments_grouped,</span>
<span id="cb3-354">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_label"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_date"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_index"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>)</span>
<span id="cb3-355">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb3-356">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb3-357">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">active_providers_per100 =</span> active_providers <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> participant_count <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb3-358">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(active_providers <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, participant_count <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> active_providers, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>)</span>
<span id="cb3-359">  )</span></code></pre></div></div>
</details>
</div>
<p>The current public pages may not expose every historic quarter forever. The workflow records what it found at render time:</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb4-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb4-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dataset =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Plan budgets"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Utilisation"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Active providers"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Payments"</span>),</span>
<span id="cb4-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarters_found =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb4-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(budget_links<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_label, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>),</span>
<span id="cb4-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(utilisation_links<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_label, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>),</span>
<span id="cb4-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(provider_links<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_label, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>),</span>
<span id="cb4-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(payments_links<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_label, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>)</span>
<span id="cb4-8">  )</span>
<span id="cb4-9">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb4-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 15%">
<col style="width: 84%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">dataset</th>
<th style="text-align: left;">quarters_found</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Plan budgets</td>
<td style="text-align: left;">June 2024, September 2024, December 2024, March 2025, June 2025, September 2025, December 2025</td>
</tr>
<tr class="even">
<td style="text-align: left;">Utilisation</td>
<td style="text-align: left;">June 2024, September 2024, December 2024, March 2025, June 2025, September 2025, December 2025</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Active providers</td>
<td style="text-align: left;">June 2024, September 2024, December 2024, March 2025, June 2025, September 2025, December 2025</td>
</tr>
<tr class="even">
<td style="text-align: left;">Payments</td>
<td style="text-align: left;">June 2024, September 2024, December 2024, March 2025, June 2025, September 2025, December 2025</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Appendix: ABS regional context build">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-1-contents" aria-controls="callout-1" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Appendix: ABS regional context build
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-1" class="callout-1-contents callout-collapse collapse">
<section id="abs-regional-context" class="level2 callout-body-container callout-body">
<h2 class="anchored" data-anchor-id="abs-regional-context">ABS Regional Context</h2>
<p>The NDIS plan budget data is organised around NDIA service districts. To bring in regional context, the workflow uses the NDIS service-district-to-LGA mapping and then adds ABS LGA indicators where available. For this first pass, the most useful lightweight context is socioeconomic position and age structure.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb5-1">read_optional_csv <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(path) {</span>
<span id="cb5-2">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(path) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">||</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(path)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>())</span>
<span id="cb5-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_csv</span>(path, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">show_col_types =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>()</span>
<span id="cb5-4">}</span>
<span id="cb5-5"></span>
<span id="cb5-6">service_lga <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_optional_csv</span>(service_lga_path)</span>
<span id="cb5-7">participants_lga <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_optional_csv</span>(lga_path)</span>
<span id="cb5-8"></span>
<span id="cb5-9">service_context <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb5-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb5-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb5-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb5-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_name =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb5-14">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>()</span>
<span id="cb5-15">)</span>
<span id="cb5-16"></span>
<span id="cb5-17"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(service_lga) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb5-18">  state_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(service_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_territory"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_cd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"statecd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rsds.*state"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-19">  service_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(service_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvc_dstrct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvcdstrct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rsds.*srvc.*dstrct"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-20">  lga_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(service_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lga.*code"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lga_code"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lgacd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-21">  lga_name_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(service_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lga.*name"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lganm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local.*government.*area"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"area.*name"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-22">  remote_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(service_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remote"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-23"></span>
<span id="cb5-24">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service_col) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(lga_col)) {</span>
<span id="cb5-25">    service_context <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> service_lga <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-26">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb5-27">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state_col)) .data[[state_col]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb5-28">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">normalise_service_district</span>(.data[[service_col]]),</span>
<span id="cb5-29">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_pad</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[lga_col]])), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">width =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">side =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"left"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pad =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>),</span>
<span id="cb5-30">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_name =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(lga_name_col)) .data[[lga_name_col]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb5-31">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(remote_col)) .data[[remote_col]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb5-32">      ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-33">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service_district), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(lga_code)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-34">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>()</span>
<span id="cb5-35">  }</span>
<span id="cb5-36">}</span>
<span id="cb5-37"></span>
<span id="cb5-38">service_lga_participants <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb5-39">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb5-40">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb5-41">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_lgas =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-42">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_lga_names =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb5-43">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-44">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">latest_lga_report =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>()),</span>
<span id="cb5-45">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb5-46">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_avg_support_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>()</span>
<span id="cb5-47">)</span>
<span id="cb5-48"></span>
<span id="cb5-49"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(participants_lga) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb5-50">  report_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(participants_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"report"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rprt"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-51">  service_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(participants_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvc_dstrct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"srvcdstrct"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rsds.*srvc.*dstrct"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-52">  lga_name_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(participants_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lga.*name"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lganm"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"local.*government.*area"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"area.*name"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-53">  state_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(participants_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"^state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_territory"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state_cd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"statecd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-54">  remote_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(participants_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remote"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-55">  participants_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(participants_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"active.*participant"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"actv_prtcpnt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"actvprtcpnt"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participant.*count"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participants"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"prtcpnt"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-56">  budget_col <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first_col</span>(participants_lga, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"average.*support"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"average.*budget"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"avg.*annual"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"avg_anlsd"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"committed"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"cmtd"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">required =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>)</span>
<span id="cb5-57"></span>
<span id="cb5-58">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service_col)) {</span>
<span id="cb5-59">    service_lga_participants <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> participants_lga <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-60">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb5-61">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">latest_lga_report =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(report_col)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dmy</span>(.data[[report_col]], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quiet =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>),</span>
<span id="cb5-62">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">state =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state_col)) .data[[state_col]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb5-63">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_district =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">normalise_service_district</span>(.data[[service_col]]),</span>
<span id="cb5-64">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_name =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(lga_name_col)) .data[[lga_name_col]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb5-65">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(remote_col)) .data[[remote_col]] <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb5-66">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_participants =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(participants_col)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[participants_col]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb5-67">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_avg_support_budget =</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(budget_col)) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[budget_col]]) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span></span>
<span id="cb5-68">      ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-69">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service_district), service_district <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, service_district <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Other"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-70">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(state, service_district) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-71">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(latest_lga_report) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> latest_lga_report <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(latest_lga_report, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-72">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb5-73">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_lgas =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(lga_name),</span>
<span id="cb5-74">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_lga_names =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">collapse_top_values</span>(lga_name),</span>
<span id="cb5-75">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(lga_participants, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-76">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">latest_lga_report =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(latest_lga_report, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-77">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mode_character</span>(remoteness),</span>
<span id="cb5-78">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_avg_support_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(lga_avg_support_budget, lga_participants),</span>
<span id="cb5-79">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb5-80">      ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-81">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb5-82">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">latest_lga_report =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.infinite</span>(latest_lga_report), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA</span>), latest_lga_report),</span>
<span id="cb5-83">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.infinite</span>(lga_participants), <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, lga_participants),</span>
<span id="cb5-84">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_avg_support_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.nan</span>(lga_avg_support_budget), <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, lga_avg_support_budget)</span>
<span id="cb5-85">      )</span>
<span id="cb5-86">  }</span>
<span id="cb5-87">}</span>
<span id="cb5-88"></span>
<span id="cb5-89">abs_note <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ABS context was not joined in this render."</span></span>
<span id="cb5-90"></span>
<span id="cb5-91">seifa_file <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>(</span>
<span id="cb5-92">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_named</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>seifa, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Local Government Area.*Indexes.*SEIFA|LGA.*Indexes.*SEIFA"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abs_seifa_lga.xlsx"</span>),</span>
<span id="cb5-93">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> \(e) <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb5-94">)</span>
<span id="cb5-95"></span>
<span id="cb5-96">population_file <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>(</span>
<span id="cb5-97">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_named</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>population_age, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Median age, sex ratio and broad age groups, by LGA.*2021.*Final"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abs_lga_age_structure.xlsx"</span>),</span>
<span id="cb5-98">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> \(e) <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb5-99">)</span>
<span id="cb5-100"></span>
<span id="cb5-101">abs_lga <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb5-102">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb5-103">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_score =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-104">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-105">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ier_score =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-106">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ier_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-107">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ieo_score =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-108">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ieo_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-109">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_age =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-110">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_0_14 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-111">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_15_64 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-112">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-113">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_population =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>()</span>
<span id="cb5-114">)</span>
<span id="cb5-115"></span>
<span id="cb5-116">lga_remoteness <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb5-117">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb5-118">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>(),</span>
<span id="cb5-119">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_rank =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-120">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_major_cities_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-121">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_inner_regional_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-122">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_outer_regional_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-123">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_remote_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb5-124">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_very_remote_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>()</span>
<span id="cb5-125">)</span>
<span id="cb5-126"></span>
<span id="cb5-127">seifa_file <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>(</span>
<span id="cb5-128">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_one</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>seifa_lga, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abs_seifa_lga.xlsx"</span>),</span>
<span id="cb5-129">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> \(e) seifa_file</span>
<span id="cb5-130">)</span>
<span id="cb5-131"></span>
<span id="cb5-132"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(seifa_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(seifa_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is_xlsx_file</span>(seifa_file)) {</span>
<span id="cb5-133">  seifa <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(seifa_file, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">skip =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col_names =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-134">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>()</span>
<span id="cb5-135"></span>
<span id="cb5-136">  abs_lga <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> seifa <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-137">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb5-138">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_pad</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"1"</span>]])), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">width =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">side =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"left"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pad =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>),</span>
<span id="cb5-139">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_score =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>]]),</span>
<span id="cb5-140">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"4"</span>]]),</span>
<span id="cb5-141">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ier_score =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"5"</span>]]),</span>
<span id="cb5-142">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ier_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"6"</span>]]),</span>
<span id="cb5-143">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ieo_score =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7"</span>]]),</span>
<span id="cb5-144">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ieo_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"8"</span>]])</span>
<span id="cb5-145">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-146">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(lga_code), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(irsd_score)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-147">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>(lga_code, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.keep_all =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb5-148">  abs_note <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ABS SEIFA LGA context joined."</span></span>
<span id="cb5-149">}</span>
<span id="cb5-150"></span>
<span id="cb5-151">population_file <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>(</span>
<span id="cb5-152">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_one</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>population_age_lga, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abs_lga_age_structure.xlsx"</span>),</span>
<span id="cb5-153">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> \(e) population_file</span>
<span id="cb5-154">)</span>
<span id="cb5-155"></span>
<span id="cb5-156"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(population_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(population_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is_xlsx_file</span>(population_file)) {</span>
<span id="cb5-157">  pop_lga <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(population_file, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Table 1"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">skip =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col_names =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-158">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-159">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb5-160">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_pad</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"3"</span>]])), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">width =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">side =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"left"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pad =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>),</span>
<span id="cb5-161">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_population =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"7"</span>]]),</span>
<span id="cb5-162">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_age =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11"</span>]]),</span>
<span id="cb5-163">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_0_14 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"13"</span>]]),</span>
<span id="cb5-164">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_15_64 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"14"</span>]]),</span>
<span id="cb5-165">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(.data[[<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"15"</span>]])</span>
<span id="cb5-166">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-167">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(lga_code), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(lga_population)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-168">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>(lga_code, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.keep_all =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb5-169"></span>
<span id="cb5-170">  abs_lga <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">full_join</span>(abs_lga, pop_lga, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lga_code"</span>)</span>
<span id="cb5-171">  abs_note <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(abs_note, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ABS age-structure context also joined."</span>)</span>
<span id="cb5-172">}</span>
<span id="cb5-173"></span>
<span id="cb5-174">mb_file <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>(</span>
<span id="cb5-175">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_one</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>asgs_mb_2021, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abs_mb_2021_allocation.xlsx"</span>),</span>
<span id="cb5-176">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> \(e) <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb5-177">)</span>
<span id="cb5-178"></span>
<span id="cb5-179">lga_allocation_file <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>(</span>
<span id="cb5-180">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_one</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>asgs_lga_2021, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abs_lga_2021_aust.xlsx"</span>),</span>
<span id="cb5-181">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> \(e) <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb5-182">)</span>
<span id="cb5-183"></span>
<span id="cb5-184">ra_file <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tryCatch</span>(</span>
<span id="cb5-185">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">download_one</span>(page_urls<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>asgs_ra_2021, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"abs_ra_2021_aust.xlsx"</span>),</span>
<span id="cb5-186">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">error =</span> \(e) <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb5-187">)</span>
<span id="cb5-188"></span>
<span id="cb5-189"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (</span>
<span id="cb5-190">  <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(mb_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(mb_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is_xlsx_file</span>(mb_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span></span>
<span id="cb5-191">  <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(lga_allocation_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(lga_allocation_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is_xlsx_file</span>(lga_allocation_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span></span>
<span id="cb5-192">  <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(ra_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">file.exists</span>(ra_file) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;&amp;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is_xlsx_file</span>(ra_file)</span>
<span id="cb5-193">) {</span>
<span id="cb5-194">  mb_sa1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(mb_file, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-195">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-196">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb5-197">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mb_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(mb_code_2021),</span>
<span id="cb5-198">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sa1_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(sa1_code_2021)</span>
<span id="cb5-199">    )</span>
<span id="cb5-200"></span>
<span id="cb5-201">  lga_mb <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(lga_allocation_file, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-202">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-203">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb5-204">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mb_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(mb_code_2021),</span>
<span id="cb5-205">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_pad</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(lga_code_2021)), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">width =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">side =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"left"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pad =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"0"</span>),</span>
<span id="cb5-206">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_area_sqkm =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(area_albers_sqkm)</span>
<span id="cb5-207">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-208">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(lga_code), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(lga_area_sqkm), lga_area_sqkm <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb5-209"></span>
<span id="cb5-210">  sa1_ra <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">read_excel</span>(ra_file, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sheet =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-211">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">clean_df</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-212">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb5-213">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sa1_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(sa1_code_2021),</span>
<span id="cb5-214">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_code =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as_number</span>(ra_code_2021),</span>
<span id="cb5-215">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_remove</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.character</span>(ra_name_2021), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" of Australia$"</span>)</span>
<span id="cb5-216">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-217">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(sa1_code), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(remoteness))</span>
<span id="cb5-218"></span>
<span id="cb5-219">  lga_ra_long <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> lga_mb <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-220">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(mb_sa1, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mb_code"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-221">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(sa1_ra, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"sa1_code"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-222">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(remoteness)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-223">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(lga_code, remoteness, remoteness_code) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-224">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">area_sqkm =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(lga_area_sqkm, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-225">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(lga_code) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-226">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">area_share =</span> area_sqkm <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(area_sqkm, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-227">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>()</span>
<span id="cb5-228"></span>
<span id="cb5-229">  lga_remoteness <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> lga_ra_long <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-230">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(lga_code) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-231">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb5-232">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> remoteness[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">which.max</span>(area_share)],</span>
<span id="cb5-233">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_rank =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">weighted.mean</span>(remoteness_code, area_share, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-234">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_major_cities_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(area_share[remoteness <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Major Cities"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-235">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_inner_regional_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(area_share[remoteness <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Inner Regional"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-236">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_outer_regional_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(area_share[remoteness <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Outer Regional"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-237">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_remote_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(area_share[remoteness <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Remote"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-238">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_very_remote_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(area_share[remoteness <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Very Remote"</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-239">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb5-240">    )</span>
<span id="cb5-241"></span>
<span id="cb5-242">  abs_note <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(abs_note, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ABS remoteness context also joined."</span>)</span>
<span id="cb5-243">}</span>
<span id="cb5-244"></span>
<span id="cb5-245">service_abs <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> service_context <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-246">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(lga_remoteness, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lga_code"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">suffix =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_abs"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-247">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(remoteness, remoteness_abs)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-248">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(abs_lga, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lga_code"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-249">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(state, service_district) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-250">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb5-251">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_score =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(irsd_score, lga_population),</span>
<span id="cb5-252">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(irsd_decile, lga_population),</span>
<span id="cb5-253">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ier_score =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(ier_score, lga_population),</span>
<span id="cb5-254">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ier_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(ier_decile, lga_population),</span>
<span id="cb5-255">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ieo_score =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(ieo_score, lga_population),</span>
<span id="cb5-256">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ieo_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(ieo_decile, lga_population),</span>
<span id="cb5-257">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_age =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(median_age, lga_population),</span>
<span id="cb5-258">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_0_14 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(pct_0_14, lga_population),</span>
<span id="cb5-259">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_15_64 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(pct_15_64, lga_population),</span>
<span id="cb5-260">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(pct_65_plus, lga_population),</span>
<span id="cb5-261">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_population =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(lga_population, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-262">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_rank =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(remoteness_rank, lga_population),</span>
<span id="cb5-263">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_major_cities_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(remoteness_major_cities_share, lga_population),</span>
<span id="cb5-264">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_inner_regional_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(remoteness_inner_regional_share, lga_population),</span>
<span id="cb5-265">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_outer_regional_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(remoteness_outer_regional_share, lga_population),</span>
<span id="cb5-266">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_remote_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(remoteness_remote_share, lga_population),</span>
<span id="cb5-267">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_very_remote_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(remoteness_very_remote_share, lga_population),</span>
<span id="cb5-268">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mapped_lgas =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(lga_code),</span>
<span id="cb5-269">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mapped_lga_names =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">collapse_top_values</span>(lga_name),</span>
<span id="cb5-270">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mode_character</span>(remoteness),</span>
<span id="cb5-271">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb5-272">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-273">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(service_lga_participants, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">suffix =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_participant_file"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-274">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb5-275">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_remoteness_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmax</span>(</span>
<span id="cb5-276">      remoteness_major_cities_share,</span>
<span id="cb5-277">      remoteness_inner_regional_share,</span>
<span id="cb5-278">      remoteness_outer_regional_share,</span>
<span id="cb5-279">      remoteness_remote_share,</span>
<span id="cb5-280">      remoteness_very_remote_share,</span>
<span id="cb5-281">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb5-282">    ),</span>
<span id="cb5-283">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dominant_remoteness =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb5-284">      <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(max_remoteness_share) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb5-285">      remoteness_major_cities_share <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> max_remoteness_share <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Major Cities"</span>,</span>
<span id="cb5-286">      remoteness_inner_regional_share <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> max_remoteness_share <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Inner Regional"</span>,</span>
<span id="cb5-287">      remoteness_outer_regional_share <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> max_remoteness_share <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Outer Regional"</span>,</span>
<span id="cb5-288">      remoteness_remote_share <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> max_remoteness_share <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Remote"</span>,</span>
<span id="cb5-289">      remoteness_very_remote_share <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> max_remoteness_share <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Very Remote"</span>,</span>
<span id="cb5-290">      <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb5-291">    ),</span>
<span id="cb5-292">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(dominant_remoteness, remoteness, remoteness_participant_file),</span>
<span id="cb5-293">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mapped_lgas =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(participant_lgas), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmax</span>(mapped_lgas, participant_lgas, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), mapped_lgas),</span>
<span id="cb5-294">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mapped_lga_names =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(mapped_lga_names, participant_lga_names),</span>
<span id="cb5-295">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_population =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(lga_population <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, lga_population),</span>
<span id="cb5-296">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(lga_participants <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, lga_participants),</span>
<span id="cb5-297">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(irsd_score, irsd_decile, ier_score, ier_decile, ieo_score, ieo_decile, median_age, pct_0_14, pct_15_64, pct_65_plus, lga_avg_support_budget, remoteness_rank, remoteness_major_cities_share, remoteness_inner_regional_share, remoteness_outer_regional_share, remoteness_remote_share, remoteness_very_remote_share), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.nan</span>(x), <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, x))</span>
<span id="cb5-298">  )</span>
<span id="cb5-299"></span>
<span id="cb5-300">model_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> model_base <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-301">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(service_abs, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>))</span>
<span id="cb5-302"></span>
<span id="cb5-303">model_service_keys <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-304">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(service_district)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-305">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>(state, service_district)</span>
<span id="cb5-306"></span>
<span id="cb5-307">service_context_covered <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> service_context <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-308">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">distinct</span>(state, service_district) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-309">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">semi_join</span>(model_service_keys, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>))</span>
<span id="cb5-310"></span>
<span id="cb5-311">service_abs_covered <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> service_abs <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-312">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">semi_join</span>(model_service_keys, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>))</span>
<span id="cb5-313"></span>
<span id="cb5-314">join_diagnostics <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb5-315">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">check =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb5-316">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Budget rows with utilisation"</span>,</span>
<span id="cb5-317">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Budget rows with active providers"</span>,</span>
<span id="cb5-318">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Budget rows with grouped payments"</span>,</span>
<span id="cb5-319">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Budget rows with market concentration"</span>,</span>
<span id="cb5-320">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Service districts with LGA mapping"</span>,</span>
<span id="cb5-321">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Service districts with ABS SEIFA/age context"</span>,</span>
<span id="cb5-322">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Service districts with remoteness context"</span>,</span>
<span id="cb5-323">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Service districts with LGA participant context"</span></span>
<span id="cb5-324">  ),</span>
<span id="cb5-325">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rows_or_groups =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb5-326">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(model_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>utilisation_rate)),</span>
<span id="cb5-327">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(model_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>active_providers)),</span>
<span id="cb5-328">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(model_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>payment_amount)),</span>
<span id="cb5-329">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(model_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>payment_share_top10)),</span>
<span id="cb5-330">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(service_context_covered),</span>
<span id="cb5-331">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(service_abs_covered <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(irsd_score) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(median_age))),</span>
<span id="cb5-332">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(service_abs_covered <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(remoteness))),</span>
<span id="cb5-333">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(service_abs_covered <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(lga_participants)))</span>
<span id="cb5-334">  ),</span>
<span id="cb5-335">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">denominator =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb5-336">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(model_data),</span>
<span id="cb5-337">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(model_data),</span>
<span id="cb5-338">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(model_data),</span>
<span id="cb5-339">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(model_data),</span>
<span id="cb5-340">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(model_service_keys),</span>
<span id="cb5-341">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(model_service_keys),</span>
<span id="cb5-342">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(model_service_keys),</span>
<span id="cb5-343">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(model_service_keys)</span>
<span id="cb5-344">  )</span>
<span id="cb5-345">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-346">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">coverage =</span> rows_or_groups <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> denominator)</span>
<span id="cb5-347"></span>
<span id="cb5-348">outcome_spend_snapshot <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-349">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2024-06-30"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-350">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(state, service_district) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-351">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb5-352">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-353">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(avg_support_budget, participant_count),</span>
<span id="cb5-354">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(utilisation_rate, participant_count),</span>
<span id="cb5-355">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(payment_per_participant, participant_count),</span>
<span id="cb5-356">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(participants_per_provider, participant_count),</span>
<span id="cb5-357">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(payment_share_top10),</span>
<span id="cb5-358">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(irsd_decile),</span>
<span id="cb5-359">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ier_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(ier_decile),</span>
<span id="cb5-360">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ieo_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(ieo_decile),</span>
<span id="cb5-361">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness_rank =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(remoteness_rank),</span>
<span id="cb5-362">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_age =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(median_age),</span>
<span id="cb5-363">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_0_14 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(pct_0_14),</span>
<span id="cb5-364">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(pct_65_plus),</span>
<span id="cb5-365">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lga_population =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(lga_population),</span>
<span id="cb5-366">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb5-367">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-368">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(avg_budget, utilisation, payment_per_participant, participants_per_provider, payment_share_top10, irsd_decile, ier_decile, ieo_decile, remoteness_rank, median_age, pct_0_14, pct_65_plus, lga_population), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.nan</span>(x), <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, x)))</span>
<span id="cb5-369"></span>
<span id="cb5-370">state_outcome_spend_snapshot <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-371">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-372">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(state) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-373">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb5-374">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-375">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(avg_support_budget, participant_count),</span>
<span id="cb5-376">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(utilisation_rate, participant_count),</span>
<span id="cb5-377">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(payment_per_participant, participant_count),</span>
<span id="cb5-378">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(participants_per_provider, participant_count),</span>
<span id="cb5-379">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(payment_share_top10),</span>
<span id="cb5-380">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb5-381">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-382">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state), state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>)</span>
<span id="cb5-383"></span>
<span id="cb5-384">regional_outcomes_spend <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> regional_outcomes <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-385">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(outcome_spend_snapshot, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-386">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(payment_per_participant), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(outcome_value))</span>
<span id="cb5-387"></span>
<span id="cb5-388">state_outcomes_spend <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> national_outcomes <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-389">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state), state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-390">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(state_outcome_spend_snapshot, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-391">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(payment_per_participant), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(outcome_value))</span>
<span id="cb5-392"></span>
<span id="cb5-393">state_outcome_domain <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> state_outcomes_spend <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-394">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(source, state, domain) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-395">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb5-396">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">indicators =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(indicator),</span>
<span id="cb5-397">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcome_value =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(outcome_value),</span>
<span id="cb5-398">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(participants, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb5-399">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(avg_budget),</span>
<span id="cb5-400">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(utilisation),</span>
<span id="cb5-401">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(payment_per_participant),</span>
<span id="cb5-402">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(participants_per_provider),</span>
<span id="cb5-403">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(payment_share_top10),</span>
<span id="cb5-404">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb5-405">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb5-406">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb5-407">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.infinite</span>(participants), <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, participants),</span>
<span id="cb5-408">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">outcome_per_1000_dollars =</span> outcome_value <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (payment_per_participant <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>)</span>
<span id="cb5-409">  )</span>
<span id="cb5-410"></span>
<span id="cb5-411">outcome_spend_join <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb5-412">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">check =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb5-413">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Service districts with dashboard outcomes"</span>,</span>
<span id="cb5-414">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Dashboard outcome rows joined to June 2024 district spend"</span>,</span>
<span id="cb5-415">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"State outcome rows joined to latest state spend"</span></span>
<span id="cb5-416">  ),</span>
<span id="cb5-417">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rows_or_groups =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb5-418">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(regional_outcomes<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>service_district),</span>
<span id="cb5-419">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(regional_outcomes_spend),</span>
<span id="cb5-420">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(state_outcomes_spend)</span>
<span id="cb5-421">  ),</span>
<span id="cb5-422">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">denominator =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb5-423">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(outcome_spend_snapshot<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>service_district),</span>
<span id="cb5-424">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(regional_outcomes),</span>
<span id="cb5-425">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(national_outcomes <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(state), state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>))</span>
<span id="cb5-426">  ),</span>
<span id="cb5-427">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">coverage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(denominator <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, rows_or_groups <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> denominator, <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>)</span>
<span id="cb5-428">)</span>
<span id="cb5-429"></span>
<span id="cb5-430">abs_note</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-stdout">
<pre><code>[1] "ABS SEIFA LGA context joined. ABS age-structure context also joined. ABS remoteness context also joined."</code></pre>
</div>
</div>
</section>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Appendix: source rows and join diagnostics">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-2-contents" aria-controls="callout-2" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Appendix: source rows and join diagnostics
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-2" class="callout-2-contents callout-collapse collapse">
<section id="source-rows-and-join-diagnostics" class="level2 callout-body-container callout-body">
<h2 class="anchored" data-anchor-id="source-rows-and-join-diagnostics">Source Rows and Join Diagnostics</h2>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb7-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">table =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Budget rows"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Utilisation rows"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Provider rows"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Payments rows"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Market concentration rows"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Model rows"</span>),</span>
<span id="cb7-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rows =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(budget), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(utilisation), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(providers), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(payments), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(market_concentration), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(model_data))</span>
<span id="cb7-4">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb7-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">table</th>
<th style="text-align: right;">rows</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Budget rows</td>
<td style="text-align: right;">105041</td>
</tr>
<tr class="even">
<td style="text-align: left;">Utilisation rows</td>
<td style="text-align: right;">223624</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Provider rows</td>
<td style="text-align: right;">18349</td>
</tr>
<tr class="even">
<td style="text-align: left;">Payments rows</td>
<td style="text-align: right;">816299</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Market concentration rows</td>
<td style="text-align: right;">7228</td>
</tr>
<tr class="even">
<td style="text-align: left;">Model rows</td>
<td style="text-align: right;">105041</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb8-1">join_diagnostics <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb8-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">coverage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(coverage, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb8-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 56%">
<col style="width: 18%">
<col style="width: 14%">
<col style="width: 10%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">check</th>
<th style="text-align: right;">rows_or_groups</th>
<th style="text-align: right;">denominator</th>
<th style="text-align: left;">coverage</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Budget rows with utilisation</td>
<td style="text-align: right;">62709</td>
<td style="text-align: right;">105041</td>
<td style="text-align: left;">59.7%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Budget rows with active providers</td>
<td style="text-align: right;">61506</td>
<td style="text-align: right;">105041</td>
<td style="text-align: left;">58.6%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Budget rows with grouped payments</td>
<td style="text-align: right;">63823</td>
<td style="text-align: right;">105041</td>
<td style="text-align: left;">60.8%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Budget rows with market concentration</td>
<td style="text-align: right;">1112</td>
<td style="text-align: right;">105041</td>
<td style="text-align: left;">1.1%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Service districts with LGA mapping</td>
<td style="text-align: right;">80</td>
<td style="text-align: right;">84</td>
<td style="text-align: left;">95.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Service districts with ABS SEIFA/age context</td>
<td style="text-align: right;">80</td>
<td style="text-align: right;">84</td>
<td style="text-align: left;">95.2%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Service districts with remoteness context</td>
<td style="text-align: right;">80</td>
<td style="text-align: right;">84</td>
<td style="text-align: left;">95.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Service districts with LGA participant context</td>
<td style="text-align: right;">80</td>
<td style="text-align: right;">84</td>
<td style="text-align: left;">95.2%</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>
</div>
</section>
<section id="overall-spend-growth" class="level2">
<h2 class="anchored" data-anchor-id="overall-spend-growth">Overall Spend Growth</h2>
<p>Across the visible payments extracts, observed NDIS payments increased by 18.7%, equivalent to about 2.9% per quarter. This is a short window, so I treat it as the recent pace in the public files rather than a long-run trend.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb9-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(overall_payment_trend) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) {</span>
<span id="cb9-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(overall_payment_trend, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, total_payments)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0b6b57"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0b6b57"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> dollar) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb9-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Total quarterly payments"</span>)</span>
<span id="cb9-7">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb9-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Not enough payment quarters to draw the total spend chart."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb9-9">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/overall-payment-trend-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Total NDIS payments in the visible quarterly extracts.</figcaption>
</figure>
</div>
</div>
</div>
</section>
<section id="how-fast-is-participation-growing" class="level2">
<h2 class="anchored" data-anchor-id="how-fast-is-participation-growing">How Fast Is Participation Growing?</h2>
<p>Before modelling budgets or utilisation, the first question is scale: is NDIS participation growing faster than the Australian population? The table below compares national NDIS participant counts from the public participant budget extract with ABS estimated resident population. The ABS quarterly population release currently overlaps the NDIS analysis window through September 2025, so the December 2025 NDIS quarter is not used in this comparison.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb10-1">abs_population <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> tibble<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tribble</span>(</span>
<span id="cb10-2">  <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>quarter_label, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>quarter_date, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span>australian_population,</span>
<span id="cb10-3">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"March 2024"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2024-03-31"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27113517</span>,</span>
<span id="cb10-4">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"June 2024"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2024-06-30"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27194286</span>,</span>
<span id="cb10-5">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"September 2024"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2024-09-30"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27301149</span>,</span>
<span id="cb10-6">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"December 2024"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2024-12-31"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27388133</span>,</span>
<span id="cb10-7">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"March 2025"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2025-03-31"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27531443</span>,</span>
<span id="cb10-8">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"June 2025"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2025-06-30"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27613654</span>,</span>
<span id="cb10-9">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"September 2025"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2025-09-30"</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">27724744</span></span>
<span id="cb10-10">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb10-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter_date =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.Date</span>(quarter_date),</span>
<span id="cb10-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">population_source =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ABS National, state and territory population, September 2025 release"</span></span>
<span id="cb10-14">  )</span>
<span id="cb10-15"></span>
<span id="cb10-16">population_participation <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> national_participants <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">inner_join</span>(abs_population, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_label"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_date"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb10-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ndis_share_population =</span> ndis_participants <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> australian_population,</span>
<span id="cb10-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ndis_participant_growth =</span> ndis_participants <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(ndis_participants) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb10-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">population_growth =</span> australian_population <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(australian_population) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb10-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">share_change_percentage_points =</span> (ndis_share_population <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(ndis_share_population)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb10-24">  )</span>
<span id="cb10-25"></span>
<span id="cb10-26">participation_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(population_participation) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb10-27">  population_participation <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb10-29">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">start_quarter =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(quarter_label),</span>
<span id="cb10-30">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">end_quarter =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">last</span>(quarter_label),</span>
<span id="cb10-31">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">population_growth =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">last</span>(population_growth),</span>
<span id="cb10-32">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ndis_participant_growth =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">last</span>(ndis_participant_growth),</span>
<span id="cb10-33">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">start_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(ndis_share_population),</span>
<span id="cb10-34">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">end_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">last</span>(ndis_share_population)</span>
<span id="cb10-35">    )</span>
<span id="cb10-36">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb10-37">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb10-38">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">start_quarter =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb10-39">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">end_quarter =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span>,</span>
<span id="cb10-40">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">population_growth =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb10-41">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ndis_participant_growth =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb10-42">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">start_share =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>,</span>
<span id="cb10-43">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">end_share =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span></span>
<span id="cb10-44">  )</span>
<span id="cb10-45">}</span>
<span id="cb10-46"></span>
<span id="cb10-47"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(population_participation) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb10-48">  population_participation <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-49">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb10-50">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarter =</span> quarter_label,</span>
<span id="cb10-51">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">australian_population =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(australian_population),</span>
<span id="cb10-52">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ndis_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(ndis_participants),</span>
<span id="cb10-53">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">population_growth =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(population_growth, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb10-54">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ndis_participant_growth =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(ndis_participant_growth, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb10-55">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ndis_share_population =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(ndis_share_population, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>),</span>
<span id="cb10-56">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">share_change_percentage_points =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(share_change_percentage_points, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.01</span>)</span>
<span id="cb10-57">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-58">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb10-59">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb10-60">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"National NDIS participant counts could not be aligned to the ABS population denominator in this render."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb10-61">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb10-62">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 10%">
<col style="width: 14%">
<col style="width: 12%">
<col style="width: 12%">
<col style="width: 16%">
<col style="width: 14%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">quarter</th>
<th style="text-align: left;">australian_population</th>
<th style="text-align: left;">ndis_participants</th>
<th style="text-align: left;">population_growth</th>
<th style="text-align: left;">ndis_participant_growth</th>
<th style="text-align: left;">ndis_share_population</th>
<th style="text-align: left;">share_change_percentage_points</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">June 2024</td>
<td style="text-align: left;">27,194,286</td>
<td style="text-align: left;">661,267</td>
<td style="text-align: left;">0.0%</td>
<td style="text-align: left;">0.0%</td>
<td style="text-align: left;">2.43%</td>
<td style="text-align: left;">0.00</td>
</tr>
<tr class="even">
<td style="text-align: left;">September 2024</td>
<td style="text-align: left;">27,301,149</td>
<td style="text-align: left;">680,123</td>
<td style="text-align: left;">0.4%</td>
<td style="text-align: left;">2.9%</td>
<td style="text-align: left;">2.49%</td>
<td style="text-align: left;">0.06</td>
</tr>
<tr class="odd">
<td style="text-align: left;">December 2024</td>
<td style="text-align: left;">27,388,133</td>
<td style="text-align: left;">692,822</td>
<td style="text-align: left;">0.7%</td>
<td style="text-align: left;">4.8%</td>
<td style="text-align: left;">2.53%</td>
<td style="text-align: left;">0.10</td>
</tr>
<tr class="even">
<td style="text-align: left;">March 2025</td>
<td style="text-align: left;">27,531,443</td>
<td style="text-align: left;">716,998</td>
<td style="text-align: left;">1.2%</td>
<td style="text-align: left;">8.4%</td>
<td style="text-align: left;">2.60%</td>
<td style="text-align: left;">0.17</td>
</tr>
<tr class="odd">
<td style="text-align: left;">June 2025</td>
<td style="text-align: left;">27,613,654</td>
<td style="text-align: left;">739,414</td>
<td style="text-align: left;">1.5%</td>
<td style="text-align: left;">11.8%</td>
<td style="text-align: left;">2.68%</td>
<td style="text-align: left;">0.25</td>
</tr>
<tr class="even">
<td style="text-align: left;">September 2025</td>
<td style="text-align: left;">27,724,744</td>
<td style="text-align: left;">751,446</td>
<td style="text-align: left;">2.0%</td>
<td style="text-align: left;">13.6%</td>
<td style="text-align: left;">2.71%</td>
<td style="text-align: left;">0.28</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Over the overlapping ABS and NDIS window, the Australian population grew 2.0% while NDIS participant counts grew 13.6%. That lifted observed NDIS participation from 2.43% of the population in June 2024 to 2.71% by September 2025.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb11-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(population_participation) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) {</span>
<span id="cb11-2">  population_participation <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(quarter_date, population_growth, ndis_participant_growth) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_longer</span>(</span>
<span id="cb11-5">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(population_growth, ndis_participant_growth),</span>
<span id="cb11-6">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span>,</span>
<span id="cb11-7">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"growth"</span></span>
<span id="cb11-8">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb11-10">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">series =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">recode</span>(</span>
<span id="cb11-11">        series,</span>
<span id="cb11-12">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">population_growth =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Australian population"</span>,</span>
<span id="cb11-13">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ndis_participant_growth =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NDIS participants"</span></span>
<span id="cb11-14">      )</span>
<span id="cb11-15">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, growth, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> series)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey80"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb11-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Growth since March 2024"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>)</span>
<span id="cb11-22">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb11-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Not enough overlapping population and NDIS quarters to draw the indexed growth chart."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb11-24">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb11-25">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/population-participation-trend-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>NDIS participant growth compared with Australian population growth, indexed to March 2024.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb12-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(population_participation) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) {</span>
<span id="cb12-2">  population_participation <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, ndis_share_population)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.9</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb12-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NDIS participants as share of population"</span>)</span>
<span id="cb12-8">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb12-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Not enough overlapping population and NDIS quarters to draw the participation-share chart."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb12-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb12-11">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/ndis-share-population-trend-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Share of the Australian population participating in the NDIS.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb13-1">budget_trend_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> budget <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb13-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb13-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(avg_support_budget, participant_count),</span>
<span id="cb13-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb13-7">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb13-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(avg_budget))</span>
<span id="cb13-9"></span>
<span id="cb13-10"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">has_enough_data</span>(budget_trend_data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"avg_budget"</span>))) {</span>
<span id="cb13-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(budget_trend_data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, avg_budget)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb13-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb13-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb13-14">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> dollar) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb13-15">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average annualised budget"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average support budgets over time"</span>)</span>
<span id="cb13-16">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb13-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Not enough non-missing average budget data to draw the trend chart."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb13-18">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/budget-trend-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Average support budget and participant counts across the visible quarterly extracts.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb14-1">utilisation_trend_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> utilisation <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(utilisation_rate), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(quarter_date)</span>
<span id="cb14-5"></span>
<span id="cb14-6">utilisation_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> utilisation_trend_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb14-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">start_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(avg_utilisation),</span>
<span id="cb14-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">end_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">last</span>(avg_utilisation),</span>
<span id="cb14-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">min_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(avg_utilisation, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb14-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(avg_utilisation, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb14-12">  )</span>
<span id="cb14-13"></span>
<span id="cb14-14">utilisation_trend_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb14-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, avg_utilisation)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#7a4b9d"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#7a4b9d"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb14-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average utilisation"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Plan utilisation over time"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/utilisation-trend-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Plan utilisation across the visible quarterly extracts.</figcaption>
</figure>
</div>
</div>
</div>
<p>Payments are approximately participants multiplied by approved budgets multiplied by utilisation. In this short series, utilisation moves from 66.1% to 67.1%, with a range of 66.0% to 68.7%. That points the descriptive story toward participant growth and average budget growth rather than a large utilisation-rate shift.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb15-1">budget_pressure <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> budget <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb15-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb15-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(avg_support_budget, participant_count),</span>
<span id="cb15-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">implied_budget_pool =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> avg_support_budget, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb15-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb15-8">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb15-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_growth =</span> participants <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(participants) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb15-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget_growth =</span> avg_budget <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(avg_budget) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>,</span>
<span id="cb15-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">implied_pool_growth =</span> implied_budget_pool <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(implied_budget_pool) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb15-14">  )</span>
<span id="cb15-15"></span>
<span id="cb15-16">budget_pressure <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(quarter_date, participant_growth, avg_budget_growth, implied_pool_growth) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_longer</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measure"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"growth"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb15-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">measure =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">recode</span>(</span>
<span id="cb15-21">      measure,</span>
<span id="cb15-22">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_growth =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participants"</span>,</span>
<span id="cb15-23">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget_growth =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average support budget"</span>,</span>
<span id="cb15-24">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">implied_pool_growth =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participant x budget pool"</span></span>
<span id="cb15-25">    )</span>
<span id="cb15-26">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb15-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, growth, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> measure)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb15-28">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey80"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb15-29">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb15-30">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb15-31">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb15-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Growth since first available quarter"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/participant-budget-growth-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Participant count and average support budget growth, indexed to the first available quarter.</figcaption>
</figure>
</div>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Appendix: support-class budget snapshot">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-3-contents" aria-controls="callout-3" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Appendix: support-class budget snapshot
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-3" class="callout-3-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb16-1">budget <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(support_class) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb16-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rows =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(),</span>
<span id="cb16-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">usable_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb16-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(avg_support_budget),</span>
<span id="cb16-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(avg_support_budget),</span>
<span id="cb16-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb16-10">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">left_join</span>(</span>
<span id="cb16-12">    payments_support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-13">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-14">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(support_class) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-15">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">total_payments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>),</span>
<span id="cb16-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">by =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span></span>
<span id="cb16-17">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(total_payments)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb16-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">usable_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(usable_participants),</span>
<span id="cb16-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(median_avg_budget, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb16-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mean_avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(mean_avg_budget, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb16-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">total_payments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(total_payments, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb16-24">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb16-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 18%">
<col style="width: 5%">
<col style="width: 21%">
<col style="width: 19%">
<col style="width: 17%">
<col style="width: 17%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">support_class</th>
<th style="text-align: right;">rows</th>
<th style="text-align: left;">usable_participants</th>
<th style="text-align: left;">median_avg_budget</th>
<th style="text-align: left;">mean_avg_budget</th>
<th style="text-align: left;">total_payments</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Core</td>
<td style="text-align: right;">5857</td>
<td style="text-align: left;">524,476</td>
<td style="text-align: left;">$93,000</td>
<td style="text-align: left;">$103,684</td>
<td style="text-align: left;">$38,509,796,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Capital</td>
<td style="text-align: right;">3446</td>
<td style="text-align: left;">106,679</td>
<td style="text-align: left;">$19,500</td>
<td style="text-align: left;">$20,195</td>
<td style="text-align: left;">$1,419,899,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">CapacityBuilding</td>
<td style="text-align: right;">5949</td>
<td style="text-align: left;">633,591</td>
<td style="text-align: left;">$20,000</td>
<td style="text-align: left;">$20,354</td>
<td style="text-align: left;">NA</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Suppressed participant counts such as <code>&lt;11</code> are treated as missing. Weighted summaries use non-suppressed participant counts where they are available and otherwise fall back to unweighted summaries.</p>
</div>
</div>
</div>
</section>
<section id="disability-mix-and-payment-growth" class="level2">
<h2 class="anchored" data-anchor-id="disability-mix-and-payment-growth">Disability Mix and Payment Growth</h2>
<p>The payments files are the most useful addition for spend analysis because they contain actual payment amounts by disability group as well as support class, support category, item, region and age band. The disability-group rows below use national aggregate rows where available, so nested <code>ALL</code> rows are not double-counted.</p>
<div class="callout callout-style-default callout-note callout-titled" title="Appendix: support class, category and item payment growth">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-4-contents" aria-controls="callout-4" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Appendix: support class, category and item payment growth
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-4" class="callout-4-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<p>The support-level tables are still useful audit checks, but the main story below focuses on disability groups.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb17-1">payments_support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_date, support_class) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(support_class) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.by_group =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">index =</span> payment_amount <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">first</span>(payment_amount) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb17-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, index, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> support_class)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb17-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey80"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb17-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb17-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb17-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb17-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Growth since first available quarter"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Support class"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/payment-growth-overall-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Payment growth by support class, indexed to the first available quarter.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1">first_payment_qtr <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(payments_support_class<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb18-2">last_payment_qtr <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(payments_support_class<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb18-3"></span>
<span id="cb18-4">payment_change <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data, group_vars) {</span>
<span id="cb18-5">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(data) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb18-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb18-7">      <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!!!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set_names</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">character</span>()), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(group_vars)), group_vars),</span>
<span id="cb18-8">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount_first =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb18-9">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount_last =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb18-10">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_first =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb18-11">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_last =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb18-12">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb18-13">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb18-14">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_first =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb18-15">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_last =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>(),</span>
<span id="cb18-16">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">numeric</span>()</span>
<span id="cb18-17">    ))</span>
<span id="cb18-18">  }</span>
<span id="cb18-19"></span>
<span id="cb18-20">  wide <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(first_payment_qtr, last_payment_qtr)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-22">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">all_of</span>(group_vars)), quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-23">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb18-24">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb18-25">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_participants, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb18-26">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb18-27">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">period =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> first_payment_qtr, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"first"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"last"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-29">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-30">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_wider</span>(</span>
<span id="cb18-31">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_from =</span> period,</span>
<span id="cb18-32">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_from =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(payment_amount, participants),</span>
<span id="cb18-33">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_fill =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb18-34">    )</span>
<span id="cb18-35"></span>
<span id="cb18-36">  needed_cols <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"payment_amount_first"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"payment_amount_last"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participants_first"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"participants_last"</span>)</span>
<span id="cb18-37">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (col <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> needed_cols) {</span>
<span id="cb18-38">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span>col <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(wide)) wide[[col]] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb18-39">  }</span>
<span id="cb18-40"></span>
<span id="cb18-41">  wide <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-42">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb18-43">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount_first =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(payment_amount_first, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb18-44">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount_last =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(payment_amount_last, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb18-45">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_first =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(participants_first, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb18-46">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_last =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(participants_last, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>),</span>
<span id="cb18-47">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_change =</span> payment_amount_last <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> payment_amount_first,</span>
<span id="cb18-48">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_change =</span> participants_last <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> participants_first,</span>
<span id="cb18-49">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_first =</span> payment_amount_first <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> participants_first,</span>
<span id="cb18-50">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_last =</span> payment_amount_last <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> participants_last,</span>
<span id="cb18-51">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_change =</span> payment_per_participant_last <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> payment_per_participant_first</span>
<span id="cb18-52">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-53">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(payment_change)))</span>
<span id="cb18-54">}</span>
<span id="cb18-55"></span>
<span id="cb18-56">support_class_change <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">payment_change</span>(payments_support_class, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>)</span>
<span id="cb18-57"></span>
<span id="cb18-58">support_class_change <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-59">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb18-60">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(payment_amount_first, payment_amount_last, payment_change), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)),</span>
<span id="cb18-61">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(participants_first, participants_last, participant_change), comma),</span>
<span id="cb18-62">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(payment_per_participant_first, payment_per_participant_last, payment_per_participant_change), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>))</span>
<span id="cb18-63">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb18-64">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 8%">
<col style="width: 9%">
<col style="width: 9%">
<col style="width: 8%">
<col style="width: 8%">
<col style="width: 6%">
<col style="width: 8%">
<col style="width: 13%">
<col style="width: 13%">
<col style="width: 14%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">support_class</th>
<th style="text-align: left;">payment_amount_first</th>
<th style="text-align: left;">payment_amount_last</th>
<th style="text-align: left;">participants_first</th>
<th style="text-align: left;">participants_last</th>
<th style="text-align: left;">payment_change</th>
<th style="text-align: left;">participant_change</th>
<th style="text-align: left;">payment_per_participant_first</th>
<th style="text-align: left;">payment_per_participant_last</th>
<th style="text-align: left;">payment_per_participant_change</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Core</td>
<td style="text-align: left;">$32,425,627,000</td>
<td style="text-align: left;">$38,509,796,000</td>
<td style="text-align: left;">512,210</td>
<td style="text-align: left;">552,928</td>
<td style="text-align: left;">$6,084,169,000</td>
<td style="text-align: left;">40,718</td>
<td style="text-align: left;">$63,305</td>
<td style="text-align: left;">$69,647</td>
<td style="text-align: left;">$6,342</td>
</tr>
<tr class="even">
<td style="text-align: left;">Capacity Building</td>
<td style="text-align: left;">$7,802,961,000</td>
<td style="text-align: left;">$9,028,315,000</td>
<td style="text-align: left;">637,317</td>
<td style="text-align: left;">737,282</td>
<td style="text-align: left;">$1,225,354,000</td>
<td style="text-align: left;">99,965</td>
<td style="text-align: left;">$12,243</td>
<td style="text-align: left;">$12,245</td>
<td style="text-align: left;">$2</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Capital</td>
<td style="text-align: left;">$1,018,264,000</td>
<td style="text-align: left;">$1,419,899,000</td>
<td style="text-align: left;">80,160</td>
<td style="text-align: left;">86,369</td>
<td style="text-align: left;">$401,635,000</td>
<td style="text-align: left;">6,209</td>
<td style="text-align: left;">$12,703</td>
<td style="text-align: left;">$16,440</td>
<td style="text-align: left;">$3,737</td>
</tr>
<tr class="even">
<td style="text-align: left;">Missing</td>
<td style="text-align: left;">$7,371,000</td>
<td style="text-align: left;">$3,716,000</td>
<td style="text-align: left;">151,095</td>
<td style="text-align: left;">290,973</td>
<td style="text-align: left;">-$3,655,000</td>
<td style="text-align: left;">139,878</td>
<td style="text-align: left;">$49</td>
<td style="text-align: left;">$13</td>
<td style="text-align: left;">-$36</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1">category_change <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">payment_change</span>(payments_category, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_category"</span>))</span>
<span id="cb19-2"></span>
<span id="cb19-3">category_change <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_max</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(payment_change), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb19-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb19-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount_last =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_amount_last, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb19-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participant_change),</span>
<span id="cb19-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_per_participant_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb19-10">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(support_class, support_category, payment_amount_last, payment_change, participant_change, payment_per_participant_change) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb19-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 12%">
<col style="width: 29%">
<col style="width: 13%">
<col style="width: 10%">
<col style="width: 12%">
<col style="width: 21%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">support_class</th>
<th style="text-align: left;">support_category</th>
<th style="text-align: left;">payment_amount_last</th>
<th style="text-align: left;">payment_change</th>
<th style="text-align: left;">participant_change</th>
<th style="text-align: left;">payment_per_participant_change</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Core</td>
<td style="text-align: left;">Daily Activities</td>
<td style="text-align: left;">$25,446,659,000</td>
<td style="text-align: left;">$4,005,204,000</td>
<td style="text-align: left;">29,401</td>
<td style="text-align: left;">$5,735</td>
</tr>
<tr class="even">
<td style="text-align: left;">Core</td>
<td style="text-align: left;">Social Community and Civic Participation</td>
<td style="text-align: left;">$11,563,196,000</td>
<td style="text-align: left;">$2,090,588,000</td>
<td style="text-align: left;">23,533</td>
<td style="text-align: left;">$3,977</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Capacity Building</td>
<td style="text-align: left;">CB Daily Activity</td>
<td style="text-align: left;">$5,790,549,000</td>
<td style="text-align: left;">$614,241,000</td>
<td style="text-align: left;">79,004</td>
<td style="text-align: left;">-$117</td>
</tr>
<tr class="even">
<td style="text-align: left;">Capacity Building</td>
<td style="text-align: left;">CB Relationships</td>
<td style="text-align: left;">$954,703,000</td>
<td style="text-align: left;">$323,821,000</td>
<td style="text-align: left;">18,386</td>
<td style="text-align: left;">$1,801</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Capital</td>
<td style="text-align: left;">Assistive Technology</td>
<td style="text-align: left;">$789,391,000</td>
<td style="text-align: left;">$203,350,000</td>
<td style="text-align: left;">6,627</td>
<td style="text-align: left;">$1,945</td>
</tr>
<tr class="even">
<td style="text-align: left;">Capital</td>
<td style="text-align: left;">Home Modifications</td>
<td style="text-align: left;">$630,508,000</td>
<td style="text-align: left;">$198,285,000</td>
<td style="text-align: left;">1,070</td>
<td style="text-align: left;">$7,770</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Capacity Building</td>
<td style="text-align: left;">Support Coordination</td>
<td style="text-align: left;">$1,198,990,000</td>
<td style="text-align: left;">$126,501,000</td>
<td style="text-align: left;">38,708</td>
<td style="text-align: left;">-$44</td>
</tr>
<tr class="even">
<td style="text-align: left;">Capacity Building</td>
<td style="text-align: left;">CB Choice and Control</td>
<td style="text-align: left;">$645,490,000</td>
<td style="text-align: left;">$86,859,000</td>
<td style="text-align: left;">97,518</td>
<td style="text-align: left;">-$74</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Core</td>
<td style="text-align: left;">Consumables</td>
<td style="text-align: left;">$620,377,000</td>
<td style="text-align: left;">-$64,787,000</td>
<td style="text-align: left;">-29,903</td>
<td style="text-align: left;">$15</td>
</tr>
<tr class="even">
<td style="text-align: left;">Core</td>
<td style="text-align: left;">Transport</td>
<td style="text-align: left;">$879,563,000</td>
<td style="text-align: left;">$53,163,000</td>
<td style="text-align: left;">4,449</td>
<td style="text-align: left;">$146</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Capacity Building</td>
<td style="text-align: left;">CB Employment</td>
<td style="text-align: left;">$177,050,000</td>
<td style="text-align: left;">$45,336,000</td>
<td style="text-align: left;">-4,672</td>
<td style="text-align: left;">$3,146</td>
</tr>
<tr class="even">
<td style="text-align: left;">Capacity Building</td>
<td style="text-align: left;">CB Social Community and Civic Participation</td>
<td style="text-align: left;">$233,283,000</td>
<td style="text-align: left;">$35,722,000</td>
<td style="text-align: left;">-2,067</td>
<td style="text-align: left;">$915</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Capacity Building</td>
<td style="text-align: left;">CB Health and Wellbeing</td>
<td style="text-align: left;">$26,683,000</td>
<td style="text-align: left;">-$7,512,000</td>
<td style="text-align: left;">-5,506</td>
<td style="text-align: left;">$161</td>
</tr>
<tr class="even">
<td style="text-align: left;">Missing</td>
<td style="text-align: left;">Missing</td>
<td style="text-align: left;">$3,716,000</td>
<td style="text-align: left;">-$3,655,000</td>
<td style="text-align: left;">139,878</td>
<td style="text-align: left;">-$36</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Capacity Building</td>
<td style="text-align: left;">CB Home Living</td>
<td style="text-align: left;">$1,216,000</td>
<td style="text-align: left;">$212,000</td>
<td style="text-align: left;">-43</td>
<td style="text-align: left;">$431</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">item_change <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">payment_change</span>(payments_item, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_category"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_item_number"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_item_desc"</span>))</span>
<span id="cb20-2"></span>
<span id="cb20-3"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(item_change) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb20-4">  item_change <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_max</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(payment_change), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb20-7">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">support_item_desc =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_trunc</span>(support_item_desc, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span>),</span>
<span id="cb20-8">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount_last =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_amount_last, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb20-9">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb20-10">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participant_change),</span>
<span id="cb20-11">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_per_participant_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb20-12">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(support_class, support_category, support_item_number, support_item_desc, payment_amount_last, payment_change, participant_change, payment_per_participant_change) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-14">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb20-15">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb20-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The current public payments extract did not expose national item-level rows under the no-double-counting filters used here."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb20-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb20-18">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 100%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">note</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">The current public payments extract did not expose national item-level rows under the no-double-counting filters used here.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1">payments_disability_candidates <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> payments <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb21-3">    state <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, service_district <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, disability_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, age_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>,</span>
<span id="cb21-4">    support_category <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_item_number <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span></span>
<span id="cb21-5">  )</span>
<span id="cb21-6"></span>
<span id="cb21-7"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(payments_disability_candidates<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb21-8">  payments_disability <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> payments_disability_candidates <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-10">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_label, quarter_date, quarter_index, disability_group) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-11">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb21-12">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb21-13">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(payment_participants, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb21-14">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb21-15">    )</span>
<span id="cb21-16">  disability_payment_basis <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"National disability-group aggregate rows"</span></span>
<span id="cb21-17">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb21-18">  payments_disability <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> payments_disability_candidates <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-20">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_label, quarter_date, quarter_index, disability_group) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-21">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb21-22">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb21-23">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_participants, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb21-24">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb21-25">    )</span>
<span id="cb21-26">  disability_payment_basis <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Support-class rows summed within disability group"</span></span>
<span id="cb21-27">}</span>
<span id="cb21-28"></span>
<span id="cb21-29">payments_disability <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> payments_disability <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-30">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb21-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.infinite</span>(payment_participants), <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, payment_participants),</span>
<span id="cb21-32">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> payment_amount <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> payment_participants</span>
<span id="cb21-33">  )</span>
<span id="cb21-34"></span>
<span id="cb21-35"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb21-36">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">basis =</span> disability_payment_basis,</span>
<span id="cb21-37">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">disability_groups =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(payments_disability<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>disability_group),</span>
<span id="cb21-38">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quarters =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(payments_disability<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_label)), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">", "</span>)</span>
<span id="cb21-39">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb21-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 30%">
<col style="width: 11%">
<col style="width: 58%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">basis</th>
<th style="text-align: right;">disability_groups</th>
<th style="text-align: left;">quarters</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Support-class rows summed within disability group</td>
<td style="text-align: right;">18</td>
<td style="text-align: left;">December 2024, December 2025, June 2024, June 2025, March 2025, September 2024, September 2025</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The participant-count view shows scale: groups that are large enough to move total spend even if average payments are moderate.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb22" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb22-1">largest_by_count <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb22-3">    disability_group,</span>
<span id="cb22-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(payment_participants),</span>
<span id="cb22-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">total_payments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb22-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_per_participant, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb22-7">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb22-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 30%">
<col style="width: 23%">
<col style="width: 18%">
<col style="width: 27%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">disability_group</th>
<th style="text-align: left;">payment_participants</th>
<th style="text-align: left;">total_payments</th>
<th style="text-align: left;">payment_per_participant</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Autism</td>
<td style="text-align: left;">630,030</td>
<td style="text-align: left;">$10,565,618,000</td>
<td style="text-align: left;">$16,770</td>
</tr>
<tr class="even">
<td style="text-align: left;">Intellectual Disability</td>
<td style="text-align: left;">213,590</td>
<td style="text-align: left;">$10,992,967,000</td>
<td style="text-align: left;">$51,468</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Developmental delay</td>
<td style="text-align: left;">172,567</td>
<td style="text-align: left;">$891,824,000</td>
<td style="text-align: left;">$5,168</td>
</tr>
<tr class="even">
<td style="text-align: left;">Psychosocial disability</td>
<td style="text-align: left;">144,402</td>
<td style="text-align: left;">$6,054,874,000</td>
<td style="text-align: left;">$41,931</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Other Neurological</td>
<td style="text-align: left;">75,576</td>
<td style="text-align: left;">$4,158,314,000</td>
<td style="text-align: left;">$55,022</td>
</tr>
<tr class="even">
<td style="text-align: left;">Hearing Impairment</td>
<td style="text-align: left;">58,663</td>
<td style="text-align: left;">$283,182,000</td>
<td style="text-align: left;">$4,827</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Other Physical</td>
<td style="text-align: left;">57,391</td>
<td style="text-align: left;">$1,534,717,000</td>
<td style="text-align: left;">$26,741</td>
</tr>
<tr class="even">
<td style="text-align: left;">ABI</td>
<td style="text-align: left;">51,816</td>
<td style="text-align: left;">$3,441,433,000</td>
<td style="text-align: left;">$66,416</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Cerebral Palsy</td>
<td style="text-align: left;">49,537</td>
<td style="text-align: left;">$3,175,466,000</td>
<td style="text-align: left;">$64,103</td>
</tr>
<tr class="even">
<td style="text-align: left;">Global developmental delay</td>
<td style="text-align: left;">38,648</td>
<td style="text-align: left;">$315,257,000</td>
<td style="text-align: left;">$8,157</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The total-payments view combines scale and intensity: these are the groups contributing the largest payment dollars in the latest quarter.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb23" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb23-1">largest_by_spend <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb23-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb23-3">    disability_group,</span>
<span id="cb23-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">total_payments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb23-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(payment_participants),</span>
<span id="cb23-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_per_participant, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb23-7">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb23-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 28%">
<col style="width: 18%">
<col style="width: 24%">
<col style="width: 28%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">disability_group</th>
<th style="text-align: left;">total_payments</th>
<th style="text-align: left;">payment_participants</th>
<th style="text-align: left;">payment_per_participant</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Intellectual Disability</td>
<td style="text-align: left;">$10,992,967,000</td>
<td style="text-align: left;">213,590</td>
<td style="text-align: left;">$51,468</td>
</tr>
<tr class="even">
<td style="text-align: left;">Autism</td>
<td style="text-align: left;">$10,565,618,000</td>
<td style="text-align: left;">630,030</td>
<td style="text-align: left;">$16,770</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Psychosocial disability</td>
<td style="text-align: left;">$6,054,874,000</td>
<td style="text-align: left;">144,402</td>
<td style="text-align: left;">$41,931</td>
</tr>
<tr class="even">
<td style="text-align: left;">Other Neurological</td>
<td style="text-align: left;">$4,158,314,000</td>
<td style="text-align: left;">75,576</td>
<td style="text-align: left;">$55,022</td>
</tr>
<tr class="odd">
<td style="text-align: left;">ABI</td>
<td style="text-align: left;">$3,441,433,000</td>
<td style="text-align: left;">51,816</td>
<td style="text-align: left;">$66,416</td>
</tr>
<tr class="even">
<td style="text-align: left;">Cerebral Palsy</td>
<td style="text-align: left;">$3,175,466,000</td>
<td style="text-align: left;">49,537</td>
<td style="text-align: left;">$64,103</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Stroke</td>
<td style="text-align: left;">$1,746,058,000</td>
<td style="text-align: left;">30,248</td>
<td style="text-align: left;">$57,725</td>
</tr>
<tr class="even">
<td style="text-align: left;">Down Syndrome</td>
<td style="text-align: left;">$1,612,746,000</td>
<td style="text-align: left;">26,879</td>
<td style="text-align: left;">$60,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Other Physical</td>
<td style="text-align: left;">$1,534,717,000</td>
<td style="text-align: left;">57,391</td>
<td style="text-align: left;">$26,741</td>
</tr>
<tr class="even">
<td style="text-align: left;">Other</td>
<td style="text-align: left;">$1,255,897,000</td>
<td style="text-align: left;">36,546</td>
<td style="text-align: left;">$34,365</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The average-payment view is filtered to groups above the first quartile of participant counts, so it does not get dominated by very small groups with noisy averages.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb24" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb24-1">largest_by_average_spend <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb24-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb24-3">    disability_group,</span>
<span id="cb24-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_per_participant, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb24-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(payment_participants),</span>
<span id="cb24-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">total_payments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb24-7">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb24-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 28%">
<col style="width: 28%">
<col style="width: 24%">
<col style="width: 18%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">disability_group</th>
<th style="text-align: left;">payment_per_participant</th>
<th style="text-align: left;">payment_participants</th>
<th style="text-align: left;">total_payments</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">ABI</td>
<td style="text-align: left;">$66,416</td>
<td style="text-align: left;">51,816</td>
<td style="text-align: left;">$3,441,433,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Cerebral Palsy</td>
<td style="text-align: left;">$64,103</td>
<td style="text-align: left;">49,537</td>
<td style="text-align: left;">$3,175,466,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Stroke</td>
<td style="text-align: left;">$57,725</td>
<td style="text-align: left;">30,248</td>
<td style="text-align: left;">$1,746,058,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Other Neurological</td>
<td style="text-align: left;">$55,022</td>
<td style="text-align: left;">75,576</td>
<td style="text-align: left;">$4,158,314,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Intellectual Disability</td>
<td style="text-align: left;">$51,468</td>
<td style="text-align: left;">213,590</td>
<td style="text-align: left;">$10,992,967,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Psychosocial disability</td>
<td style="text-align: left;">$41,931</td>
<td style="text-align: left;">144,402</td>
<td style="text-align: left;">$6,054,874,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Multiple Sclerosis</td>
<td style="text-align: left;">$39,677</td>
<td style="text-align: left;">31,629</td>
<td style="text-align: left;">$1,254,956,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Other</td>
<td style="text-align: left;">$34,365</td>
<td style="text-align: left;">36,546</td>
<td style="text-align: left;">$1,255,897,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Other Physical</td>
<td style="text-align: left;">$26,741</td>
<td style="text-align: left;">57,391</td>
<td style="text-align: left;">$1,534,717,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Autism</td>
<td style="text-align: left;">$16,770</td>
<td style="text-align: left;">630,030</td>
<td style="text-align: left;">$10,565,618,000</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb25" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb25-1">disability_change <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">payment_change</span>(payments_disability, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability_group"</span>)</span>
<span id="cb25-2"></span>
<span id="cb25-3">total_disability_payment_change <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(disability_change<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>payment_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb25-4"></span>
<span id="cb25-5">disability_driver <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> disability_change <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb25-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb25-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_contribution =</span> (participants_last <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> participants_first) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb25-8">      ((payment_per_participant_first <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> payment_per_participant_last) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb25-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intensity_contribution =</span> (payment_per_participant_last <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> payment_per_participant_first) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span></span>
<span id="cb25-10">      ((participants_first <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> participants_last) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>),</span>
<span id="cb25-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">change_share =</span> payment_change <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> total_disability_payment_change,</span>
<span id="cb25-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">stroke_flag =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>(disability_group), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">bstroke</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">b"</span>)</span>
<span id="cb25-13">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb25-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(payment_change)))</span>
<span id="cb25-15"></span>
<span id="cb25-16"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(disability_driver) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb25-17">  disability_driver <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb25-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_max</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(payment_change), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb25-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb25-20">      disability_group,</span>
<span id="cb25-21">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount_last =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_amount_last, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb25-22">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb25-23">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">change_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(change_share, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb25-24">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participant_change),</span>
<span id="cb25-25">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_contribution =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(participant_contribution, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb25-26">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">intensity_contribution =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(intensity_contribution, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb25-27">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_per_participant_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb25-28">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb25-29">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb25-30">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb25-31">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No disability-group payment rows were available under the no-double-counting filters used here."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb25-32">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb25-33">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 14%">
<col style="width: 11%">
<col style="width: 8%">
<col style="width: 7%">
<col style="width: 11%">
<col style="width: 14%">
<col style="width: 13%">
<col style="width: 18%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">disability_group</th>
<th style="text-align: left;">payment_amount_last</th>
<th style="text-align: left;">payment_change</th>
<th style="text-align: left;">change_share</th>
<th style="text-align: left;">participant_change</th>
<th style="text-align: left;">participant_contribution</th>
<th style="text-align: left;">intensity_contribution</th>
<th style="text-align: left;">payment_per_participant_change</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Autism</td>
<td style="text-align: left;">$10,565,618,000</td>
<td style="text-align: left;">$2,293,245,000</td>
<td style="text-align: left;">29.7%</td>
<td style="text-align: left;">173,093</td>
<td style="text-align: left;">$3,018,221,951</td>
<td style="text-align: left;">-$724,976,951</td>
<td style="text-align: left;">-$1,334</td>
</tr>
<tr class="even">
<td style="text-align: left;">Intellectual Disability</td>
<td style="text-align: left;">$10,992,967,000</td>
<td style="text-align: left;">$1,362,626,000</td>
<td style="text-align: left;">17.7%</td>
<td style="text-align: left;">19,472</td>
<td style="text-align: left;">$984,098,993</td>
<td style="text-align: left;">$378,527,007</td>
<td style="text-align: left;">$1,857</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Other Neurological</td>
<td style="text-align: left;">$4,158,314,000</td>
<td style="text-align: left;">$844,032,000</td>
<td style="text-align: left;">10.9%</td>
<td style="text-align: left;">14,054</td>
<td style="text-align: left;">$765,191,910</td>
<td style="text-align: left;">$78,840,090</td>
<td style="text-align: left;">$1,150</td>
</tr>
<tr class="even">
<td style="text-align: left;">Psychosocial disability</td>
<td style="text-align: left;">$6,054,874,000</td>
<td style="text-align: left;">$812,576,000</td>
<td style="text-align: left;">10.5%</td>
<td style="text-align: left;">10,473</td>
<td style="text-align: left;">$424,539,006</td>
<td style="text-align: left;">$388,036,994</td>
<td style="text-align: left;">$2,788</td>
</tr>
<tr class="odd">
<td style="text-align: left;">ABI</td>
<td style="text-align: left;">$3,441,433,000</td>
<td style="text-align: left;">$536,420,000</td>
<td style="text-align: left;">6.9%</td>
<td style="text-align: left;">6,727</td>
<td style="text-align: left;">$440,096,603</td>
<td style="text-align: left;">$96,323,397</td>
<td style="text-align: left;">$1,988</td>
</tr>
<tr class="even">
<td style="text-align: left;">Stroke</td>
<td style="text-align: left;">$1,746,058,000</td>
<td style="text-align: left;">$409,681,000</td>
<td style="text-align: left;">5.3%</td>
<td style="text-align: left;">5,248</td>
<td style="text-align: left;">$291,735,853</td>
<td style="text-align: left;">$117,945,147</td>
<td style="text-align: left;">$4,270</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Cerebral Palsy</td>
<td style="text-align: left;">$3,175,466,000</td>
<td style="text-align: left;">$406,537,000</td>
<td style="text-align: left;">5.3%</td>
<td style="text-align: left;">3,541</td>
<td style="text-align: left;">$220,077,145</td>
<td style="text-align: left;">$186,459,855</td>
<td style="text-align: left;">$3,904</td>
</tr>
<tr class="even">
<td style="text-align: left;">Other</td>
<td style="text-align: left;">$1,255,897,000</td>
<td style="text-align: left;">$397,298,000</td>
<td style="text-align: left;">5.1%</td>
<td style="text-align: left;">11,275</td>
<td style="text-align: left;">$385,269,522</td>
<td style="text-align: left;">$12,028,478</td>
<td style="text-align: left;">$389</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Multiple Sclerosis</td>
<td style="text-align: left;">$1,254,956,000</td>
<td style="text-align: left;">$177,850,000</td>
<td style="text-align: left;">2.3%</td>
<td style="text-align: left;">4,389</td>
<td style="text-align: left;">$173,845,483</td>
<td style="text-align: left;">$4,004,517</td>
<td style="text-align: left;">$136</td>
</tr>
<tr class="even">
<td style="text-align: left;">Down Syndrome</td>
<td style="text-align: left;">$1,612,746,000</td>
<td style="text-align: left;">$167,282,000</td>
<td style="text-align: left;">2.2%</td>
<td style="text-align: left;">1,166</td>
<td style="text-align: left;">$67,753,650</td>
<td style="text-align: left;">$99,528,350</td>
<td style="text-align: left;">$3,785</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Spinal Cord Injury</td>
<td style="text-align: left;">$1,132,552,000</td>
<td style="text-align: left;">$150,387,000</td>
<td style="text-align: left;">1.9%</td>
<td style="text-align: left;">2,184</td>
<td style="text-align: left;">$128,799,772</td>
<td style="text-align: left;">$21,587,228</td>
<td style="text-align: left;">$1,205</td>
</tr>
<tr class="even">
<td style="text-align: left;">Other Physical</td>
<td style="text-align: left;">$1,534,717,000</td>
<td style="text-align: left;">$140,440,000</td>
<td style="text-align: left;">1.8%</td>
<td style="text-align: left;">4,015</td>
<td style="text-align: left;">$106,122,913</td>
<td style="text-align: left;">$34,317,087</td>
<td style="text-align: left;">$620</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Developmental delay</td>
<td style="text-align: left;">$891,824,000</td>
<td style="text-align: left;">-$83,173,000</td>
<td style="text-align: left;">-1.1%</td>
<td style="text-align: left;">15,852</td>
<td style="text-align: left;">$90,272,802</td>
<td style="text-align: left;">-$173,445,802</td>
<td style="text-align: left;">-$1,053</td>
</tr>
<tr class="even">
<td style="text-align: left;">Visual Impairment</td>
<td style="text-align: left;">$504,113,000</td>
<td style="text-align: left;">$62,762,000</td>
<td style="text-align: left;">0.8%</td>
<td style="text-align: left;">2,015</td>
<td style="text-align: left;">$41,165,690</td>
<td style="text-align: left;">$21,596,310</td>
<td style="text-align: left;">$934</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Hearing Impairment</td>
<td style="text-align: left;">$283,182,000</td>
<td style="text-align: left;">$24,455,000</td>
<td style="text-align: left;">0.3%</td>
<td style="text-align: left;">5,694</td>
<td style="text-align: left;">$27,649,398</td>
<td style="text-align: left;">-$3,194,398</td>
<td style="text-align: left;">-$57</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb26" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb26-1">top_driver_groups <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> disability_driver <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(payment_change)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_max</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(payment_change), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">7</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(disability_group)</span>
<span id="cb26-5"></span>
<span id="cb26-6">stroke_groups <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> disability_driver <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(stroke_flag) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pull</span>(disability_group)</span>
<span id="cb26-9"></span>
<span id="cb26-10">driver_groups <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(stroke_groups, top_driver_groups)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">head</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)</span>
<span id="cb26-12"></span>
<span id="cb26-13">disability_trend <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> payments_disability <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(disability_group <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> driver_groups) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(disability_group, quarter_date) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(disability_group) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb26-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_growth =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">index_to_first</span>(payment_amount),</span>
<span id="cb26-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_growth =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">index_to_first</span>(payment_participants),</span>
<span id="cb26-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_growth =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">index_to_first</span>(payment_per_participant)</span>
<span id="cb26-21">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>()</span>
<span id="cb26-23"></span>
<span id="cb26-24"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(disability_trend) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb26-25">  disability_trend <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-26">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(quarter_date, disability_group, payment_growth, participant_growth, payment_per_participant_growth) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-27">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pivot_longer</span>(</span>
<span id="cb26-28">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ends_with</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"_growth"</span>),</span>
<span id="cb26-29">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">names_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"measure"</span>,</span>
<span id="cb26-30">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">values_to =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"growth"</span></span>
<span id="cb26-31">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-32">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb26-33">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">measure =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">recode</span>(</span>
<span id="cb26-34">        measure,</span>
<span id="cb26-35">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_growth =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Payments"</span>,</span>
<span id="cb26-36">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_growth =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participants"</span>,</span>
<span id="cb26-37">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_growth =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Payments per participant"</span></span>
<span id="cb26-38">      )</span>
<span id="cb26-39">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-40">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(growth)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-41">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, growth, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> disability_group)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-42">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_hline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">yintercept =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey80"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-43">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-44">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-45">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> measure) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-46">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb26-47">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Growth since first available quarter"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Disability group"</span>)</span>
<span id="cb26-48">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb26-49">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No stroke or top-driver disability-group trend rows were available to plot."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb26-50">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb26-51">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/disability-driver-trends-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Payment, participant and payment-per-participant trends for stroke and the largest disability-group growth contributors.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb27" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb27-1"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">any</span>(disability_driver<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>stroke_flag, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) {</span>
<span id="cb27-2">  disability_driver <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-3">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(stroke_flag) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb27-5">      disability_group,</span>
<span id="cb27-6">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount_first =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_amount_first, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb27-7">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount_last =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_amount_last, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb27-8">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb27-9">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">change_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(change_share, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb27-10">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_first =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participants_first),</span>
<span id="cb27-11">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_last =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participants_last),</span>
<span id="cb27-12">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participant_change),</span>
<span id="cb27-13">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant_change =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_per_participant_change, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb27-14">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-15">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb27-16">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb27-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Stroke was not exposed as a separate disability group in the current public payment extract."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb27-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb27-19">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 9%">
<col style="width: 12%">
<col style="width: 11%">
<col style="width: 8%">
<col style="width: 7%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 10%">
<col style="width: 17%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">disability_group</th>
<th style="text-align: left;">payment_amount_first</th>
<th style="text-align: left;">payment_amount_last</th>
<th style="text-align: left;">payment_change</th>
<th style="text-align: left;">change_share</th>
<th style="text-align: left;">participants_first</th>
<th style="text-align: left;">participants_last</th>
<th style="text-align: left;">participant_change</th>
<th style="text-align: left;">payment_per_participant_change</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Stroke</td>
<td style="text-align: left;">$1,336,377,000</td>
<td style="text-align: left;">$1,746,058,000</td>
<td style="text-align: left;">$409,681,000</td>
<td style="text-align: left;">5.3%</td>
<td style="text-align: left;">25,000</td>
<td style="text-align: left;">30,248</td>
<td style="text-align: left;">5,248</td>
<td style="text-align: left;">$4,270</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>The payment tables are useful, but the time window is short. These are growth-contribution signals, not stable long-run trends. The disability-group decomposition separates participant growth from payment intensity, but it still reflects aggregate public payment rows rather than participant-level need or plan history.</p>
<div class="callout callout-style-default callout-note callout-titled" title="Appendix: budgets, payments and utilisation detail">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-5-contents" aria-controls="callout-5" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Appendix: budgets, payments and utilisation detail
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-5" class="callout-5-contents callout-collapse collapse">
<section id="budgets-payments-and-utilisation" class="level2 callout-body-container callout-body">
<h2 class="anchored" data-anchor-id="budgets-payments-and-utilisation">Budgets, Payments and Utilisation</h2>
<p>Budget, utilisation and payments answer related but different questions. A high annualised support budget does not necessarily mean a high payment amount in the observed quarter, and low utilisation can reflect need, timing, provider availability or administrative barriers.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb28" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb28-1">latest_model_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(avg_support_budget), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(utilisation_rate), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(payment_amount), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(payment_per_participant)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb28-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb28-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmin</span>(utilisation_rate, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb28-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">high_budget_cut =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(avg_support_budget, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb28-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">low_utilisation_cut =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(utilisation_rate, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb28-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">high_utilisation_cut =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(utilisation_rate, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb28-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">high_payment_cut =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(payment_per_participant, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb28-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">signal =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">case_when</span>(</span>
<span id="cb28-11">      avg_support_budget <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> high_budget_cut <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> utilisation_rate <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> low_utilisation_cut <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"High budget, low utilisation"</span>,</span>
<span id="cb28-12">      utilisation_rate <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> high_utilisation_cut <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> payment_per_participant <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> high_payment_cut <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"High utilisation, high payment"</span>,</span>
<span id="cb28-13">      payment_per_participant <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> high_payment_cut <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> avg_support_budget <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> high_budget_cut <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"High payment, moderate budget"</span>,</span>
<span id="cb28-14">      <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_character_</span></span>
<span id="cb28-15">    )</span>
<span id="cb28-16">  )</span></code></pre></div></div>
</details>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb29" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb29-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb29-2">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">signal =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"High budget, low utilisation"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"High utilisation, high payment"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"High payment, moderate budget"</span>),</span>
<span id="cb29-3">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">definition =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb29-4">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average support budget is in the top quartile while utilisation is in the bottom quartile."</span>,</span>
<span id="cb29-5">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Utilisation and payments per participant are both in the top quartile."</span>,</span>
<span id="cb29-6">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Payments per participant are in the top quartile while average support budget is below the top quartile."</span></span>
<span id="cb29-7">  )</span>
<span id="cb29-8">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb29-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 22%">
<col style="width: 77%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">signal</th>
<th style="text-align: left;">definition</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">High budget, low utilisation</td>
<td style="text-align: left;">Average support budget is in the top quartile while utilisation is in the bottom quartile.</td>
</tr>
<tr class="even">
<td style="text-align: left;">High utilisation, high payment</td>
<td style="text-align: left;">Utilisation and payments per participant are both in the top quartile.</td>
</tr>
<tr class="odd">
<td style="text-align: left;">High payment, moderate budget</td>
<td style="text-align: left;">Payments per participant are in the top quartile while average support budget is below the top quartile.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb30" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb30-1">signal_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> latest_model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(signal))</span>
<span id="cb30-3"></span>
<span id="cb30-4">signal_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(signal) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb30-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_districts =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(service_district),</span>
<span id="cb30-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grouped_cells =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(),</span>
<span id="cb30-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb30-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">total_payments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb30-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(payment_per_participant),</span>
<span id="cb30-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(utilisation_rate),</span>
<span id="cb30-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(avg_support_budget),</span>
<span id="cb30-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb30-15">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb30-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participants),</span>
<span id="cb30-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">total_payments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(total_payments, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb30-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(median_payment_per_participant, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb30-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(median_utilisation, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb30-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(median_avg_budget, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb30-22">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb30-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 19%">
<col style="width: 11%">
<col style="width: 8%">
<col style="width: 8%">
<col style="width: 10%">
<col style="width: 19%">
<col style="width: 11%">
<col style="width: 11%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">signal</th>
<th style="text-align: right;">service_districts</th>
<th style="text-align: right;">grouped_cells</th>
<th style="text-align: left;">participants</th>
<th style="text-align: left;">total_payments</th>
<th style="text-align: left;">median_payment_per_participant</th>
<th style="text-align: left;">median_utilisation</th>
<th style="text-align: left;">median_avg_budget</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">High budget, low utilisation</td>
<td style="text-align: right;">69</td>
<td style="text-align: right;">152</td>
<td style="text-align: left;">5,833</td>
<td style="text-align: left;">$783,146,000</td>
<td style="text-align: left;">$111,263</td>
<td style="text-align: left;">62.0%</td>
<td style="text-align: left;">$159,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">High payment, moderate budget</td>
<td style="text-align: right;">46</td>
<td style="text-align: right;">71</td>
<td style="text-align: left;">5,321</td>
<td style="text-align: left;">$624,586,000</td>
<td style="text-align: left;">$111,333</td>
<td style="text-align: left;">79.0%</td>
<td style="text-align: left;">$127,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">High utilisation, high payment</td>
<td style="text-align: right;">74</td>
<td style="text-align: right;">876</td>
<td style="text-align: left;">60,014</td>
<td style="text-align: left;">$10,258,221,000</td>
<td style="text-align: left;">$172,543</td>
<td style="text-align: left;">88.0%</td>
<td style="text-align: left;">$194,000</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb31" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb31-1">signal_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(signal, state, service_district, support_class) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb31-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grouped_cells =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(),</span>
<span id="cb31-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb31-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">total_payments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb31-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(utilisation_rate),</span>
<span id="cb31-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(payment_per_participant),</span>
<span id="cb31-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb31-10">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(signal, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(participants)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(signal) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ungroup</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb31-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participants),</span>
<span id="cb31-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">total_payments =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(total_payments, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb31-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(median_utilisation, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb31-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(median_payment_per_participant, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb31-20">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb31-21">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 18%">
<col style="width: 3%">
<col style="width: 13%">
<col style="width: 8%">
<col style="width: 8%">
<col style="width: 7%">
<col style="width: 9%">
<col style="width: 11%">
<col style="width: 18%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">signal</th>
<th style="text-align: left;">state</th>
<th style="text-align: left;">service_district</th>
<th style="text-align: left;">support_class</th>
<th style="text-align: right;">grouped_cells</th>
<th style="text-align: left;">participants</th>
<th style="text-align: left;">total_payments</th>
<th style="text-align: left;">median_utilisation</th>
<th style="text-align: left;">median_payment_per_participant</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">High budget, low utilisation</td>
<td style="text-align: left;">QLD</td>
<td style="text-align: left;">Maroochydore</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">4</td>
<td style="text-align: left;">441</td>
<td style="text-align: left;">$54,727,000</td>
<td style="text-align: left;">65.0%</td>
<td style="text-align: left;">$110,685</td>
</tr>
<tr class="even">
<td style="text-align: left;">High budget, low utilisation</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Murrumbidgee</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">5</td>
<td style="text-align: left;">332</td>
<td style="text-align: left;">$37,025,000</td>
<td style="text-align: left;">62.0%</td>
<td style="text-align: left;">$117,062</td>
</tr>
<tr class="odd">
<td style="text-align: left;">High budget, low utilisation</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">North Sydney</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">4</td>
<td style="text-align: left;">319</td>
<td style="text-align: left;">$47,653,000</td>
<td style="text-align: left;">64.5%</td>
<td style="text-align: left;">$143,835</td>
</tr>
<tr class="even">
<td style="text-align: left;">High budget, low utilisation</td>
<td style="text-align: left;">SA</td>
<td style="text-align: left;">Southern Adelaide</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">3</td>
<td style="text-align: left;">221</td>
<td style="text-align: left;">$30,030,000</td>
<td style="text-align: left;">62.0%</td>
<td style="text-align: left;">$130,688</td>
</tr>
<tr class="odd">
<td style="text-align: left;">High budget, low utilisation</td>
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Inner East Melbourne</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">4</td>
<td style="text-align: left;">220</td>
<td style="text-align: left;">$26,553,000</td>
<td style="text-align: left;">60.5%</td>
<td style="text-align: left;">$100,802</td>
</tr>
<tr class="even">
<td style="text-align: left;">High payment, moderate budget</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Hunter New England</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">2</td>
<td style="text-align: left;">768</td>
<td style="text-align: left;">$83,485,000</td>
<td style="text-align: left;">83.0%</td>
<td style="text-align: left;">$108,090</td>
</tr>
<tr class="odd">
<td style="text-align: left;">High payment, moderate budget</td>
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Bayside Peninsula</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">1</td>
<td style="text-align: left;">463</td>
<td style="text-align: left;">$48,582,000</td>
<td style="text-align: left;">84.0%</td>
<td style="text-align: left;">$107,482</td>
</tr>
<tr class="even">
<td style="text-align: left;">High payment, moderate budget</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Nepean Blue Mountains</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">3</td>
<td style="text-align: left;">416</td>
<td style="text-align: left;">$43,775,000</td>
<td style="text-align: left;">81.0%</td>
<td style="text-align: left;">$107,688</td>
</tr>
<tr class="odd">
<td style="text-align: left;">High payment, moderate budget</td>
<td style="text-align: left;">QLD</td>
<td style="text-align: left;">Beenleigh</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">3</td>
<td style="text-align: left;">378</td>
<td style="text-align: left;">$39,623,000</td>
<td style="text-align: left;">69.0%</td>
<td style="text-align: left;">$108,160</td>
</tr>
<tr class="even">
<td style="text-align: left;">High payment, moderate budget</td>
<td style="text-align: left;">WA</td>
<td style="text-align: left;">South East Metro</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">2</td>
<td style="text-align: left;">339</td>
<td style="text-align: left;">$35,984,000</td>
<td style="text-align: left;">76.0%</td>
<td style="text-align: left;">$110,640</td>
</tr>
<tr class="odd">
<td style="text-align: left;">High utilisation, high payment</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">South Western Sydney</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">41</td>
<td style="text-align: left;">8,489</td>
<td style="text-align: left;">$1,216,462,000</td>
<td style="text-align: left;">89.0%</td>
<td style="text-align: left;">$152,151</td>
</tr>
<tr class="even">
<td style="text-align: left;">High utilisation, high payment</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Western Sydney</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">32</td>
<td style="text-align: left;">4,943</td>
<td style="text-align: left;">$781,416,000</td>
<td style="text-align: left;">89.5%</td>
<td style="text-align: left;">$173,531</td>
</tr>
<tr class="odd">
<td style="text-align: left;">High utilisation, high payment</td>
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Hunter New England</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">14</td>
<td style="text-align: left;">2,784</td>
<td style="text-align: left;">$447,264,000</td>
<td style="text-align: left;">90.0%</td>
<td style="text-align: left;">$185,507</td>
</tr>
<tr class="even">
<td style="text-align: left;">High utilisation, high payment</td>
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Southern Melbourne</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">25</td>
<td style="text-align: left;">2,619</td>
<td style="text-align: left;">$403,094,000</td>
<td style="text-align: left;">90.0%</td>
<td style="text-align: left;">$170,656</td>
</tr>
<tr class="odd">
<td style="text-align: left;">High utilisation, high payment</td>
<td style="text-align: left;">SA</td>
<td style="text-align: left;">Northern Adelaide</td>
<td style="text-align: left;">Core</td>
<td style="text-align: right;">22</td>
<td style="text-align: left;">2,402</td>
<td style="text-align: left;">$392,635,000</td>
<td style="text-align: left;">88.0%</td>
<td style="text-align: left;">$168,278</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Appendix: provider market context">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-6-contents" aria-controls="callout-6" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Appendix: provider market context
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-6" class="callout-6-contents callout-collapse collapse">
<section id="provider-market-context" class="level2 callout-body-container callout-body">
<h2 class="anchored" data-anchor-id="provider-market-context">Provider Market Context</h2>
<p>Provider-market context is one of the few public levers that can plausibly help explain utilisation. The measures below are deliberately rough. <code>participants_per_provider</code> is a demand-pressure proxy, while <code>payment_share_top10</code> is a concentration proxy. Neither measures provider quality, available hours, wait time, travel burden or workforce depth.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb32" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb32-1">latest_model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb32-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(support_class) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb32-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb32-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grouped_cells =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(),</span>
<span id="cb32-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb32-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(utilisation_rate),</span>
<span id="cb32-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(participants_per_provider),</span>
<span id="cb32-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(payment_share_top10),</span>
<span id="cb32-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(payment_per_participant),</span>
<span id="cb32-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb32-11">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb32-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb32-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participants),</span>
<span id="cb32-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(median_utilisation, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb32-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(median_participants_per_provider, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb32-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(median_payment_share_top10, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb32-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(median_payment_per_participant, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb32-18">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb32-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 9%">
<col style="width: 9%">
<col style="width: 8%">
<col style="width: 12%">
<col style="width: 21%">
<col style="width: 17%">
<col style="width: 20%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">support_class</th>
<th style="text-align: right;">grouped_cells</th>
<th style="text-align: left;">participants</th>
<th style="text-align: left;">median_utilisation</th>
<th style="text-align: left;">median_participants_per_provider</th>
<th style="text-align: left;">median_payment_share_top10</th>
<th style="text-align: left;">median_payment_per_participant</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Capital</td>
<td style="text-align: right;">2475</td>
<td style="text-align: left;">94,295</td>
<td style="text-align: left;">72.0%</td>
<td style="text-align: left;">1.5</td>
<td style="text-align: left;">76.0%</td>
<td style="text-align: left;">$15,870</td>
</tr>
<tr class="even">
<td style="text-align: left;">Core</td>
<td style="text-align: right;">5504</td>
<td style="text-align: left;">521,695</td>
<td style="text-align: left;">78.0%</td>
<td style="text-align: left;">1.1</td>
<td style="text-align: left;">29.0%</td>
<td style="text-align: left;">$77,362</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb33" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb33-1">provider_quadrant_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> latest_model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb33-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(participants_per_provider), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(payment_share_top10)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb33-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb33-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">provider_pressure =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(participants_per_provider <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(participants_per_provider), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"High provider pressure"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Low provider pressure"</span>),</span>
<span id="cb33-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">concentration =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(payment_share_top10 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(payment_share_top10), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"High concentration"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Low concentration"</span>),</span>
<span id="cb33-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">quadrant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(provider_pressure, concentration, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sep =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" / "</span>)</span>
<span id="cb33-7">  )</span>
<span id="cb33-8"></span>
<span id="cb33-9">provider_quadrant_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb33-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quadrant) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb33-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb33-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_districts =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(service_district),</span>
<span id="cb33-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grouped_cells =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(),</span>
<span id="cb33-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb33-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(utilisation_rate),</span>
<span id="cb33-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(payment_per_participant),</span>
<span id="cb33-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(payment_share_top10),</span>
<span id="cb33-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb33-19">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb33-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb33-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participants),</span>
<span id="cb33-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(median_utilisation, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb33-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(median_payment_per_participant, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb33-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(median_payment_share_top10, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb33-25">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb33-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 26%">
<col style="width: 10%">
<col style="width: 8%">
<col style="width: 7%">
<col style="width: 11%">
<col style="width: 18%">
<col style="width: 16%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">quadrant</th>
<th style="text-align: right;">service_districts</th>
<th style="text-align: right;">grouped_cells</th>
<th style="text-align: left;">participants</th>
<th style="text-align: left;">median_utilisation</th>
<th style="text-align: left;">median_payment_per_participant</th>
<th style="text-align: left;">median_payment_share_top10</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">High provider pressure / High concentration</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">43</td>
<td style="text-align: left;">5,630</td>
<td style="text-align: left;">70.0%</td>
<td style="text-align: left;">$22,174</td>
<td style="text-align: left;">29.0%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Low provider pressure / High concentration</td>
<td style="text-align: right;">1</td>
<td style="text-align: right;">43</td>
<td style="text-align: left;">2,509</td>
<td style="text-align: left;">80.0%</td>
<td style="text-align: left;">$108,350</td>
<td style="text-align: left;">29.0%</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>
</div>
</section>
<section id="sil-and-sda-baseline" class="level2">
<h2 class="anchored" data-anchor-id="sil-and-sda-baseline">SIL and SDA Baseline</h2>
<p>The utilisation extract includes a <code>SILorSDA</code> field. That makes it possible to set a pre-reform descriptive baseline before mandatory registration for supported independent living and platform providers begins on <a href="https://www.ndiscommission.gov.au/about-us/ndis-commission-reform-hub/mandatory-registration">1 July 2026</a>. This is not an evaluation of that change; it is a baseline view of utilisation patterns before the reform takes effect.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb34" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb34-1">sil_sda_utilisation <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> utilisation <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb34-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(sil_or_sda), sil_or_sda <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>, support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb34-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_date, sil_or_sda, support_class) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb34-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(utilisation_rate), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rows =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>)</span>
<span id="cb34-5"></span>
<span id="cb34-6">sil_sda_utilisation <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb34-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(quarter_date, utilisation, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> sil_or_sda)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb34-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb34-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb34-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> support_class) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb34-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb34-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average utilisation"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SIL/SDA flag"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/sil-sda-utilisation-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb35" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb35-1">sil_sda_payment_items <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> payments_item <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb35-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_detect</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_to_lower</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(support_category, support_item_desc)), <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"supported independent living|</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">bsil</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">b|specialist disability accommodation|</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">bsda</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">b"</span>))</span>
<span id="cb35-3"></span>
<span id="cb35-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(sil_sda_payment_items) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb35-5">  sil_sda_payment_items <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb35-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(quarter_date, support_class, support_category) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb35-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(payment_participants, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb35-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(payment_amount)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb35-9">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb35-10">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_amount =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_amount, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb35-11">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participants)</span>
<span id="cb35-12">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb35-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb35-14">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb35-15">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb35-16">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No payment item descriptions matched SIL/SDA keywords in the national item-level extract."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb35-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb35-18">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 100%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">note</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">No payment item descriptions matched SIL/SDA keywords in the national item-level extract.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Appendix: regional context and join quality">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-7-contents" aria-controls="callout-7" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Appendix: regional context and join quality
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-7" class="callout-7-contents callout-collapse collapse">
<section id="regional-context-and-join-quality" class="level2 callout-body-container callout-body">
<h2 class="anchored" data-anchor-id="regional-context-and-join-quality">Regional Context and Join Quality</h2>
<p>The regional layer is deliberately conservative. It uses the NDIS service-district-to-LGA mapping, then joins ABS LGA SEIFA, age-structure, population, and remoteness allocation files where the source workbooks resolve cleanly. Remoteness is allocated from ABS mesh-block and SA1 correspondence files up to LGA, then aggregated to service districts with population weights. The table below keeps the join quality visible so the model does not quietly imply more geographic precision than the data supports.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb36" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb36-1">join_diagnostics <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb36-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">coverage =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(coverage, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb36-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 56%">
<col style="width: 18%">
<col style="width: 14%">
<col style="width: 10%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">check</th>
<th style="text-align: right;">rows_or_groups</th>
<th style="text-align: right;">denominator</th>
<th style="text-align: left;">coverage</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Budget rows with utilisation</td>
<td style="text-align: right;">62709</td>
<td style="text-align: right;">105041</td>
<td style="text-align: left;">59.7%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Budget rows with active providers</td>
<td style="text-align: right;">61506</td>
<td style="text-align: right;">105041</td>
<td style="text-align: left;">58.6%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Budget rows with grouped payments</td>
<td style="text-align: right;">63823</td>
<td style="text-align: right;">105041</td>
<td style="text-align: left;">60.8%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Budget rows with market concentration</td>
<td style="text-align: right;">1112</td>
<td style="text-align: right;">105041</td>
<td style="text-align: left;">1.1%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Service districts with LGA mapping</td>
<td style="text-align: right;">80</td>
<td style="text-align: right;">84</td>
<td style="text-align: left;">95.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Service districts with ABS SEIFA/age context</td>
<td style="text-align: right;">80</td>
<td style="text-align: right;">84</td>
<td style="text-align: left;">95.2%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Service districts with remoteness context</td>
<td style="text-align: right;">80</td>
<td style="text-align: right;">84</td>
<td style="text-align: left;">95.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Service districts with LGA participant context</td>
<td style="text-align: right;">80</td>
<td style="text-align: right;">84</td>
<td style="text-align: left;">95.2%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb37" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb37-1">model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb37-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb37-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(state, service_district) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb37-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb37-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb37-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(avg_support_budget, participant_count),</span>
<span id="cb37-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(utilisation_rate, participant_count),</span>
<span id="cb37-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(payment_per_participant, participant_count),</span>
<span id="cb37-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(participants_per_provider, participant_count),</span>
<span id="cb37-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(payment_share_top10),</span>
<span id="cb37-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mode_character</span>(remoteness),</span>
<span id="cb37-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(irsd_decile),</span>
<span id="cb37-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_age =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(median_age),</span>
<span id="cb37-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(pct_65_plus),</span>
<span id="cb37-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mapped_lgas =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(mapped_lgas, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb37-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb37-17">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb37-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(participants)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb37-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb37-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb37-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participants),</span>
<span id="cb37-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(avg_budget, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb37-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(utilisation, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb37-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_per_participant, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb37-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(participants_per_provider, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb37-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(payment_share_top10, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb37-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(irsd_decile, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb37-28">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_age =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(median_age, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb37-29">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(pct_65_plus, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">suffix =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"%"</span>),</span>
<span id="cb37-30">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mapped_lgas =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(mapped_lgas)</span>
<span id="cb37-31">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb37-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 2%">
<col style="width: 10%">
<col style="width: 6%">
<col style="width: 5%">
<col style="width: 5%">
<col style="width: 11%">
<col style="width: 12%">
<col style="width: 9%">
<col style="width: 12%">
<col style="width: 5%">
<col style="width: 5%">
<col style="width: 5%">
<col style="width: 5%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">state</th>
<th style="text-align: left;">service_district</th>
<th style="text-align: left;">participants</th>
<th style="text-align: left;">avg_budget</th>
<th style="text-align: left;">utilisation</th>
<th style="text-align: left;">payment_per_participant</th>
<th style="text-align: left;">participants_per_provider</th>
<th style="text-align: left;">payment_share_top10</th>
<th style="text-align: left;">remoteness</th>
<th style="text-align: left;">irsd_decile</th>
<th style="text-align: left;">median_age</th>
<th style="text-align: left;">pct_65_plus</th>
<th style="text-align: left;">mapped_lgas</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Hunter New England</td>
<td style="text-align: left;">67,783</td>
<td style="text-align: left;">$44,696</td>
<td style="text-align: left;">78.1%</td>
<td style="text-align: left;">$60,500</td>
<td style="text-align: left;">6.8</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Outer Regional Australia</td>
<td style="text-align: left;">5.7</td>
<td style="text-align: left;">41.3</td>
<td style="text-align: left;">20.6%</td>
<td style="text-align: left;">22</td>
</tr>
<tr class="even">
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">South Western Sydney</td>
<td style="text-align: left;">65,541</td>
<td style="text-align: left;">$45,184</td>
<td style="text-align: left;">85.5%</td>
<td style="text-align: left;">$67,085</td>
<td style="text-align: left;">9.3</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">3.5</td>
<td style="text-align: left;">36.4</td>
<td style="text-align: left;">14.1%</td>
<td style="text-align: left;">7</td>
</tr>
<tr class="odd">
<td style="text-align: left;">QLD</td>
<td style="text-align: left;">Brisbane</td>
<td style="text-align: left;">53,192</td>
<td style="text-align: left;">$46,187</td>
<td style="text-align: left;">75.8%</td>
<td style="text-align: left;">$58,075</td>
<td style="text-align: left;">17.5</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">9.0</td>
<td style="text-align: left;">35.9</td>
<td style="text-align: left;">13.2%</td>
<td style="text-align: left;">1</td>
</tr>
<tr class="even">
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Western Sydney</td>
<td style="text-align: left;">49,424</td>
<td style="text-align: left;">$46,861</td>
<td style="text-align: left;">85.1%</td>
<td style="text-align: left;">$69,767</td>
<td style="text-align: left;">8.6</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">6.5</td>
<td style="text-align: left;">35.2</td>
<td style="text-align: left;">12.0%</td>
<td style="text-align: left;">4</td>
</tr>
<tr class="odd">
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Bayside Peninsula</td>
<td style="text-align: left;">43,744</td>
<td style="text-align: left;">$42,201</td>
<td style="text-align: left;">77.1%</td>
<td style="text-align: left;">$52,385</td>
<td style="text-align: left;">15.5</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">9.2</td>
<td style="text-align: left;">41.2</td>
<td style="text-align: left;">18.6%</td>
<td style="text-align: left;">7</td>
</tr>
<tr class="even">
<td style="text-align: left;">SA</td>
<td style="text-align: left;">Northern Adelaide</td>
<td style="text-align: left;">41,658</td>
<td style="text-align: left;">$43,685</td>
<td style="text-align: left;">75.6%</td>
<td style="text-align: left;">$59,811</td>
<td style="text-align: left;">48.5</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">3.8</td>
<td style="text-align: left;">37.1</td>
<td style="text-align: left;">15.6%</td>
<td style="text-align: left;">4</td>
</tr>
<tr class="odd">
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Southern Melbourne</td>
<td style="text-align: left;">36,206</td>
<td style="text-align: left;">$42,944</td>
<td style="text-align: left;">82.0%</td>
<td style="text-align: left;">$61,780</td>
<td style="text-align: left;">14.6</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">6.0</td>
<td style="text-align: left;">34.7</td>
<td style="text-align: left;">12.0%</td>
<td style="text-align: left;">3</td>
</tr>
<tr class="even">
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Western Melbourne</td>
<td style="text-align: left;">34,330</td>
<td style="text-align: left;">$40,186</td>
<td style="text-align: left;">79.7%</td>
<td style="text-align: left;">$51,890</td>
<td style="text-align: left;">17.8</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">8.2</td>
<td style="text-align: left;">34.4</td>
<td style="text-align: left;">10.3%</td>
<td style="text-align: left;">5</td>
</tr>
<tr class="odd">
<td style="text-align: left;">QLD</td>
<td style="text-align: left;">Beenleigh</td>
<td style="text-align: left;">33,961</td>
<td style="text-align: left;">$44,387</td>
<td style="text-align: left;">76.4%</td>
<td style="text-align: left;">$59,177</td>
<td style="text-align: left;">19.2</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">4.6</td>
<td style="text-align: left;">37.2</td>
<td style="text-align: left;">15.3%</td>
<td style="text-align: left;">2</td>
</tr>
<tr class="even">
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">North East Melbourne</td>
<td style="text-align: left;">33,581</td>
<td style="text-align: left;">$44,364</td>
<td style="text-align: left;">80.0%</td>
<td style="text-align: left;">$58,280</td>
<td style="text-align: left;">11.6</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">8.0</td>
<td style="text-align: left;">37.3</td>
<td style="text-align: left;">14.3%</td>
<td style="text-align: left;">5</td>
</tr>
<tr class="odd">
<td style="text-align: left;">QLD</td>
<td style="text-align: left;">Caboolture/Strathpine</td>
<td style="text-align: left;">32,442</td>
<td style="text-align: left;">$43,681</td>
<td style="text-align: left;">76.7%</td>
<td style="text-align: left;">$56,970</td>
<td style="text-align: left;">16.2</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">7.0</td>
<td style="text-align: left;">39.0</td>
<td style="text-align: left;">17.3%</td>
<td style="text-align: left;">1</td>
</tr>
<tr class="even">
<td style="text-align: left;">QLD</td>
<td style="text-align: left;">Robina</td>
<td style="text-align: left;">29,218</td>
<td style="text-align: left;">$44,825</td>
<td style="text-align: left;">77.1%</td>
<td style="text-align: left;">$59,060</td>
<td style="text-align: left;">13.8</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">8.0</td>
<td style="text-align: left;">39.2</td>
<td style="text-align: left;">17.3%</td>
<td style="text-align: left;">1</td>
</tr>
<tr class="odd">
<td style="text-align: left;">SA</td>
<td style="text-align: left;">Southern Adelaide</td>
<td style="text-align: left;">26,816</td>
<td style="text-align: left;">$43,756</td>
<td style="text-align: left;">72.1%</td>
<td style="text-align: left;">$54,782</td>
<td style="text-align: left;">28.4</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">7.5</td>
<td style="text-align: left;">41.5</td>
<td style="text-align: left;">20.1%</td>
<td style="text-align: left;">4</td>
</tr>
<tr class="even">
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Brimbank Melton</td>
<td style="text-align: left;">26,518</td>
<td style="text-align: left;">$36,866</td>
<td style="text-align: left;">79.1%</td>
<td style="text-align: left;">$48,447</td>
<td style="text-align: left;">37.2</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">3.9</td>
<td style="text-align: left;">35.4</td>
<td style="text-align: left;">12.5%</td>
<td style="text-align: left;">2</td>
</tr>
<tr class="odd">
<td style="text-align: left;">QLD</td>
<td style="text-align: left;">Maroochydore</td>
<td style="text-align: left;">26,333</td>
<td style="text-align: left;">$44,352</td>
<td style="text-align: left;">75.8%</td>
<td style="text-align: left;">$55,140</td>
<td style="text-align: left;">12.5</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Inner Regional Australia</td>
<td style="text-align: left;">7.5</td>
<td style="text-align: left;">44.6</td>
<td style="text-align: left;">22.4%</td>
<td style="text-align: left;">3</td>
</tr>
<tr class="even">
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">North Sydney</td>
<td style="text-align: left;">25,978</td>
<td style="text-align: left;">$49,891</td>
<td style="text-align: left;">80.9%</td>
<td style="text-align: left;">$72,548</td>
<td style="text-align: left;">2.6</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">10.0</td>
<td style="text-align: left;">40.6</td>
<td style="text-align: left;">17.2%</td>
<td style="text-align: left;">9</td>
</tr>
<tr class="odd">
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Barwon</td>
<td style="text-align: left;">25,904</td>
<td style="text-align: left;">$38,949</td>
<td style="text-align: left;">71.4%</td>
<td style="text-align: left;">$46,723</td>
<td style="text-align: left;">13.8</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Inner Regional Australia</td>
<td style="text-align: left;">8.0</td>
<td style="text-align: left;">40.2</td>
<td style="text-align: left;">19.7%</td>
<td style="text-align: left;">4</td>
</tr>
<tr class="even">
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">South Eastern Sydney</td>
<td style="text-align: left;">25,679</td>
<td style="text-align: left;">$47,941</td>
<td style="text-align: left;">81.1%</td>
<td style="text-align: left;">$66,487</td>
<td style="text-align: left;">3.3</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">9.0</td>
<td style="text-align: left;">38.2</td>
<td style="text-align: left;">16.4%</td>
<td style="text-align: left;">6</td>
</tr>
<tr class="odd">
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Outer East Melbourne</td>
<td style="text-align: left;">25,171</td>
<td style="text-align: left;">$39,244</td>
<td style="text-align: left;">75.6%</td>
<td style="text-align: left;">$49,929</td>
<td style="text-align: left;">10.2</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">9.0</td>
<td style="text-align: left;">40.0</td>
<td style="text-align: left;">17.2%</td>
<td style="text-align: left;">3</td>
</tr>
<tr class="even">
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Illawarra Shoalhaven</td>
<td style="text-align: left;">24,407</td>
<td style="text-align: left;">$43,976</td>
<td style="text-align: left;">79.7%</td>
<td style="text-align: left;">$58,256</td>
<td style="text-align: left;">4.1</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">Inner Regional Australia</td>
<td style="text-align: left;">6.7</td>
<td style="text-align: left;">41.9</td>
<td style="text-align: left;">20.9%</td>
<td style="text-align: left;">4</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb38" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb38-1">latest_service_geo <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb38-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb38-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(state, service_district) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb38-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb38-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb38-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(avg_support_budget, participant_count),</span>
<span id="cb38-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(utilisation_rate, participant_count),</span>
<span id="cb38-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(payment_per_participant, participant_count),</span>
<span id="cb38-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(participants_per_provider, participant_count),</span>
<span id="cb38-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(payment_share_top10),</span>
<span id="cb38-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">remoteness =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mode_character</span>(remoteness),</span>
<span id="cb38-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mapped_lgas =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(mapped_lgas, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb38-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">example_lgas =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mode_character</span>(mapped_lga_names),</span>
<span id="cb38-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(irsd_decile),</span>
<span id="cb38-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_age =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(median_age),</span>
<span id="cb38-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(pct_65_plus),</span>
<span id="cb38-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb38-18">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb38-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb38-20">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mapped_lgas =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.infinite</span>(mapped_lgas), <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(mapped_lgas)),</span>
<span id="cb38-21">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participant_rank =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent_rank</span>(participants),</span>
<span id="cb38-22">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">budget_rank =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent_rank</span>(avg_budget),</span>
<span id="cb38-23">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_rank =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent_rank</span>(payment_per_participant),</span>
<span id="cb38-24">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation_rank =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent_rank</span>(utilisation),</span>
<span id="cb38-25">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">provider_pressure_rank =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent_rank</span>(participants_per_provider),</span>
<span id="cb38-26">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">concentration_rank =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent_rank</span>(payment_share_top10),</span>
<span id="cb38-27">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geography_pressure_score =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rowMeans</span>(</span>
<span id="cb38-28">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cbind</span>(payment_rank, utilisation_rank, provider_pressure_rank, concentration_rank),</span>
<span id="cb38-29">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb38-30">    ),</span>
<span id="cb38-31">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">geography_pressure_score =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">if_else</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.nan</span>(geography_pressure_score), <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NA_real_</span>, geography_pressure_score)</span>
<span id="cb38-32">  )</span>
<span id="cb38-33"></span>
<span id="cb38-34"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(latest_service_geo) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb38-35">  latest_service_geo <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb38-36">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(geography_pressure_score), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(participants)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb38-37">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb38-38">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">transmute</span>(</span>
<span id="cb38-39">      state,</span>
<span id="cb38-40">      service_district,</span>
<span id="cb38-41">      remoteness,</span>
<span id="cb38-42">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mapped_lgas =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(mapped_lgas),</span>
<span id="cb38-43">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participants),</span>
<span id="cb38-44">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(avg_budget, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb38-45">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(utilisation, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb38-46">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_per_participant, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb38-47">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(participants_per_provider, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb38-48">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(payment_share_top10, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb38-49">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(irsd_decile, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb38-50">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb38-51">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb38-52">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb38-53">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No latest-quarter service-district geography profile could be built."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb38-54">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb38-55">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 3%">
<col style="width: 12%">
<col style="width: 13%">
<col style="width: 6%">
<col style="width: 7%">
<col style="width: 6%">
<col style="width: 6%">
<col style="width: 13%">
<col style="width: 14%">
<col style="width: 10%">
<col style="width: 6%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">state</th>
<th style="text-align: left;">service_district</th>
<th style="text-align: left;">remoteness</th>
<th style="text-align: left;">mapped_lgas</th>
<th style="text-align: left;">participants</th>
<th style="text-align: left;">avg_budget</th>
<th style="text-align: left;">utilisation</th>
<th style="text-align: left;">payment_per_participant</th>
<th style="text-align: left;">participants_per_provider</th>
<th style="text-align: left;">payment_share_top10</th>
<th style="text-align: left;">irsd_decile</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">NT</td>
<td style="text-align: left;">Darwin Urban</td>
<td style="text-align: left;">Outer Regional Australia</td>
<td style="text-align: left;">6</td>
<td style="text-align: left;">4,793</td>
<td style="text-align: left;">$56,479</td>
<td style="text-align: left;">81.2%</td>
<td style="text-align: left;">$95,172</td>
<td style="text-align: left;">97.5</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">8.7</td>
</tr>
<tr class="even">
<td style="text-align: left;">NT</td>
<td style="text-align: left;">Central Australia</td>
<td style="text-align: left;">Very Remote Australia</td>
<td style="text-align: left;">3</td>
<td style="text-align: left;">1,181</td>
<td style="text-align: left;">$116,076</td>
<td style="text-align: left;">83.4%</td>
<td style="text-align: left;">$206,752</td>
<td style="text-align: left;">5.9</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">5.4</td>
</tr>
<tr class="odd">
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Southern Melbourne</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">3</td>
<td style="text-align: left;">36,206</td>
<td style="text-align: left;">$42,944</td>
<td style="text-align: left;">82.0%</td>
<td style="text-align: left;">$61,780</td>
<td style="text-align: left;">14.6</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">6.0</td>
</tr>
<tr class="even">
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">South Western Sydney</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">7</td>
<td style="text-align: left;">65,541</td>
<td style="text-align: left;">$45,184</td>
<td style="text-align: left;">85.5%</td>
<td style="text-align: left;">$67,085</td>
<td style="text-align: left;">9.3</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">3.5</td>
</tr>
<tr class="odd">
<td style="text-align: left;">NSW</td>
<td style="text-align: left;">Western Sydney</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">4</td>
<td style="text-align: left;">49,424</td>
<td style="text-align: left;">$46,861</td>
<td style="text-align: left;">85.1%</td>
<td style="text-align: left;">$69,767</td>
<td style="text-align: left;">8.6</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">6.5</td>
</tr>
<tr class="even">
<td style="text-align: left;">QLD</td>
<td style="text-align: left;">Beenleigh</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">2</td>
<td style="text-align: left;">33,961</td>
<td style="text-align: left;">$44,387</td>
<td style="text-align: left;">76.4%</td>
<td style="text-align: left;">$59,177</td>
<td style="text-align: left;">19.2</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">4.6</td>
</tr>
<tr class="odd">
<td style="text-align: left;">SA</td>
<td style="text-align: left;">Northern Adelaide</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">4</td>
<td style="text-align: left;">41,658</td>
<td style="text-align: left;">$43,685</td>
<td style="text-align: left;">75.6%</td>
<td style="text-align: left;">$59,811</td>
<td style="text-align: left;">48.5</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">3.8</td>
</tr>
<tr class="even">
<td style="text-align: left;">QLD</td>
<td style="text-align: left;">Robina</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">29,218</td>
<td style="text-align: left;">$44,825</td>
<td style="text-align: left;">77.1%</td>
<td style="text-align: left;">$59,060</td>
<td style="text-align: left;">13.8</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">8.0</td>
</tr>
<tr class="odd">
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">North East Melbourne</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">5</td>
<td style="text-align: left;">33,581</td>
<td style="text-align: left;">$44,364</td>
<td style="text-align: left;">80.0%</td>
<td style="text-align: left;">$58,280</td>
<td style="text-align: left;">11.6</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">8.0</td>
</tr>
<tr class="even">
<td style="text-align: left;">QLD</td>
<td style="text-align: left;">Caboolture/Strathpine</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">32,442</td>
<td style="text-align: left;">$43,681</td>
<td style="text-align: left;">76.7%</td>
<td style="text-align: left;">$56,970</td>
<td style="text-align: left;">16.2</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">7.0</td>
</tr>
<tr class="odd">
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Hume Moreland</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">2</td>
<td style="text-align: left;">23,331</td>
<td style="text-align: left;">$40,516</td>
<td style="text-align: left;">82.6%</td>
<td style="text-align: left;">$55,848</td>
<td style="text-align: left;">11.2</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">5.1</td>
</tr>
<tr class="even">
<td style="text-align: left;">QLD</td>
<td style="text-align: left;">Brisbane</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">1</td>
<td style="text-align: left;">53,192</td>
<td style="text-align: left;">$46,187</td>
<td style="text-align: left;">75.8%</td>
<td style="text-align: left;">$58,075</td>
<td style="text-align: left;">17.5</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">9.0</td>
</tr>
<tr class="odd">
<td style="text-align: left;">VIC</td>
<td style="text-align: left;">Western Melbourne</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">5</td>
<td style="text-align: left;">34,330</td>
<td style="text-align: left;">$40,186</td>
<td style="text-align: left;">79.7%</td>
<td style="text-align: left;">$51,890</td>
<td style="text-align: left;">17.8</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">8.2</td>
</tr>
<tr class="even">
<td style="text-align: left;">SA</td>
<td style="text-align: left;">Eastern Adelaide</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">7</td>
<td style="text-align: left;">7,975</td>
<td style="text-align: left;">$47,136</td>
<td style="text-align: left;">75.3%</td>
<td style="text-align: left;">$68,222</td>
<td style="text-align: left;">8.7</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">9.0</td>
</tr>
<tr class="odd">
<td style="text-align: left;">WA</td>
<td style="text-align: left;">South East Metro</td>
<td style="text-align: left;">Major Cities</td>
<td style="text-align: left;">4</td>
<td style="text-align: left;">12,801</td>
<td style="text-align: left;">$54,248</td>
<td style="text-align: left;">75.9%</td>
<td style="text-align: left;">$67,261</td>
<td style="text-align: left;">6.7</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">6.6</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb39" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb39-1">remoteness_profile <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> latest_service_geo <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb39-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(remoteness))</span>
<span id="cb39-3"></span>
<span id="cb39-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(remoteness_profile) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb39-5">  remoteness_profile <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb39-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(remoteness) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb39-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb39-8">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_districts =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(service_district),</span>
<span id="cb39-9">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participants, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb39-10">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(avg_budget, participants),</span>
<span id="cb39-11">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(utilisation, participants),</span>
<span id="cb39-12">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(payment_per_participant, participants),</span>
<span id="cb39-13">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(participants_per_provider, participants),</span>
<span id="cb39-14">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(payment_share_top10),</span>
<span id="cb39-15">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_irsd_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(irsd_decile),</span>
<span id="cb39-16">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb39-17">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb39-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(median_irsd_decile, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(participants)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb39-19">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb39-20">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participants),</span>
<span id="cb39-21">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(avg_budget, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb39-22">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(utilisation, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb39-23">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_per_participant, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb39-24">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(participants_per_provider, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb39-25">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(payment_share_top10, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb39-26">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_irsd_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(median_irsd_decile, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb39-27">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb39-28">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb39-29">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb39-30">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Remoteness was not available in the downloaded LGA mapping or participants-by-LGA file for this render."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb39-31">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb39-32">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 14%">
<col style="width: 10%">
<col style="width: 7%">
<col style="width: 6%">
<col style="width: 7%">
<col style="width: 14%">
<col style="width: 15%">
<col style="width: 11%">
<col style="width: 11%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">remoteness</th>
<th style="text-align: right;">service_districts</th>
<th style="text-align: left;">participants</th>
<th style="text-align: left;">avg_budget</th>
<th style="text-align: left;">utilisation</th>
<th style="text-align: left;">payment_per_participant</th>
<th style="text-align: left;">participants_per_provider</th>
<th style="text-align: left;">payment_share_top10</th>
<th style="text-align: left;">median_irsd_decile</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Remote Australia</td>
<td style="text-align: right;">3</td>
<td style="text-align: left;">8,446</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">3.5</td>
</tr>
<tr class="even">
<td style="text-align: left;">Outer Regional Australia</td>
<td style="text-align: right;">17</td>
<td style="text-align: left;">155,850</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">4.8</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Very Remote Australia</td>
<td style="text-align: right;">9</td>
<td style="text-align: left;">65,617</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">5.1</td>
</tr>
<tr class="even">
<td style="text-align: left;">Inner Regional Australia</td>
<td style="text-align: right;">22</td>
<td style="text-align: left;">308,107</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">47.5%</td>
<td style="text-align: left;">6.6</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Major Cities</td>
<td style="text-align: right;">29</td>
<td style="text-align: left;">726,626</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">NA</td>
<td style="text-align: left;">7.3</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>
</div>
<div class="callout callout-style-default callout-note callout-titled" title="Appendix: richer geography context">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-8-contents" aria-controls="callout-8" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Appendix: richer geography context
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-8" class="callout-8-contents callout-collapse collapse">
<section id="richer-geography-context" class="level2 callout-body-container callout-body">
<h2 class="anchored" data-anchor-id="richer-geography-context">Richer Geography Context</h2>
<p>The richer geography layer adds two lenses: socioeconomic decile where the ABS join works, and support-class market concentration. Equity-specific signals are left out of this version so the main post stays focused on spend growth mechanics.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb40" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb40-1">seifa_summary <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb40-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(irsd_decile))</span>
<span id="cb40-3"></span>
<span id="cb40-4"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(seifa_summary) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb40-5">  seifa_summary <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb40-6">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(irsd_decile)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb40-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(irsd_decile) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb40-8">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb40-9">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>(participant_count, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>),</span>
<span id="cb40-10">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(avg_support_budget, participant_count),</span>
<span id="cb40-11">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(utilisation_rate, participant_count),</span>
<span id="cb40-12">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(payment_per_participant, participant_count),</span>
<span id="cb40-13">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_weighted_mean</span>(participants_per_provider, participant_count),</span>
<span id="cb40-14">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(payment_share_top10),</span>
<span id="cb40-15">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb40-16">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb40-17">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(irsd_decile) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb40-18">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb40-19">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">comma</span>(participants),</span>
<span id="cb40-20">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">avg_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(avg_budget, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb40-21">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(utilisation, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb40-22">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_per_participant =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dollar</span>(payment_per_participant, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb40-23">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">number</span>(participants_per_provider, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb40-24">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(payment_share_top10, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb40-25">    ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb40-26">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb40-27">} <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb40-28">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SEIFA was not joined in this render, so the SEIFA decile summary is skipped rather than showing an NA-heavy table."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb40-29">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span>
<span id="cb40-30">}</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 10%">
<col style="width: 11%">
<col style="width: 9%">
<col style="width: 10%">
<col style="width: 20%">
<col style="width: 22%">
<col style="width: 16%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: right;">irsd_decile</th>
<th style="text-align: left;">participants</th>
<th style="text-align: left;">avg_budget</th>
<th style="text-align: left;">utilisation</th>
<th style="text-align: left;">payment_per_participant</th>
<th style="text-align: left;">participants_per_provider</th>
<th style="text-align: left;">payment_share_top10</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: right;">1</td>
<td style="text-align: left;">971</td>
<td style="text-align: left;">$41,837</td>
<td style="text-align: left;">68.9%</td>
<td style="text-align: left;">$32,431</td>
<td style="text-align: left;">14.6</td>
<td style="text-align: left;">NA</td>
</tr>
<tr class="even">
<td style="text-align: right;">2</td>
<td style="text-align: left;">14,228</td>
<td style="text-align: left;">$48,098</td>
<td style="text-align: left;">75.7%</td>
<td style="text-align: left;">$66,012</td>
<td style="text-align: left;">2.4</td>
<td style="text-align: left;">NA</td>
</tr>
<tr class="odd">
<td style="text-align: right;">3</td>
<td style="text-align: left;">80,224</td>
<td style="text-align: left;">$44,776</td>
<td style="text-align: left;">82.9%</td>
<td style="text-align: left;">$65,833</td>
<td style="text-align: left;">8.6</td>
<td style="text-align: left;">NA</td>
</tr>
<tr class="even">
<td style="text-align: right;">4</td>
<td style="text-align: left;">104,874</td>
<td style="text-align: left;">$42,036</td>
<td style="text-align: left;">76.3%</td>
<td style="text-align: left;">$56,692</td>
<td style="text-align: left;">32.6</td>
<td style="text-align: left;">NA</td>
</tr>
<tr class="odd">
<td style="text-align: right;">5</td>
<td style="text-align: left;">177,249</td>
<td style="text-align: left;">$44,154</td>
<td style="text-align: left;">74.9%</td>
<td style="text-align: left;">$58,817</td>
<td style="text-align: left;">8.4</td>
<td style="text-align: left;">NA</td>
</tr>
<tr class="even">
<td style="text-align: right;">6</td>
<td style="text-align: left;">197,676</td>
<td style="text-align: left;">$42,288</td>
<td style="text-align: left;">75.6%</td>
<td style="text-align: left;">$57,515</td>
<td style="text-align: left;">12.3</td>
<td style="text-align: left;">NA</td>
</tr>
<tr class="odd">
<td style="text-align: right;">7</td>
<td style="text-align: left;">201,112</td>
<td style="text-align: left;">$44,378</td>
<td style="text-align: left;">79.0%</td>
<td style="text-align: left;">$60,664</td>
<td style="text-align: left;">7.7</td>
<td style="text-align: left;">NA</td>
</tr>
<tr class="even">
<td style="text-align: right;">8</td>
<td style="text-align: left;">200,022</td>
<td style="text-align: left;">$42,906</td>
<td style="text-align: left;">76.0%</td>
<td style="text-align: left;">$54,773</td>
<td style="text-align: left;">15.1</td>
<td style="text-align: left;">NA</td>
</tr>
<tr class="odd">
<td style="text-align: right;">9</td>
<td style="text-align: left;">239,409</td>
<td style="text-align: left;">$44,985</td>
<td style="text-align: left;">76.1%</td>
<td style="text-align: left;">$58,183</td>
<td style="text-align: left;">12.2</td>
<td style="text-align: left;">NA</td>
</tr>
<tr class="even">
<td style="text-align: right;">10</td>
<td style="text-align: left;">48,881</td>
<td style="text-align: left;">$44,640</td>
<td style="text-align: left;">77.6%</td>
<td style="text-align: left;">$64,913</td>
<td style="text-align: left;">37.9</td>
<td style="text-align: left;">47.5%</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb41" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb41-1">market_concentration <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb41-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(market_quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(market_quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>), support_class <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ALL"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb41-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(support_class) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb41-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(</span>
<span id="cb41-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">service_districts =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(service_district),</span>
<span id="cb41-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_top10_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_median</span>(payment_share_top10),</span>
<span id="cb41-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">high_concentration_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">safe_mean</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(payment_share_top10 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>)),</span>
<span id="cb41-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">.groups =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"drop"</span></span>
<span id="cb41-9">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb41-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(median_top10_share)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb41-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb41-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_top10_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(median_top10_share, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>),</span>
<span id="cb41-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">high_concentration_share =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">percent</span>(high_concentration_share, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">accuracy =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.1</span>)</span>
<span id="cb41-14">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb41-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 22%">
<col style="width: 22%">
<col style="width: 23%">
<col style="width: 31%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">support_class</th>
<th style="text-align: right;">service_districts</th>
<th style="text-align: left;">median_top10_share</th>
<th style="text-align: left;">high_concentration_share</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Capital</td>
<td style="text-align: right;">88</td>
<td style="text-align: left;">62.0%</td>
<td style="text-align: left;">35.2%</td>
</tr>
<tr class="even">
<td style="text-align: left;">Core</td>
<td style="text-align: right;">89</td>
<td style="text-align: left;">34.0%</td>
<td style="text-align: left;">13.5%</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Capacity Building</td>
<td style="text-align: right;">89</td>
<td style="text-align: left;">23.0%</td>
<td style="text-align: left;">4.5%</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>
</div>
</section>
<section id="outcomes-spend-and-service-access" class="level2">
<h2 class="anchored" data-anchor-id="outcomes-spend-and-service-access">Outcomes, Spend and Service Access</h2>
<p>The outcomes analysis has been moved into a separate companion post: <a href="../ndis-outcomes-spend-service-access/">NDIS Outcomes, Spend and Service Access</a>. That page inspects the regional dashboard workbook schema directly, chooses a small set of high-value outcome families, and treats outcomes as possible investment channels rather than only as cost offsets.</p>
<div class="callout callout-style-default callout-note callout-titled" title="Appendix: average budget and utilisation model detail">
<div class="callout-header d-flex align-content-center collapsed" data-bs-toggle="collapse" data-bs-target=".callout-9-contents" aria-controls="callout-9" aria-expanded="false" aria-label="Toggle callout">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span>Appendix: average budget and utilisation model detail
</div>
<div class="callout-btn-toggle d-inline-block border-0 py-1 ps-1 pe-0 float-end"><i class="callout-toggle"></i></div>
</div>
<div id="callout-9" class="callout-9-contents callout-collapse collapse">
<div class="callout-body-container callout-body">
<section id="model-1-average-support-budget" class="level2">
<h2 class="anchored" data-anchor-id="model-1-average-support-budget">Model 1: Average Support Budget</h2>
<p>The first model asks whether grouped participant characteristics, region, support class, provider supply, and ABS context explain differences in average support budgets. The expanded model now carries through service district plus joined LGA-level SEIFA, age-structure and population measures where the joins succeed. The test period is the latest available quarter in the study window, so the model is judged on a future quarter rather than a random split.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb42" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb42-1">budget_model_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb42-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(avg_support_budget), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(participant_count), participant_count <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb42-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb42-4">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(state, service_district, age_group, disability_group, support_class, remoteness), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_na_value_to_level</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_lump_n</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.factor</span>(x), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">level =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Missing"</span>)),</span>
<span id="cb42-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(avg_support_budget),</span>
<span id="cb42-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(participant_count),</span>
<span id="cb42-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_providers =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(active_providers, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb42-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(participants_per_provider, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb42-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_lga_population =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(lga_population, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb42-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(payment_share_top10, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(payment_share_top10, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)),</span>
<span id="cb42-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(payment_share_top10) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.nan</span>(payment_share_top10), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, payment_share_top10),</span>
<span id="cb42-12">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(irsd_score, irsd_decile, ier_score, ier_decile, ieo_score, ieo_decile, median_age, pct_0_14, pct_15_64, pct_65_plus, remoteness_rank, remoteness_major_cities_share, remoteness_inner_regional_share, remoteness_outer_regional_share, remoteness_remote_share, remoteness_very_remote_share), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">replace_na</span>(x, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))),</span>
<span id="cb42-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(irsd_score, irsd_decile, ier_score, ier_decile, ieo_score, ieo_decile, median_age, pct_0_14, pct_15_64, pct_65_plus, remoteness_rank, remoteness_major_cities_share, remoteness_inner_regional_share, remoteness_outer_regional_share, remoteness_remote_share, remoteness_very_remote_share), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.nan</span>(x), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, x))</span>
<span id="cb42-14">  )</span>
<span id="cb42-15"></span>
<span id="cb42-16">test_quarter <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(budget_model_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb42-17">budget_train <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(budget_model_data, quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> test_quarter)</span>
<span id="cb42-18">budget_test <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(budget_model_data, quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> test_quarter)</span>
<span id="cb42-19"></span>
<span id="cb42-20">budget_baseline <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(log_budget <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> quarter_index <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> log_participants, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> budget_train)</span>
<span id="cb42-21"></span>
<span id="cb42-22">factor_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness"</span>)</span>
<span id="cb42-23">factor_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> factor_terms[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_int</span>(budget_train[factor_terms], \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb42-24">numeric_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_index"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_participants"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_providers"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_participants_per_provider"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"payment_share_top10"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"irsd_score"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"irsd_decile"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ier_score"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ier_decile"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ieo_score"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ieo_decile"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"median_age"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_0_14"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_15_64"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_65_plus"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_lga_population"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_rank"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_major_cities_share"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_inner_regional_share"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_outer_regional_share"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_remote_share"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_very_remote_share"</span>)</span>
<span id="cb42-25">numeric_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> numeric_terms[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_lgl</span>(budget_train[numeric_terms], \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">isTRUE</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sd</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))]</span>
<span id="cb42-26">budget_formula <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.formula</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_budget ~"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(numeric_terms, factor_terms), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" + "</span>)))</span>
<span id="cb42-27"></span>
<span id="cb42-28">budget_expanded <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(budget_formula, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> budget_train)</span>
<span id="cb42-29"></span>
<span id="cb42-30"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set.seed</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20260526</span>)</span>
<span id="cb42-31">budget_rf_train <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> budget_train <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb42-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">drop_na</span>(log_budget) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb42-33">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_sample</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">drop_na</span>(budget_train, log_budget)), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8000</span>))</span>
<span id="cb42-34"></span>
<span id="cb42-35">budget_rf <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">randomForest</span>(</span>
<span id="cb42-36">  budget_formula,</span>
<span id="cb42-37">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> budget_rf_train,</span>
<span id="cb42-38">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ntree =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>,</span>
<span id="cb42-39">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">importance =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb42-40">)</span>
<span id="cb42-41"></span>
<span id="cb42-42">score_regression <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(actual, predicted) {</span>
<span id="cb42-43">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb42-44">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rmse =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>((actual <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> predicted)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)),</span>
<span id="cb42-45">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">mae =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">abs</span>(actual <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> predicted), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb42-46">  )</span>
<span id="cb42-47">}</span>
<span id="cb42-48"></span>
<span id="cb42-49">partial_dependence_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(model, data, features, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">response_transform =</span> identity,</span>
<span id="cb42-50">                                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x_transforms =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">feature_labels =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>,</span>
<span id="cb42-51">                                    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">grid_n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">sample_n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1500</span>) {</span>
<span id="cb42-52">  pd_sample <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb42-53">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_sample</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(data), sample_n))</span>
<span id="cb42-54"></span>
<span id="cb42-55">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_dfr</span>(features, \(feature) {</span>
<span id="cb42-56">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span>feature <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">names</span>(pd_sample) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">||</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.numeric</span>(pd_sample[[feature]])) {</span>
<span id="cb42-57">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>())</span>
<span id="cb42-58">    }</span>
<span id="cb42-59"></span>
<span id="cb42-60">    x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pd_sample[[feature]]</span>
<span id="cb42-61">    x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.finite</span>(x)]</span>
<span id="cb42-62">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(x)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>())</span>
<span id="cb42-63"></span>
<span id="cb42-64">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(x)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> grid_n) {</span>
<span id="cb42-65">      grid <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(x))</span>
<span id="cb42-66">    } <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> {</span>
<span id="cb42-67">      grid <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">quantile</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">probs =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.02</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.98</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">length.out =</span> grid_n), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb42-68">      grid <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.numeric</span>(grid)))</span>
<span id="cb42-69">    }</span>
<span id="cb42-70"></span>
<span id="cb42-71">    x_transform <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> x_transforms[[feature]]</span>
<span id="cb42-72">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.null</span>(x_transform)) x_transform <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> identity</span>
<span id="cb42-73">    feature_label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> feature_labels[[feature]]</span>
<span id="cb42-74">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.null</span>(feature_label)) feature_label <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> feature</span>
<span id="cb42-75"></span>
<span id="cb42-76">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_dfr</span>(grid, \(value) {</span>
<span id="cb42-77">      newdata <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> pd_sample</span>
<span id="cb42-78">      newdata[[feature]] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> value</span>
<span id="cb42-79">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(</span>
<span id="cb42-80">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">feature =</span> feature,</span>
<span id="cb42-81">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">feature_label =</span> feature_label,</span>
<span id="cb42-82">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">feature_value =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">x_transform</span>(value),</span>
<span id="cb42-83">        <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">predicted_response =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">response_transform</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(model, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> newdata)), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb42-84">      )</span>
<span id="cb42-85">    })</span>
<span id="cb42-86">  })</span>
<span id="cb42-87">}</span>
<span id="cb42-88"></span>
<span id="cb42-89">plot_partial_dependence <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(pdp_data, y_label, line_colour) {</span>
<span id="cb42-90">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(pdp_data) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>) {</span>
<span id="cb42-91">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tibble</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">note =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"No partial dependence data could be computed for the selected features."</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>())</span>
<span id="cb42-92">  }</span>
<span id="cb42-93"></span>
<span id="cb42-94">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(pdp_data, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(feature_value, predicted_response)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb42-95">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> line_colour) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb42-96">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_wrap</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> feature_label, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">scales =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"free_x"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labeller =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">label_wrap_gen</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">width =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">26</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb42-97">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">axis.text.x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb42-98">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> y_label)</span>
<span id="cb42-99">}</span>
<span id="cb42-100"></span>
<span id="cb42-101">budget_scores <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(</span>
<span id="cb42-102">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">score_regression</span>(budget_test<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>log_budget, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(budget_baseline, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> budget_test)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">model =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Baseline linear"</span>),</span>
<span id="cb42-103">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">score_regression</span>(budget_test<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>log_budget, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(budget_expanded, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> budget_test)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">model =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expanded linear"</span>),</span>
<span id="cb42-104">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">score_regression</span>(budget_test<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>log_budget, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(budget_rf, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> budget_test)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">model =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Random forest"</span>)</span>
<span id="cb42-105">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb42-106">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(model, rmse, mae)</span>
<span id="cb42-107"></span>
<span id="cb42-108">budget_scores <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">model</th>
<th style="text-align: right;">rmse</th>
<th style="text-align: right;">mae</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Baseline linear</td>
<td style="text-align: right;">1.053</td>
<td style="text-align: right;">0.843</td>
</tr>
<tr class="even">
<td style="text-align: left;">Expanded linear</td>
<td style="text-align: right;">0.539</td>
<td style="text-align: right;">0.398</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Random forest</td>
<td style="text-align: right;">0.289</td>
<td style="text-align: right;">0.187</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb43" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb43-1">budget_predictions <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> budget_test <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb43-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb43-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pred_log_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(budget_rf, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> budget_test),</span>
<span id="cb43-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pred_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expm1</span>(pred_log_budget),</span>
<span id="cb43-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">budget_residual =</span> avg_support_budget <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pred_budget</span>
<span id="cb43-6">  )</span>
<span id="cb43-7"></span>
<span id="cb43-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(budget_predictions, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(pred_budget, avg_support_budget)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb43-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_abline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey50"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb43-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> participant_count), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb43-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> dollar) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb43-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> dollar) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb43-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_size_area</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> comma) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb43-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Predicted average support budget"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Observed average support budget"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participants"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/budget-predicted-observed-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Predicted versus observed average support budgets in the holdout quarter.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb44" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb44-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">importance</span>(budget_rf) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb44-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb44-3">  tibble<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames_to_column</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feature"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb44-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(IncNodePurity)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb44-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb44-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">reorder</span>(feature, IncNodePurity), IncNodePurity)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb44-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_col</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb44-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_flip</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb44-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Random forest importance"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Most useful predictors for average support budget"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/budget-importance-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>The clearest partial-dependence shape is provider pressure. In this fitted model, higher participants per active provider is associated with lower predicted average support budgets after a small low-pressure bump. The age-structure curves are weaker, but older local age profiles also lean slightly lower after the rest of the grouped data is averaged out.</p>
<section id="partial-dependence-average-support-budget-random-forest" class="level3">
<h3 class="anchored" data-anchor-id="partial-dependence-average-support-budget-random-forest">Partial dependence: average support budget random forest</h3>
<p>These curves hold the rest of the training distribution in place and vary one predictor at a time. They are useful for shape, not causality. Provider pressure is shown on its original scale even though the model uses <code>log1p(participants_per_provider)</code>.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb45" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb45-1">budget_pdp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">partial_dependence_data</span>(</span>
<span id="cb45-2">  budget_rf,</span>
<span id="cb45-3">  budget_rf_train,</span>
<span id="cb45-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">features =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_participants_per_provider"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"median_age"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_65_plus"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"irsd_decile"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"payment_share_top10"</span>),</span>
<span id="cb45-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">response_transform =</span> expm1,</span>
<span id="cb45-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x_transforms =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb45-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants_per_provider =</span> expm1,</span>
<span id="cb45-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> \(x) x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb45-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> \(x) x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb45-10">  ),</span>
<span id="cb45-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">feature_labels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb45-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants_per_provider =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participants per active provider"</span>,</span>
<span id="cb45-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_age =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Median LGA age"</span>,</span>
<span id="cb45-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LGA population aged 65+ (%)"</span>,</span>
<span id="cb45-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SEIFA disadvantage decile"</span>,</span>
<span id="cb45-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Top 10 provider payment share (%)"</span></span>
<span id="cb45-17">  )</span>
<span id="cb45-18">)</span>
<span id="cb45-19"></span>
<span id="cb45-20"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot_partial_dependence</span>(budget_pdp, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Predicted average support budget"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">line_colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#1b6ca8"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb45-21">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> dollar)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/budget-partial-dependence-1.png" class="img-fluid figure-img" width="864"></p>
<figcaption>Partial dependence curves for selected average support budget predictors.</figcaption>
</figure>
</div>
</div>
</div>
</section>
</section>
<section id="model-2-plan-utilisation" class="level2">
<h2 class="anchored" data-anchor-id="model-2-plan-utilisation">Model 2: Plan Utilisation</h2>
<p>Utilisation is a bounded rate, so this first model keeps the interpretation simple: it predicts the observed utilisation rate for grouped cells and checks where predictions differ most from the latest quarter. The same joined geography fields used in the budget model are available here when they have non-missing variation.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb46" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb46-1">util_model_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb46-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(utilisation_rate), <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(avg_support_budget), utilisation_rate <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, utilisation_rate <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb46-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb46-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation_rate =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmin</span>(utilisation_rate, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb46-5">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(state, service_district, age_group, disability_group, support_class, remoteness), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_na_value_to_level</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_lump_n</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.factor</span>(x), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">level =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Missing"</span>)),</span>
<span id="cb46-6">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_budget =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(avg_support_budget),</span>
<span id="cb46-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(participant_count, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb46-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_providers =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(active_providers, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb46-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(participants_per_provider, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb46-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_lga_population =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(lga_population, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb46-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(payment_share_top10, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(payment_share_top10, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)),</span>
<span id="cb46-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(payment_share_top10) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.nan</span>(payment_share_top10), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, payment_share_top10),</span>
<span id="cb46-13">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(irsd_score, irsd_decile, ier_score, ier_decile, ieo_score, ieo_decile, median_age, pct_0_14, pct_15_64, pct_65_plus, remoteness_rank, remoteness_major_cities_share, remoteness_inner_regional_share, remoteness_outer_regional_share, remoteness_remote_share, remoteness_very_remote_share), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">replace_na</span>(x, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))),</span>
<span id="cb46-14">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(irsd_score, irsd_decile, ier_score, ier_decile, ieo_score, ieo_decile, median_age, pct_0_14, pct_15_64, pct_65_plus, remoteness_rank, remoteness_major_cities_share, remoteness_inner_regional_share, remoteness_outer_regional_share, remoteness_remote_share, remoteness_very_remote_share), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.nan</span>(x), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, x))</span>
<span id="cb46-15">  )</span>
<span id="cb46-16"></span>
<span id="cb46-17">util_test_quarter <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(util_model_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb46-18">util_train <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(util_model_data, quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> util_test_quarter)</span>
<span id="cb46-19">util_test <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(util_model_data, quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> util_test_quarter)</span>
<span id="cb46-20"></span>
<span id="cb46-21">util_baseline <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(utilisation_rate <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> quarter_index <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> log_budget, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> util_train)</span>
<span id="cb46-22">util_factor_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness"</span>)</span>
<span id="cb46-23">util_factor_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> util_factor_terms[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_int</span>(util_train[util_factor_terms], \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb46-24">util_numeric_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_index"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_budget"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_participants"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_providers"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_participants_per_provider"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"payment_share_top10"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"irsd_score"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"irsd_decile"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ier_score"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ier_decile"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ieo_score"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ieo_decile"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"median_age"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_0_14"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_15_64"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_65_plus"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_lga_population"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_rank"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_major_cities_share"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_inner_regional_share"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_outer_regional_share"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_remote_share"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_very_remote_share"</span>)</span>
<span id="cb46-25">util_numeric_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> util_numeric_terms[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_lgl</span>(util_train[util_numeric_terms], \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">isTRUE</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sd</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))]</span>
<span id="cb46-26">util_formula <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.formula</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"utilisation_rate ~"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(util_numeric_terms, util_factor_terms), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" + "</span>)))</span>
<span id="cb46-27"></span>
<span id="cb46-28">util_expanded <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(util_formula, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> util_train)</span>
<span id="cb46-29"></span>
<span id="cb46-30"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set.seed</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20260526</span>)</span>
<span id="cb46-31">util_rf_train <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> util_train <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb46-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">drop_na</span>(utilisation_rate) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb46-33">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_sample</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">drop_na</span>(util_train, utilisation_rate)), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">8000</span>))</span>
<span id="cb46-34"></span>
<span id="cb46-35">util_rf <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">randomForest</span>(</span>
<span id="cb46-36">  util_formula,</span>
<span id="cb46-37">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> util_rf_train,</span>
<span id="cb46-38">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ntree =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span>,</span>
<span id="cb46-39">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">importance =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb46-40">)</span>
<span id="cb46-41"></span>
<span id="cb46-42">util_scores <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(</span>
<span id="cb46-43">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">score_regression</span>(util_test<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>utilisation_rate, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(util_baseline, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> util_test)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">model =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Baseline linear"</span>),</span>
<span id="cb46-44">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">score_regression</span>(util_test<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>utilisation_rate, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(util_expanded, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> util_test)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">model =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Expanded linear"</span>),</span>
<span id="cb46-45">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">score_regression</span>(util_test<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>utilisation_rate, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(util_rf, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> util_test)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">model =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Random forest"</span>)</span>
<span id="cb46-46">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb46-47">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(model, rmse, mae)</span>
<span id="cb46-48"></span>
<span id="cb46-49">util_scores <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">model</th>
<th style="text-align: right;">rmse</th>
<th style="text-align: right;">mae</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Baseline linear</td>
<td style="text-align: right;">0.176</td>
<td style="text-align: right;">0.131</td>
</tr>
<tr class="even">
<td style="text-align: left;">Expanded linear</td>
<td style="text-align: right;">0.172</td>
<td style="text-align: right;">0.127</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Random forest</td>
<td style="text-align: right;">0.163</td>
<td style="text-align: right;">0.114</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb47" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb47-1">util_predictions <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> util_test <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb47-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb47-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pred_utilisation =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmin</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmax</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(util_rf, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> util_test), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb47-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">utilisation_residual =</span> utilisation_rate <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pred_utilisation</span>
<span id="cb47-5">  )</span>
<span id="cb47-6"></span>
<span id="cb47-7"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(util_predictions, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(pred_utilisation, utilisation_rate)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_abline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey50"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> participant_count), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#7a4b9d"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_size_area</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> comma) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb47-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Predicted utilisation"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Observed utilisation"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participants"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/utilisation-predicted-observed-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Predicted versus observed utilisation in the holdout quarter.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb48" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb48-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">importance</span>(util_rf) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb48-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb48-3">  tibble<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames_to_column</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feature"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb48-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(IncNodePurity)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb48-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb48-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">reorder</span>(feature, IncNodePurity), IncNodePurity)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_col</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#7a4b9d"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_flip</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb48-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Random forest importance"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Most useful predictors for plan utilisation"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/utilisation-importance-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>The utilisation PDPs tell a different story from the budget model. Average support budget has the strongest visible positive shape, while participants per provider is close to flat after the rest of the model context is averaged over. That is a useful caution: provider pressure may matter in particular regions or supports, but it is not a simple national monotonic utilisation effect in this grouped model.</p>
<section id="partial-dependence-plan-utilisation-random-forest" class="level3">
<h3 class="anchored" data-anchor-id="partial-dependence-plan-utilisation-random-forest">Partial dependence: plan utilisation random forest</h3>
<p>These plots are most useful for asking access questions. For example, if predicted utilisation falls as participants per provider rises, that is consistent with provider pressure constraining use of plans. It is still not enough to prove access failure, because participant mix and support needs are only partly observed in the public files.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb49" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb49-1">util_pdp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">partial_dependence_data</span>(</span>
<span id="cb49-2">  util_rf,</span>
<span id="cb49-3">  util_rf_train,</span>
<span id="cb49-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">features =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_participants_per_provider"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"median_age"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_budget"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_0_14"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"irsd_decile"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"payment_share_top10"</span>),</span>
<span id="cb49-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">response_transform =</span> \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmin</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">pmax</span>(x, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>),</span>
<span id="cb49-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x_transforms =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb49-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants_per_provider =</span> expm1,</span>
<span id="cb49-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_budget =</span> \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expm1</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>,</span>
<span id="cb49-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_0_14 =</span> \(x) x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb49-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> \(x) x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb49-11">  ),</span>
<span id="cb49-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">feature_labels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb49-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants_per_provider =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participants per active provider"</span>,</span>
<span id="cb49-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_age =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Median LGA age"</span>,</span>
<span id="cb49-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_budget =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average support budget ($000s)"</span>,</span>
<span id="cb49-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_0_14 =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LGA population aged 0-14 (%)"</span>,</span>
<span id="cb49-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">irsd_decile =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"SEIFA disadvantage decile"</span>,</span>
<span id="cb49-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Top 10 provider payment share (%)"</span></span>
<span id="cb49-19">  )</span>
<span id="cb49-20">)</span>
<span id="cb49-21"></span>
<span id="cb49-22"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot_partial_dependence</span>(util_pdp, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Predicted utilisation"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">line_colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#7a4b9d"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb49-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> percent)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/utilisation-partial-dependence-1.png" class="img-fluid figure-img" width="864"></p>
<figcaption>Partial dependence curves for selected plan utilisation predictors.</figcaption>
</figure>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</div>
<p>The supporting models help separate the mechanics behind spend growth:</p>
<ul>
<li>Average support budget: the strongest random-forest predictors are support class, disability group, age group, active providers, participants per active provider.</li>
<li>Plan utilisation: the strongest random-forest predictors are average support budget, disability group, support class, age group, active providers.</li>
</ul>
</section>
<section id="model-3-overall-spend" class="level2">
<h2 class="anchored" data-anchor-id="model-3-overall-spend">Model 3: Overall Spend</h2>
<p>The main model asks how well public explanatory factors describe actual payment dollars for each grouped quarterly cell. I exclude lagged payments and lagged budgets, and I also keep current average budget and utilisation out of this model. Those variables are useful components of spend, but including them here would make the model less useful for describing upstream drivers such as participant scale, disability mix, age mix, geography and provider-market context.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb50" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb50-1">spend_model_data <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> model_data <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb50-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(</span>
<span id="cb50-3">    <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(payment_amount), payment_amount <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>,</span>
<span id="cb50-4">    <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(participant_count), participant_count <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb50-5">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb50-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb50-7">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(state, service_district, age_group, disability_group, support_class, remoteness), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_na_value_to_level</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">fct_lump_n</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.factor</span>(x), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">level =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Missing"</span>)),</span>
<span id="cb50-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_payment =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(payment_amount),</span>
<span id="cb50-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(participant_count),</span>
<span id="cb50-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_providers =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(active_providers, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb50-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants_per_provider =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(participants_per_provider, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb50-12">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_lga_population =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log1p</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(lga_population, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)),</span>
<span id="cb50-13">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coalesce</span>(payment_share_top10, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(payment_share_top10, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)),</span>
<span id="cb50-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(payment_share_top10) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.nan</span>(payment_share_top10), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, payment_share_top10),</span>
<span id="cb50-15">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(irsd_score, irsd_decile, ier_score, ier_decile, ieo_score, ieo_decile, median_age, pct_0_14, pct_15_64, pct_65_plus, remoteness_rank, remoteness_major_cities_share, remoteness_inner_regional_share, remoteness_outer_regional_share, remoteness_remote_share, remoteness_very_remote_share), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">replace_na</span>(x, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>))),</span>
<span id="cb50-16">    <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">across</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(irsd_score, irsd_decile, ier_score, ier_decile, ieo_score, ieo_decile, median_age, pct_0_14, pct_15_64, pct_65_plus, remoteness_rank, remoteness_major_cities_share, remoteness_inner_regional_share, remoteness_outer_regional_share, remoteness_remote_share, remoteness_very_remote_share), \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ifelse</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.na</span>(x) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">is.nan</span>(x), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, x))</span>
<span id="cb50-17">  )</span>
<span id="cb50-18"></span>
<span id="cb50-19">spend_test_quarter <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(spend_model_data<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>quarter_date, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)</span>
<span id="cb50-20">spend_train <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(spend_model_data, quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> spend_test_quarter)</span>
<span id="cb50-21">spend_test <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(spend_model_data, quarter_date <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> spend_test_quarter)</span>
<span id="cb50-22"></span>
<span id="cb50-23">spend_baseline <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(log_payment <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> quarter_index <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> log_participants, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> spend_train)</span>
<span id="cb50-24"></span>
<span id="cb50-25">spend_factor_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"state"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"service_district"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"age_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"disability_group"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"support_class"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness"</span>)</span>
<span id="cb50-26">spend_factor_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> spend_factor_terms[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_int</span>(spend_train[spend_factor_terms], \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">n_distinct</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>]</span>
<span id="cb50-27">spend_numeric_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(</span>
<span id="cb50-28">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"quarter_index"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_participants"</span>,</span>
<span id="cb50-29">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_providers"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_participants_per_provider"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"payment_share_top10"</span>,</span>
<span id="cb50-30">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"irsd_score"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"irsd_decile"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ier_score"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ier_decile"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ieo_score"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ieo_decile"</span>,</span>
<span id="cb50-31">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"median_age"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_0_14"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_15_64"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_65_plus"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_lga_population"</span>,</span>
<span id="cb50-32">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_rank"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_major_cities_share"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_inner_regional_share"</span>,</span>
<span id="cb50-33">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_outer_regional_share"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_remote_share"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"remoteness_very_remote_share"</span></span>
<span id="cb50-34">)</span>
<span id="cb50-35">spend_numeric_terms <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> spend_numeric_terms[<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map_lgl</span>(spend_train[spend_numeric_terms], \(x) <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">isTRUE</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sd</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">na.rm =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>))]</span>
<span id="cb50-36">spend_expanded_formula <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.formula</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_payment ~"</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(spend_numeric_terms, spend_factor_terms), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">collapse =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" + "</span>)))</span>
<span id="cb50-37">spend_expanded <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(spend_expanded_formula, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> spend_train)</span>
<span id="cb50-38"></span>
<span id="cb50-39"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">set.seed</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20260526</span>)</span>
<span id="cb50-40">spend_rf_train <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> spend_train <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb50-41">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">drop_na</span>(log_payment) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb50-42">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_sample</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">nrow</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">drop_na</span>(spend_train, log_payment)), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10000</span>))</span>
<span id="cb50-43"></span>
<span id="cb50-44">spend_rf <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">randomForest</span>(</span>
<span id="cb50-45">  spend_expanded_formula,</span>
<span id="cb50-46">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> spend_rf_train,</span>
<span id="cb50-47">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ntree =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span>,</span>
<span id="cb50-48">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">importance =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb50-49">)</span>
<span id="cb50-50"></span>
<span id="cb50-51">spend_scores <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">bind_rows</span>(</span>
<span id="cb50-52">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">score_regression</span>(spend_test<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>log_payment, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(spend_baseline, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> spend_test)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">model =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participant-scale linear"</span>),</span>
<span id="cb50-53">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">score_regression</span>(spend_test<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>log_payment, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(spend_expanded, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> spend_test)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">model =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Explanatory linear"</span>),</span>
<span id="cb50-54">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">score_regression</span>(spend_test<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>log_payment, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(spend_rf, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> spend_test)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">model =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Explanatory random forest"</span>)</span>
<span id="cb50-55">) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb50-56">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">select</span>(model, rmse, mae)</span>
<span id="cb50-57"></span>
<span id="cb50-58">spend_scores <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<thead>
<tr class="header">
<th style="text-align: left;">model</th>
<th style="text-align: right;">rmse</th>
<th style="text-align: right;">mae</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Participant-scale linear</td>
<td style="text-align: right;">1.355</td>
<td style="text-align: right;">1.176</td>
</tr>
<tr class="even">
<td style="text-align: left;">Explanatory linear</td>
<td style="text-align: right;">0.501</td>
<td style="text-align: right;">0.361</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Explanatory random forest</td>
<td style="text-align: right;">0.366</td>
<td style="text-align: right;">0.270</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb51" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb51-1">spend_predictions <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> spend_test <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb51-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb51-3">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pred_log_payment =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict</span>(spend_rf, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">newdata =</span> spend_test),</span>
<span id="cb51-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pred_payment =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expm1</span>(pred_log_payment),</span>
<span id="cb51-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_residual =</span> payment_amount <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> pred_payment</span>
<span id="cb51-6">  )</span>
<span id="cb51-7"></span>
<span id="cb51-8"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(spend_predictions, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(pred_payment, payment_amount)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb51-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_abline</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linetype =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey50"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb51-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_point</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> participant_count), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0b6b57"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb51-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_x_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> dollar) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb51-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> dollar) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb51-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_size_area</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> comma) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb51-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Predicted grouped payments"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Observed grouped payments"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">size =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participants"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/spend-predicted-observed-1.png" class="img-fluid figure-img" width="672"></p>
<figcaption>Predicted versus observed grouped quarterly payments in the holdout quarter.</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb52" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb52-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">importance</span>(spend_rf) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb52-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.data.frame</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb52-3">  tibble<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames_to_column</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"feature"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb52-4">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">desc</span>(IncNodePurity)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb52-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">slice_head</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">n =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb52-6">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">reorder</span>(feature, IncNodePurity), IncNodePurity)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb52-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_col</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">fill =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0b6b57"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb52-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">coord_flip</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb52-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">NULL</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Random forest importance"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Most useful predictors for grouped payment spend"</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/spend-importance-1.png" class="img-fluid figure-img" width="672"></p>
</figure>
</div>
</div>
</div>
<p>For overall spend, the strongest predictors in the random forest are support class, participant count, disability group, active providers, age group, participants per active provider. Fit is expected to be weaker than a lagged model, but the trade-off is interpretability: the model is forced to lean on observable mix, scale, geography and market variables rather than yesterday’s spend.</p>
<p>The partial dependence curves below are descriptive shape checks. They hold the rest of the training distribution in place and vary one numeric predictor at a time, so they are useful for asking “what does the fitted model tend to do as this factor changes?”, not for claiming causality.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb53" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb53-1">spend_pdp <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">partial_dependence_data</span>(</span>
<span id="cb53-2">  spend_rf,</span>
<span id="cb53-3">  spend_rf_train,</span>
<span id="cb53-4">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">features =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_participants"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_providers"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log_participants_per_provider"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"median_age"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct_65_plus"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"payment_share_top10"</span>),</span>
<span id="cb53-5">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">response_transform =</span> expm1,</span>
<span id="cb53-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x_transforms =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb53-7">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants =</span> expm1,</span>
<span id="cb53-8">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_providers =</span> expm1,</span>
<span id="cb53-9">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants_per_provider =</span> expm1,</span>
<span id="cb53-10">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> \(x) x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>,</span>
<span id="cb53-11">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> \(x) x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb53-12">  ),</span>
<span id="cb53-13">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">feature_labels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(</span>
<span id="cb53-14">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participants"</span>,</span>
<span id="cb53-15">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_providers =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Active providers"</span>,</span>
<span id="cb53-16">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log_participants_per_provider =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Participants per active provider"</span>,</span>
<span id="cb53-17">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pct_65_plus =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"LGA population aged 65+ (%)"</span>,</span>
<span id="cb53-18">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">payment_share_top10 =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Top 10 provider payment share (%)"</span>,</span>
<span id="cb53-19">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">median_age =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Median LGA age"</span></span>
<span id="cb53-20">  )</span>
<span id="cb53-21">)</span>
<span id="cb53-22"></span>
<span id="cb53-23"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot_partial_dependence</span>(spend_pdp, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y_label =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Predicted grouped payments"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">line_colour =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0b6b57"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb53-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">labels =</span> dollar)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/index_files/figure-html/spend-partial-dependence-1.png" class="img-fluid figure-img" width="864"></p>
<figcaption>Partial dependence curves for selected grouped payment spend predictors.</figcaption>
</figure>
</div>
</div>
</div>
<section id="reading-the-top-predictors" class="level3">
<h3 class="anchored" data-anchor-id="reading-the-top-predictors">Reading the Top Predictors</h3>
<p>The top categorical predictors are not just statistical conveniences. <code>support_class</code> tells the model what kind of support is being paid for, <code>disability_group</code> captures broad differences in support needs and service patterns, and <code>age_group</code> captures lifecycle differences in both participant numbers and support intensity. The tables below are latest-quarter grouped payment summaries, so they should be read as model-cell summaries rather than unique participant counts.</p>
<p>For numeric predictors, the partial-dependence chart gives the main shape. Participant count is the scale variable: larger grouped cells have higher predicted payments. Active providers also tends to act as a market-size proxy, while participants per provider is more about local pressure or thinness. The age-structure and provider-concentration curves are weaker, but they help the model distinguish otherwise similar regions and support markets.</p>
<p><strong>Support class</strong></p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb54" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb54-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format_spend_factor_summary</span>(spend_support_summary) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb54-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 8%">
<col style="width: 15%">
<col style="width: 17%">
<col style="width: 27%">
<col style="width: 12%">
<col style="width: 19%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">category</th>
<th style="text-align: left;">total_payments</th>
<th style="text-align: left;">paid_participants</th>
<th style="text-align: left;">payment_per_paid_participant</th>
<th style="text-align: left;">grouped_rows</th>
<th style="text-align: left;">median_cell_payment</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Core</td>
<td style="text-align: left;">$33,376,937,000</td>
<td style="text-align: left;">445,707</td>
<td style="text-align: left;">$74,885</td>
<td style="text-align: left;">4,383</td>
<td style="text-align: left;">$3,661,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Capital</td>
<td style="text-align: left;">$1,110,695,000</td>
<td style="text-align: left;">65,554</td>
<td style="text-align: left;">$16,943</td>
<td style="text-align: left;">2,363</td>
<td style="text-align: left;">$353,000</td>
</tr>
</tbody>
</table>
</div>
</div>
<p><strong>Disability group</strong></p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb55" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb55-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format_spend_factor_summary</span>(spend_disability_summary) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb55-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 20%">
<col style="width: 12%">
<col style="width: 15%">
<col style="width: 24%">
<col style="width: 10%">
<col style="width: 16%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">category</th>
<th style="text-align: left;">total_payments</th>
<th style="text-align: left;">paid_participants</th>
<th style="text-align: left;">payment_per_paid_participant</th>
<th style="text-align: left;">grouped_rows</th>
<th style="text-align: left;">median_cell_payment</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Intellectual Disability</td>
<td style="text-align: left;">$9,013,455,000</td>
<td style="text-align: left;">89,121</td>
<td style="text-align: left;">$101,137</td>
<td style="text-align: left;">875</td>
<td style="text-align: left;">$2,755,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Autism</td>
<td style="text-align: left;">$5,670,942,000</td>
<td style="text-align: left;">186,734</td>
<td style="text-align: left;">$30,369</td>
<td style="text-align: left;">535</td>
<td style="text-align: left;">$2,952,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Psychosocial disability</td>
<td style="text-align: left;">$3,806,680,000</td>
<td style="text-align: left;">47,455</td>
<td style="text-align: left;">$80,217</td>
<td style="text-align: left;">345</td>
<td style="text-align: left;">$4,756,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Other Neurological</td>
<td style="text-align: left;">$3,531,125,000</td>
<td style="text-align: left;">32,773</td>
<td style="text-align: left;">$107,745</td>
<td style="text-align: left;">647</td>
<td style="text-align: left;">$1,911,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">ABI</td>
<td style="text-align: left;">$2,885,983,000</td>
<td style="text-align: left;">22,634</td>
<td style="text-align: left;">$127,507</td>
<td style="text-align: left;">505</td>
<td style="text-align: left;">$2,748,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Cerebral Palsy</td>
<td style="text-align: left;">$2,528,100,000</td>
<td style="text-align: left;">23,565</td>
<td style="text-align: left;">$107,282</td>
<td style="text-align: left;">755</td>
<td style="text-align: left;">$1,239,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Stroke</td>
<td style="text-align: left;">$1,444,029,000</td>
<td style="text-align: left;">13,869</td>
<td style="text-align: left;">$104,119</td>
<td style="text-align: left;">337</td>
<td style="text-align: left;">$1,895,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">Other Physical</td>
<td style="text-align: left;">$1,239,948,000</td>
<td style="text-align: left;">24,950</td>
<td style="text-align: left;">$49,697</td>
<td style="text-align: left;">584</td>
<td style="text-align: left;">$964,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">Down Syndrome</td>
<td style="text-align: left;">$1,056,436,000</td>
<td style="text-align: left;">8,893</td>
<td style="text-align: left;">$118,794</td>
<td style="text-align: left;">312</td>
<td style="text-align: left;">$2,877,500</td>
</tr>
<tr class="even">
<td style="text-align: left;">Multiple Sclerosis</td>
<td style="text-align: left;">$1,019,682,000</td>
<td style="text-align: left;">14,974</td>
<td style="text-align: left;">$68,097</td>
<td style="text-align: left;">375</td>
<td style="text-align: left;">$1,350,000</td>
</tr>
</tbody>
</table>
</div>
</div>
<p><strong>Age group</strong></p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb56" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb56-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">format_spend_factor_summary</span>(spend_age_summary) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">|&gt;</span></span>
<span id="cb56-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>()</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<table class="caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 8%">
<col style="width: 14%">
<col style="width: 17%">
<col style="width: 27%">
<col style="width: 12%">
<col style="width: 19%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;">category</th>
<th style="text-align: left;">total_payments</th>
<th style="text-align: left;">paid_participants</th>
<th style="text-align: left;">payment_per_paid_participant</th>
<th style="text-align: left;">grouped_rows</th>
<th style="text-align: left;">median_cell_payment</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">55 to 64</td>
<td style="text-align: left;">$8,055,101,000</td>
<td style="text-align: left;">85,518</td>
<td style="text-align: left;">$94,192</td>
<td style="text-align: left;">1,337</td>
<td style="text-align: left;">$1,891,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">45 to 54</td>
<td style="text-align: left;">$5,436,150,000</td>
<td style="text-align: left;">57,052</td>
<td style="text-align: left;">$95,284</td>
<td style="text-align: left;">1,124</td>
<td style="text-align: left;">$1,563,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">65+</td>
<td style="text-align: left;">$5,167,903,000</td>
<td style="text-align: left;">53,947</td>
<td style="text-align: left;">$95,796</td>
<td style="text-align: left;">1,087</td>
<td style="text-align: left;">$1,701,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">25 to 34</td>
<td style="text-align: left;">$4,821,438,000</td>
<td style="text-align: left;">51,027</td>
<td style="text-align: left;">$94,488</td>
<td style="text-align: left;">678</td>
<td style="text-align: left;">$1,742,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">35 to 44</td>
<td style="text-align: left;">$4,459,941,000</td>
<td style="text-align: left;">44,441</td>
<td style="text-align: left;">$100,356</td>
<td style="text-align: left;">873</td>
<td style="text-align: left;">$1,730,000</td>
</tr>
<tr class="even">
<td style="text-align: left;">19 to 24</td>
<td style="text-align: left;">$3,322,372,000</td>
<td style="text-align: left;">47,501</td>
<td style="text-align: left;">$69,943</td>
<td style="text-align: left;">451</td>
<td style="text-align: left;">$1,614,000</td>
</tr>
<tr class="odd">
<td style="text-align: left;">9 to 14</td>
<td style="text-align: left;">$1,485,000,000</td>
<td style="text-align: left;">86,229</td>
<td style="text-align: left;">$17,222</td>
<td style="text-align: left;">466</td>
<td style="text-align: left;">$603,500</td>
</tr>
<tr class="even">
<td style="text-align: left;">15 to 18</td>
<td style="text-align: left;">$1,199,646,000</td>
<td style="text-align: left;">38,795</td>
<td style="text-align: left;">$30,923</td>
<td style="text-align: left;">308</td>
<td style="text-align: left;">$701,500</td>
</tr>
<tr class="odd">
<td style="text-align: left;">0 to 8</td>
<td style="text-align: left;">$540,081,000</td>
<td style="text-align: left;">46,751</td>
<td style="text-align: left;">$11,552</td>
<td style="text-align: left;">422</td>
<td style="text-align: left;">$355,000</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Useful next explanatory data would include functional-capacity measures, plan duration and review timing, informal-support availability, support hours, provider wait times, workforce depth, plan-management type, local therapy availability, and direct measures of unmet demand. Those would help distinguish genuine support need from access friction and administrative timing.</p>
</section>
</section>
<section id="caveats" class="level2">
<h2 class="anchored" data-anchor-id="caveats">Caveats</h2>
<ul>
<li>These are aggregate public datasets. They do not contain participant-level need, functional capacity, goals, informal supports or local service availability.</li>
<li>A plan budget is not the same thing as a payment, and a payment is not the same thing as a good outcome.</li>
<li>Disability-group payment trends use public aggregate rows. Where a national disability total is not exposed, support-class rows are summed and treated as a directional spend signal rather than a unique participant count.</li>
<li>Utilisation can be low because a participant does not need a support, cannot find a provider, faces administrative barriers, or has timing issues inside a plan. The public data cannot separate all of these explanations.</li>
<li>Regional ABS joins are approximate because NDIS service districts and ABS geographies do not always align perfectly.</li>
<li>Outcomes are handled in the companion post because the dashboard workbook structure and investment interpretation need their own workflow.</li>
</ul>
</section>
<section id="next-steps" class="level2">
<h2 class="anchored" data-anchor-id="next-steps">Next Steps</h2>
<p>The next useful extension would be to connect NDIS service access with MBS/PBS or hospital-pressure indicators, especially for regions where utilisation, provider concentration and outcomes all point in the same direction.</p>


<!-- -->

</section>

 ]]></description>
  <category>ndis</category>
  <category>health-policy</category>
  <category>modelling</category>
  <category>australia</category>
  <guid>https://blog.aydins-workbench.com/posts/ndis-budget-utilisation-prediction/</guid>
  <pubDate>Tue, 26 May 2026 00:00:00 GMT</pubDate>
</item>
</channel>
</rss>
