title: Application of weighted.mean() does not affect result?
body: <p>I want to apply weights to the average. I would expect the weights having <em>some</em> form of effect. However, the weights (pspwght*pweight) have zero effect on the mean (compared to when not using weights).</p>
  <pre><code># Calculate mean total 
  total_mean &lt;- ESS_subset_au %&gt;%
    select(cntry, stfdem, wl) %&gt;%
    group_by(cntry) %&gt;%
    na.omit() %&gt;%
    summarize(avg = weighted.mean(stfdem, na.rm = T, weights = weight*pspwght))
  </code></pre>
  <p>This is the data that I am using:</p>
  <pre><code>ESS_subset_au = structure(list(idno = c(10105L, 10107L, 10109L, 10201L, 10202L, 
  10208L, 10209L, 10302L, 10305L, 10306L, 10307L, 10308L, 10309L, 
  10401L, 10405L), cntry = c(&quot;BE&quot;, &quot;BE&quot;, &quot;BE&quot;, &quot;BE&quot;, &quot;BE&quot;, &quot;BE&quot;, 
  &quot;BE&quot;, &quot;BE&quot;, &quot;BE&quot;, &quot;BE&quot;, &quot;BE&quot;, &quot;BE&quot;, &quot;BE&quot;, &quot;BE&quot;, &quot;BE&quot;), stfdem = c(5L, 
  1L, 6L, 9L, 2L, 7L, 9L, 10L, 7L, 6L, 6L, 2L, 5L, 7L, 8L), polintr = c(3L, 
  3L, 3L, 3L, 3L, 2L, 2L, 4L, 3L, 3L, 3L, 1L, 2L, 3L, 4L), dweight = c(1, 
  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), pspwght = c(1.28970534688181, 
  0.853106648103221, 1.28441114836477, 1.29301264667416, 0.862898819342774, 
  0.853106648103221, 0.855294341165787, 0.862898819342774, 1.28970534688181, 
  0.858825994323025, 0.855294341165787, 0.853112832617122, 1.28441114836477, 
  0.862898819342774, 0.859350417967113), pweight = c(0.492718566, 
  0.492718566, 0.492718566, 0.492718566, 0.492718566, 0.492718566, 
  0.492718566, 0.492718566, 0.492718566, 0.492718566, 0.492718566, 
  0.492718566, 0.492718566, 0.492718566, 0.492718566), gnd.rc = c(0, 
  0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1), age.rc = c(1, 3, 7, 
  2, 2, 3, 4, 3, 1, 3, 4, 5, 7, 3, 4), job.rc = c(0, 1, 0, 1, 1, 
  1, 1, 0, 0, 0, 1, 1, 0, 0, 0), inc.rc = c(NA, 2, 1, 1, 2, 2, 
  NA, 2, 2, 2, 2, 3, 1, 1, 1), pid.rc = c(0, 0, 0, 0, 1, 1, 0, 
  0, 1, 0, 1, 1, 1, 0, 0), edu.rc = c(2, 4, 2, 2, 2, 4, 3, 2, 2, 
  4, 4, 3, 2, 2, 2), trstinst = c(5.5, 3, 1.7, 6.8, 7.2, 6.3, 7.8, 
  8.3, 5.8, 6, 4.5, 4, 5, 4.8, 8), wl = c(NA, NA, NA, NA, 0, 0, 
  1, NA, NA, 0, 1, 0, 1, 0, NA), Inflation = c(1.11309594, 1.11309594, 
  1.11309594, 1.11309594, 1.11309594, 1.11309594, 1.11309594, 1.11309594, 
  1.11309594, 1.11309594, 1.11309594, 1.11309594, 1.11309594, 1.11309594, 
  1.11309594), GDPg = c(0.459242193, 0.459242193, 0.459242193, 
  0.459242193, 0.459242193, 0.459242193, 0.459242193, 0.459242193, 
  0.459242193, 0.459242193, 0.459242193, 0.459242193, 0.459242193, 
  0.459242193, 0.459242193), GDPpc = c(44355.37731, 44355.37731, 
  44355.37731, 44355.37731, 44355.37731, 44355.37731, 44355.37731, 
  44355.37731, 44355.37731, 44355.37731, 44355.37731, 44355.37731, 
  44355.37731, 44355.37731, 44355.37731), Enep = c(10.04, 10.04, 
  10.04, 10.04, 10.04, 10.04, 10.04, 10.04, 10.04, 10.04, 10.04, 
  10.04, 10.04, 10.04, 10.04), PR = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
  1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L)), row.names = c(NA, 15L), class = &quot;data.frame&quot;)
  </code></pre>
  <p>What do I miss?</p>
  <p>Thank you!</p>