title: How to find the outliers of a Ruby array/hash of integers?
body: <p>Here is my input:</p>
  
  <pre><code>[{name: 'John', age: 50}, {name: 'Bob', age: 50}, {name: 'Paul', age: 0}, {name: 'Alfred', age: 100}]
  </code></pre>
  
  <p>I want to find the extreme ages, and I want to be able to put in as a variable how sensible the extremes should be. So, for example I would put in that I want to find the 10% most extreme values. So e.g. the output would be something like this:</p>
  
  <pre><code># the extreme min values =&gt; [{name: 'Paul', age: 0}]
  # the extreme max values =&gt; [{name: 'Alfred', age: 100}]
  </code></pre>
  
  <p>How do I do that?</p>
  
  <p>I found some resources online that might help, but honestly I'm not able to follow the examples myself:</p>
  
  <p><a href="http://sciruby.com/blog/2013/11/07/statistics-with-ruby-time-series-and-general-linear-models/" rel="nofollow">http://sciruby.com/blog/2013/11/07/statistics-with-ruby-time-series-and-general-linear-models/</a>
  <a href="http://statsample.apsique.cl/Statsample/Graph/Boxplot.html" rel="nofollow">http://statsample.apsique.cl/Statsample/Graph/Boxplot.html</a></p>