title: Remove outliers from correlation coefficient calculation
body: <p>Assume we have two numeric vectors <code>x</code> and <code>y</code>. The Pearson correlation coefficient between <code>x</code> and <code>y</code> is given by</p>
  
  <blockquote>
    <p>cor(x, y)</p>
  </blockquote>
  
  <p>How can I automatically consider only a subset of <code>x</code> and <code>y</code> in the calculation (say 90%) as to maximize the correlation coefficient?</p>