<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/success-rates-of-appeals-to-the-supreme-court-by-circuit/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://ellisp.github.io/blog/2017/02/26/appeal-circuits"> Peter's stats stuff - R</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>In the chaos of the last month or so of United States of America governance, one item that grabbed my attention was the claim by President Trump that 80% of appeals decided by the <a target="_blank" rel="nofollow" href="http://www.ca9.uscourts.gov/information/">Ninth Circuit Court of Appeal</a> are overturned by the Supreme Court of the United States (SCOTUS):</p>
<blockquote>
<p>“In fact, we had to go quicker than we thought because of the bad decision we received from a circuit that has been overturned at a record number. I have heard 80 percent, I find that hard to believe, that is just a number I heard, that they are overturned 80 percent of the time. I think that circuit is – that circuit is in chaos and that circuit is frankly in turmoil. But we are appealing that, and we are going further.”</p>
</blockquote>
<p><em>(Donald Trump during his 77 minute <a target="_blank" rel="nofollow" href="http://edition.cnn.com/2017/02/16/politics/donald-trump-news-conference-transcript/">16 February 2017 press conference</a>)</em></p>
<p>Put aside whether it is a good thing for the head of state in a press conference to be speculating on things that are “just a number I heard” and making casual judgments about whether a Federal Circuit Court of Appeal is in chaos (would the Queen do this for one of her realms’ courts? Probably not). This particular number sounded bad, and having eighty percent of appeals overturned by the higher appeals court surely would be a sign of chaos. The reality however is that this is eighty percent of the subset of cases from that appeals circuit that are <em>considered</em> by the Supreme Court, not eighty percent of the circuit’s total cases. The potential to mislead is nicely explained by the <a target="_blank" rel="nofollow" href="http://www.snopes.com/ninth-circuit-court-most-overturned/">Snopes fact-checking/legend-busting site</a> about a widely cited blog post arguing the 9th Circuit has known liberal bias and quoting a Congress member describing it as “presumptively reversible”:</p>
<blockquote>
<p>“So, although correctly worded, the blog post left many readers with the mistaken impression that 80 percent of the Ninth Circuit Court’s decisions were being overturned by SCOTUS. What it actually said was that of the very tiny fraction of decisions by federal courts of appeal that SCOTUS agrees to review each year (0.1%), 80 percent of that small portion of appeals originating with the Ninth Circuit Court were overturned.”</p>
</blockquote>
<p><em>(Snopes)</em></p>
<p>Any reasonable view of the performance of one of the Circuit appeals courts should use as its denominator the number of cases decided by the Circuit, not the number of decided cases that are then accepted for consideration by the Supreme Court. As the Trump administration is I suspect currently discovering, just disagreeing with an appeals decision does not mean that there is any prospect of putting together a case worthy of consideration by the Supreme Court.</p>
<p>Most of the discussion on the web is based on analysis in Roy E. Hofer’s 2010 paper <a target="_blank" rel="nofollow" href="http://www.americanbar.org/content/dam/aba/migrated/intelprop/magazine/LandslideJan2010_Hofer.authcheckdam.pdf">Supreme Court Reversal Rates: Evaluating the Federal Courts of Appeals</a>, which is a perfectly respectable piece of analysis. His results are presented in tables so to better understand them I tried a visual:</p>
<p><img width="100%" src="http://ellisp.github.io/img/0081-total-ratios.svg"></p>
<p>I’m afraid it’s pretty ugly; lots of information but too wordy. Basically, in the period considered in Hofer’s analysis, about one in a thousand of the appeals decided by the Ninth Circuit was successfully overturned; a far cry from “presumptively reversible”. True however that if you get as far as putting together a coherent appeal and the Supreme Court agreeing to consider it, you have a good chance of success at the final hurdle.</p>
<p>Sometimes more basic visualizations are better. So here’s a good old-fashioned stacked bar chart:</p>
<p><img width="100%" src="http://ellisp.github.io/img/0081-bars.svg"></p>
<p>This makes the tiny proportion of cases considered and overturned by the Supreme Court visually obvious. The graphic is scalable but you will have to zoom in a long way to see the slivers of green or pink that indicate a Supreme Court affirmation or overturn.</p>
<h2>The data</h2>
<p>Here’s how I went about exploring today’s data.</p>
<p>After some hunting around I found that more up to date (and not particularly interesting for today’s purposes) data are available from the Supreme Court’s <a target="_blank" rel="nofollow" href="http://www.scotusblog.com/reference/stat-pack/">own webpage</a>. More confusion is perpetuated by describing as a “Circuit Scorecard” a table that refers again to the percentage of cases that get to SCOTUS that are overturned, the same false view of the performance of Circuits that started this. As the Supreme Courts’ data although commendably open was not in a particularly convenient structure, I decided to confine myself for today’s purposes to just examining Hofer’s original results.</p>
<p>Hofer’s paper is only available as a PDF, so the first task was to extract his tables into R. This is easy with the <a target="_blank" rel="nofollow" href="https://github.com/ropensci/tabulizer">amazing <code>tabulizer</code> package</a>, part of the <code>ropensci</code> project. The code snippet below downloads the file and extracts all of the tables in the document into a list called <code>tabs</code>.</p>
<figure>
<pre><code data-lang="r"><span>library</span><span>(</span><span>tidyverse</span><span>)</span><span>
</span><span>library</span><span>(</span><span>scales</span><span>)</span><span>
</span><span>library</span><span>(</span><span>stringr</span><span>)</span><span>
</span><span>library</span><span>(</span><span>tabulizer</span><span>)</span><span>
</span><span>library</span><span>(</span><span>forcats</span><span>)</span><span>
</span><span>library</span><span>(</span><span>grid</span><span>)</span><span>
</span><span>#-----------------download file and extract the tables---------------------
</span><span>thefile</span><span> </span><span>&lt;-</span><span> </span><span>tempfile</span><span>()</span><span>
</span><span>download.file</span><span>(</span><span>&quot;http://www.americanbar.org/content/dam/aba/migrated/intelprop/magazine/LandslideJan2010_Hofer.authcheckdam.pdf&quot;</span><span>,</span><span>
</span><span>destfile</span><span> </span><span>=</span><span> </span><span>thefile</span><span>,</span><span> </span><span>mode</span><span> </span><span>=</span><span> </span><span>&quot;wb&quot;</span><span>)</span><span>
</span><span>tabs</span><span> </span><span>&lt;-</span><span> </span><span>extract_tables</span><span>(</span><span>thefile</span><span>)</span></code></pre>
</figure>
<p>The first table in the paper was of the total number of cases decided by each Circuit by year. This is of some interest in itself and I produced this chart while familiarising myself with the data</p>
<p><img width="100%" src="http://ellisp.github.io/img/0081-cases-time.svg"></p>
<p>Here’s the code that grooms that data – which effectively forms the correct denominator to use in considering the degree to which appeals end up being overturnable – and produces the chart:</p>
<figure>
<pre><code data-lang="r"><span>#----------------------prepare data---------------
</span><span>total_cases</span><span> </span><span>&lt;-</span><span> </span><span>as.data.frame</span><span>(</span><span>tabs</span><span>[[</span><span>1</span><span>]][</span><span> </span><span>-</span><span>(</span><span>1</span><span>:</span><span>2</span><span>),</span><span> </span><span>])</span><span>
</span><span>names</span><span>(</span><span>total_cases</span><span>)</span><span> </span><span>&lt;-</span><span> </span><span>c</span><span>(</span><span>&quot;Court&quot;</span><span>,</span><span> </span><span>1999</span><span>:</span><span>2008</span><span>,</span><span> </span><span>&quot;Total&quot;</span><span>)</span><span>
</span><span>total_cases</span><span> </span><span>&lt;-</span><span> </span><span>total_cases</span><span> </span><span>%>%</span><span>
</span><span>gather</span><span>(</span><span>Year</span><span>,</span><span> </span><span>Cases</span><span>,</span><span> </span><span>-</span><span>Court</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Cases</span><span> </span><span>=</span><span> </span><span>as.numeric</span><span>(</span><span>gsub</span><span>(</span><span>&quot;,&quot;</span><span>,</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>Cases</span><span>)),</span><span>
</span><span>Court</span><span> </span><span>=</span><span> </span><span>str_trim</span><span>(</span><span>Court</span><span>))</span><span>
</span><span>total_cases</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>Year</span><span> </span><span>!=</span><span> </span><span>&quot;Total&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Year</span><span> </span><span>=</span><span> </span><span>as.numeric</span><span>(</span><span>Year</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>Year</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>Cases</span><span>))</span><span> </span><span>+</span><span>
</span><span>geom_point</span><span>()</span><span> </span><span>+</span><span>
</span><span>geom_line</span><span>()</span><span> </span><span>+</span><span>
</span><span>facet_wrap</span><span>(</span><span>~</span><span>Court</span><span>,</span><span> </span><span>scales</span><span> </span><span>=</span><span> </span><span>&quot;free_y&quot;</span><span>,</span><span> </span><span>ncol</span><span> </span><span>=</span><span> </span><span>3</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_y_continuous</span><span>(</span><span>&quot;Total appeals terminated\n&quot;</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>comma</span><span>)</span></code></pre>
</figure>
<p>Next task was to extract the third table of the paper, which has the numbers of cases taken to the Supreme Court and what happened to them. This data comes out of the <code>tabulizer</code> process a little messier and needed a bit of hand treatment.</p>
<p>Once stored in object called <code>scotus</code>, I combined this with the total cases denominator and drew the two graphs I presented in this post earlier:</p>
<figure>
<pre><code data-lang="r"><span>scotus</span><span> </span><span>&lt;-</span><span> </span><span>as.data.frame</span><span>(</span><span>tabs</span><span>[[</span><span>3</span><span>]][</span><span>-</span><span>(</span><span>1</span><span>:</span><span>3</span><span>),</span><span> </span><span>1</span><span>:</span><span>5</span><span>])</span><span>
</span><span>scotus</span><span> </span><span>&lt;-</span><span> </span><span>cbind</span><span>(</span><span>scotus</span><span>[</span><span> </span><span>,</span><span> </span><span>-5</span><span>],</span><span> </span><span>str_split</span><span>(</span><span>scotus</span><span>[</span><span> </span><span>,</span><span> </span><span>5</span><span>],</span><span> </span><span>&quot; &quot;</span><span>,</span><span> </span><span>simplify</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>)[</span><span> </span><span>,</span><span> </span><span>1</span><span>:</span><span>2</span><span>])</span><span>
</span><span>names</span><span>(</span><span>scotus</span><span>)</span><span> </span><span>&lt;-</span><span> </span><span>c</span><span>(</span><span>&quot;Court&quot;</span><span>,</span><span> </span><span>&quot;Reversed&quot;</span><span>,</span><span> </span><span>&quot;Vacated&quot;</span><span>,</span><span> </span><span>&quot;Affirmed&quot;</span><span>,</span><span> </span><span>&quot;Reversed + Vacated&quot;</span><span>,</span><span> </span><span>&quot;Appealed&quot;</span><span>)</span><span>
</span><span>scotus</span><span> </span><span>&lt;-</span><span> </span><span>scotus</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Court</span><span> </span><span>=</span><span> </span><span>str_trim</span><span>(</span><span>Court</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>gather</span><span>(</span><span>Result</span><span>,</span><span> </span><span>Number</span><span>,</span><span> </span><span>-</span><span> </span><span>Court</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Number</span><span> </span><span>=</span><span> </span><span>as.numeric</span><span>(</span><span>as.character</span><span>(</span><span>Number</span><span>)))</span><span> </span><span>%>%</span><span>
</span><span>spread</span><span>(</span><span>Result</span><span>,</span><span> </span><span>Number</span><span>)</span><span>
</span><span>combined</span><span> </span><span>&lt;-</span><span> </span><span>total_cases</span><span> </span><span>%>%</span><span>
</span><span>filter</span><span>(</span><span>Year</span><span> </span><span>==</span><span> </span><span>&quot;Total&quot;</span><span> </span><span>&amp;</span><span> </span><span>Court</span><span> </span><span>!=</span><span> </span><span>&quot;Annual Totals&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>select</span><span>(</span><span>Court</span><span>,</span><span> </span><span>Cases</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>left_join</span><span>(</span><span>scotus</span><span>,</span><span> </span><span>by</span><span> </span><span>=</span><span> </span><span>&quot;Court&quot;</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>rv_prop_cases</span><span> </span><span>=</span><span> </span><span>`Reversed + Vacated`</span><span> </span><span>/</span><span> </span><span>Cases</span><span>,</span><span>
</span><span>rv_prop_appealed</span><span> </span><span>=</span><span> </span><span>`Reversed + Vacated`</span><span> </span><span>/</span><span> </span><span>Appealed</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>arrange</span><span>(</span><span>desc</span><span>(</span><span>rv_prop_cases</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Court</span><span> </span><span>=</span><span> </span><span>factor</span><span>(</span><span>Court</span><span>,</span><span> </span><span>levels</span><span> </span><span>=</span><span> </span><span>Court</span><span>))</span><span>
</span><span>combined</span><span> </span><span>%>%</span><span>
</span><span>select</span><span>(</span><span>Court</span><span>,</span><span> </span><span>Cases</span><span>,</span><span> </span><span>rv_prop_cases</span><span>,</span><span> </span><span>rv_prop_appealed</span><span>,</span><span> </span><span>Appealed</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>gather</span><span>(</span><span>Denominator</span><span>,</span><span> </span><span>Proportion</span><span>,</span><span> </span><span>-</span><span>Court</span><span>,</span><span> </span><span>-</span><span>Cases</span><span>,</span><span> </span><span>-</span><span>Appealed</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Denominator</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>grepl</span><span>(</span><span>&quot;appealed&quot;</span><span>,</span><span> </span><span>Denominator</span><span>),</span><span> </span><span>&quot;Percentage of total appeals&quot;</span><span>,</span><span> </span><span>&quot;Percentage of total cases&quot;</span><span>),</span><span>
</span><span>Denominator_value</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>grepl</span><span>(</span><span>&quot;total cases&quot;</span><span>,</span><span> </span><span>Denominator</span><span>),</span><span> </span><span>Cases</span><span>,</span><span> </span><span>Appealed</span><span>))</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>Proportion</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>Court</span><span>,</span><span> </span><span>size</span><span> </span><span>=</span><span> </span><span>Cases</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>Denominator_value</span><span>))</span><span> </span><span>+</span><span>
</span><span># force x axis to go to zero by drawing an invisible line:
</span><span> </span><span>geom_vline</span><span>(</span><span>xintercept</span><span> </span><span>=</span><span> </span><span>0</span><span>,</span><span> </span><span>alpha</span><span> </span><span>=</span><span> </span><span>0</span><span>)</span><span> </span><span>+</span><span>
</span><span>facet_wrap</span><span>(</span><span>~</span><span>Denominator</span><span>,</span><span> </span><span>scales</span><span> </span><span>=</span><span> </span><span>&quot;free_x&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>geom_text</span><span>(</span><span>colour</span><span> </span><span>=</span><span> </span><span>&quot;steelblue&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_x_continuous</span><span>(</span><span>label</span><span> </span><span>=</span><span> </span><span>percent</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_size_area</span><span>(</span><span>&quot;Total original cases:&quot;</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>comma</span><span>)</span><span> </span><span>+</span><span>
</span><span>theme</span><span>(</span><span>legend.position</span><span> </span><span>=</span><span> </span><span>&quot;none&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;Federal courts of appeals cases reversed or vacated by the Supreme Court 1999 - 2008&quot;</span><span>,</span><span> </span><span>&quot;From the 9th Circuit, 80% of 175 cases that went to SCOTUS were overturned,
but that was only 0.12% of the 114,199 total cases originally decided by that circuit in the period.&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>caption</span><span> </span><span>=</span><span> </span><span>&quot;Data from http://www.americanbar.org/content/dam/aba/migrated/intelprop/magazine/LandslideJan2010_Hofer.authcheckdam.pdf
Analysis at http://ellisp.github.io&quot;</span><span>,</span><span>
</span><span>y</span><span> </span><span>=</span><span> </span><span>&quot;Appeals circuit\n\n&quot;</span><span>,</span><span>
</span><span>x</span><span> </span><span>=</span><span> </span><span>&quot;Horizontal position indicates the proportion of cases overturned by the Supreme Court.
The printed number is the denominator - total cases that could have been overturned at that stage.
The size is proportionate to the total cases decided by each circuit.&quot;</span><span>)</span><span> </span><span>grid.text</span><span>(</span><span>0.75</span><span>,</span><span> </span><span>0.26</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>&quot;But only a tiny percentage of the number\nof cases originally decided by the circuit judges.&quot;</span><span>,</span><span>
</span><span>gp</span><span> </span><span>=</span><span> </span><span>gpar</span><span>(</span><span>cex</span><span> </span><span>=</span><span> </span><span>0.75</span><span>,</span><span> </span><span>family</span><span> </span><span>=</span><span> </span><span>&quot;myfont&quot;</span><span>,</span><span> </span><span>col</span><span> </span><span>=</span><span> </span><span>&quot;grey50&quot;</span><span>))</span><span>
</span><span>grid.text</span><span>(</span><span>0.35</span><span>,</span><span> </span><span>0.3</span><span>,</span><span> </span><span>label</span><span> </span><span>=</span><span> </span><span>&quot;A high proportion of the small number of\ncases that are taken to the Supreme Court\ndo end up reversed or vacated.&quot;</span><span>,</span><span>
</span><span>gp</span><span> </span><span>=</span><span> </span><span>gpar</span><span>(</span><span>cex</span><span> </span><span>=</span><span> </span><span>0.75</span><span>,</span><span> </span><span>family</span><span> </span><span>=</span><span> </span><span>&quot;myfont&quot;</span><span>,</span><span> </span><span>col</span><span> </span><span>=</span><span> </span><span>&quot;grey50&quot;</span><span>))</span><span>
</span><span>#--------------barchart version------------
</span><span>combined</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>`Not considered by SCOTUS`</span><span> </span><span>=</span><span> </span><span>Cases</span><span> </span><span>-</span><span> </span><span>Appealed</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>select</span><span>(</span><span>Court</span><span>,</span><span> </span><span>`Not considered by SCOTUS`</span><span>,</span><span> </span><span>Affirmed</span><span>,</span><span> </span><span>`Reversed + Vacated`</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>gather</span><span>(</span><span>Result</span><span>,</span><span> </span><span>Number</span><span>,</span><span> </span><span>-</span><span>Court</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Result</span><span> </span><span>=</span><span> </span><span>ifelse</span><span>(</span><span>Result</span><span> </span><span>==</span><span> </span><span>&quot;Reversed + Vacated&quot;</span><span>,</span><span> </span><span>&quot;Overturned&quot;</span><span>,</span><span> </span><span>Result</span><span>),</span><span>
</span><span>Result</span><span> </span><span>=</span><span> </span><span>factor</span><span>(</span><span>Result</span><span>,</span><span> </span><span>levels</span><span> </span><span>=</span><span> </span><span>c</span><span>(</span><span>&quot;Overturned&quot;</span><span>,</span><span> </span><span>&quot;Affirmed&quot;</span><span>,</span><span> </span><span>&quot;Not considered by SCOTUS&quot;</span><span>)))</span><span> </span><span>%>%</span><span>
</span><span>ggplot</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>Court</span><span>,</span><span> </span><span>weight</span><span> </span><span>=</span><span> </span><span>Number</span><span>,</span><span> </span><span>fill</span><span> </span><span>=</span><span> </span><span>Result</span><span>))</span><span> </span><span>+</span><span>
</span><span>geom_bar</span><span>(</span><span>position</span><span> </span><span>=</span><span> </span><span>&quot;stack&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>coord_flip</span><span>()</span><span> </span><span>+</span><span>
</span><span>scale_y_continuous</span><span>(</span><span>label</span><span> </span><span>=</span><span> </span><span>comma</span><span>)</span><span> </span><span>+</span><span>
</span><span>scale_fill_discrete</span><span>(</span><span>guide</span><span> </span><span>=</span><span> </span><span>guide_legend</span><span>(</span><span>reverse</span><span> </span><span>=</span><span> </span><span>TRUE</span><span>))</span><span> </span><span>+</span><span>
</span><span>ggtitle</span><span>(</span><span>&quot;Federal courts of appeals cases reversed or vacated by the Supreme Court 1999 - 2008&quot;</span><span>)</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>caption</span><span> </span><span>=</span><span> </span><span>&quot;Data from http://www.americanbar.org/content/dam/aba/migrated/intelprop/magazine/LandslideJan2010_Hofer.authcheckdam.pdf
Analysis at http://ellisp.github.io&quot;</span><span>,</span><span>
</span><span>x</span><span> </span><span>=</span><span> </span><span>&quot;Appeals circuit&quot;</span><span>,</span><span> </span><span>y</span><span> </span><span>=</span><span> </span><span>&quot;Number of appeal cases&quot;</span><span>)</span><span>	</span></code></pre>
</figure>
<p>By the way, you might have asked (as I did) what do “vacated” and “reversed” mean? As far as I can tell, they have a similar effect in overturning the original decision. According to <a target="_blank" rel="nofollow" href="http://joshblackman.com/blog/2016/03/28/scotus-style-manual-on-difference-between-reverse-and-vacate/">Josh Blackman</a>,</p>
<blockquote>
<p>“Reverse is when things are really, really wrong. Vacate is when it is somewhat wrong.”</p>
</blockquote>
<h2>Inferential analysis</h2>
<p>I was interested in whether the different proportions overturned of Circuits’ total cases were statistically significant evidence of different rates. I expected that they would be; not so much because of differing Circuit culture and competence (although these would be expected to vary at least somewhat), as that different types of cases go to different Circuits. I would summarise the conclusion as significant evidence of a difference (p value from the ANOVA test below is basically zero, thanks to the large sample size of cases), but not a particularly material difference.</p>
<p>I fitted a generalized linear model with a binomial response (also known as logistic regression) to test this. Here are the confidence intervals for the effect on total overturnability (to coin a phrase) of the different Circuits, relative to the Eighth Circuit which I chose as a reference point because of its near-average performance.</p>
<p><img width="100%" src="http://ellisp.github.io/img/0081-model-results.svg"></p>
<p>And here’s the code for the model fitting and presentation:</p>
<figure>
<pre><code data-lang="r"><span>model_data</span><span> </span><span>&lt;-</span><span> </span><span>combined</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Court</span><span> </span><span>=</span><span> </span><span>relevel</span><span>(</span><span>factor</span><span>(</span><span>Court</span><span>),</span><span> </span><span>ref</span><span> </span><span>=</span><span> </span><span>&quot;Eighth Circuit&quot;</span><span>))</span><span>
</span><span>#----------------proportion of original------------
</span><span>model1</span><span> </span><span>&lt;-</span><span> </span><span>glm</span><span>(</span><span>rv_prop_cases</span><span> </span><span>~</span><span> </span><span>Court</span><span>,</span><span> </span><span>family</span><span> </span><span>=</span><span> </span><span>&quot;binomial&quot;</span><span>,</span><span> </span><span>weights</span><span> </span><span>=</span><span> </span><span>Cases</span><span>,</span><span> </span><span>data</span><span> </span><span>=</span><span> </span><span>model_data</span><span>)</span><span>
</span><span>anova</span><span>(</span><span>model1</span><span>,</span><span> </span><span>test</span><span> </span><span>=</span><span> </span><span>&quot;Chi&quot;</span><span>)</span><span>
</span><span>res</span><span> </span><span>&lt;-</span><span> </span><span>confint</span><span>(</span><span>model1</span><span>)[</span><span>-1</span><span>,</span><span> </span><span>]</span><span>
</span><span>res_df</span><span> </span><span>&lt;-</span><span> </span><span>as.data.frame</span><span>(</span><span>res</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Court</span><span> </span><span>=</span><span> </span><span>gsub</span><span>(</span><span>&quot;Court&quot;</span><span>,</span><span> </span><span>&quot;&quot;</span><span>,</span><span> </span><span>rownames</span><span>(</span><span>res</span><span>)),</span><span>
</span><span>center</span><span> </span><span>=</span><span> </span><span>(</span><span>`2.5 %`</span><span> </span><span>+</span><span> </span><span>`97.5 %`</span><span>)</span><span> </span><span>/</span><span> </span><span>2</span><span>)</span><span> </span><span>%>%</span><span>
</span><span>mutate</span><span>(</span><span>Court</span><span> </span><span>=</span><span> </span><span>fct_reorder</span><span>(</span><span>Court</span><span>,</span><span> </span><span>center</span><span>))</span><span>
</span><span>ggplot</span><span>(</span><span>res_df</span><span>,</span><span> </span><span>aes</span><span>(</span><span>y</span><span> </span><span>=</span><span> </span><span>Court</span><span>,</span><span> </span><span>yend</span><span> </span><span>=</span><span> </span><span>Court</span><span>,</span><span> </span><span>x</span><span> </span><span>=</span><span> </span><span>`2.5 %`</span><span>,</span><span> </span><span>xend</span><span> </span><span>=</span><span> </span><span>`97.5 %`</span><span>))</span><span> </span><span>+</span><span>
</span><span>geom_segment</span><span>()</span><span> </span><span>+</span><span>
</span><span>geom_point</span><span>(</span><span>aes</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>center</span><span>))</span><span> </span><span>+</span><span>
</span><span>labs</span><span>(</span><span>x</span><span> </span><span>=</span><span> </span><span>&quot;95% confidence interval for increase in logarithm of odds of a completed case being appealed successfully by Supreme Court, relative to the Eighth Circuit&quot;</span><span>,</span><span>
</span><span>y</span><span> </span><span>=</span><span> </span><span>&quot;&quot;</span><span>,</span><span>
</span><span>caption</span><span> </span><span>=</span><span> </span><span>&quot;Data from http://www.americanbar.org/content/dam/aba/migrated/intelprop/magazine/LandslideJan2010_Hofer.authcheckdam.pdf
Analysis at http://ellisp.github.io&quot;</span><span>)</span></code></pre>
</figure>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://ellisp.github.io/blog/2017/02/26/appeal-circuits"> Peter's stats stuff - R</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/vHgeKFDRkMg"></a></div>