title: How to remove outliers from data set using Cook's distance?
body: <p>We are required to remove outliers/influential points from the data set in a model. I have <code>400</code> observations and <code>5</code> explanatory variables.</p>
  
  <p>I have tried this:</p>
  
  <pre><code>Outlier &lt;- as.numeric(names (cooksdistance)[(cooksdistance &gt; 4 / sample_size)))
  </code></pre>
  
  <p>Where Cook's distance is the calculated Cook's distance for the model.</p>
  
  <p>The problem is that this doesn’t give me the actual outliers.</p>