title: How to do a weighted T-test in R?
body: <p>I have df1:</p>
  
  <pre><code>PopDens     Score1   Group
  93.53455  17.985288   B
  137.13861 10.549394   A
  35.98619  13.392857   A
  89.69800   8.644537   B
  16.27796  29.591635   A
  25.33346  21.081301   F
  89.69800   2.644537   C
  46.27796  29.591635   A
  25.33346   5.081301   B
  36.27796  29.591635   A
   1.33346   9.081301   B
  </code></pre>
  
  <p>I would like to perform a t-test between groups <code>A</code> and <code>B</code> looked at the difference in mean of <code>score1</code>. </p>
  
  <p>However, I want to weight the analysis so that rows with a larger <code>PopDens</code> have a stronger weight in the analysis. For example, I don't want the final row to have as much weight in the analysis as the second row because the population densities are very different. </p>
  
  <p>How is this done? </p>