How do I compute the weighted median income?
<p>I'm new to R and not very familiar with it. I want to calculate the At-Risk-Of-Poverty indicator (income is below 60% of the national median equivalized disposable income; <code>DB020</code> = country, <code>HX090</code> = equivalized disposable income) with the <code>EU-SILC</code> data. I use the laeken package and tried this code:</p>

<pre><code>hhregdata &lt;- hhregdata %&gt;% 
                   group_by("DB020") %&gt;% 
                   mutate(arp = "HX090" &lt; (weightedMedian("HX090", weight="DB090")*0.6))
</code></pre>

<p>But i get the error:</p>

<blockquote>
  <p>Error in eval(substitute(expr), envir, enclos) : 
    'x' must be a numeric vector</p>
</blockquote>

<p>What am I doing wrong?</p>