title: Simple Adjustment of Payments based on Gender Distribution, Easy Fix?
body: <p>I would like to graph gender disparities in payments over time and would like to adjust them by the ratio of men to women.  Here is a header for my dataframe:</p>
  <pre><code># A tibble: 3,928 x 3
  # Groups:   gender [2]
     Date_of_Payment gender Daily_Total
     &lt;date&gt;          &lt;chr&gt;        &lt;dbl&gt;
   1 2013-08-01      female      23718.
   2 2013-08-01      male       151540 
   3 2013-08-02      female      16650.
   4 2013-08-02      male        31833.
   5 2013-08-03      female        147.
   6 2013-08-03      male         3074.
   7 2013-08-04      female        186.
   8 2013-08-04      male          954.
   9 2013-08-05      female      28451 
  10 2013-08-05      male        65211.
  
  </code></pre>
  <p>Assuming 59% of recipients were male and 41% were female, how do I adjust the Daily_Total to reflect that discrepancy?</p>
  <p>Would as simple adjustment by relative distribution suffice? Survey package? Thanks for any help!</p>
  <p>**** UPDATE ****</p>
  <p>Ok so based on feedback from stefan, here's the code as it stands:</p>
  <pre><code>
  &gt; df_gender %&gt;% 
  +   group_by(Date_of_Payment, gender, .drop = FALSE) %&gt;%
  +   summarize(Daily_Total= sum(Total_Amount_of_Payment_USDollars)) %&gt;%
  +   group_by(gender) %&gt;%
  +   mutate(adjusted_total = case_when(
  +     gender == &quot;female&quot; ~ Daily_Total / 0.41, 
  +     gender == &quot;male&quot; ~ Daily_Total / 0.59)) %&gt;% 
  +   mutate(adjusted_total = adjusted_total/2)
  # A tibble: 3,928 x 4
  # Groups:   gender [2]
     Date_of_Payment gender Daily_Total adjusted_total
     &lt;date&gt;          &lt;chr&gt;        &lt;dbl&gt;          &lt;dbl&gt;
   1 2013-08-01      female      23718.         28924.
   2 2013-08-01      male       151540         128424.
   3 2013-08-02      female      16650.         20304.
   4 2013-08-02      male        31833.         26977.
   5 2013-08-03      female        147.           179.
   6 2013-08-03      male         3074.          2605.
   7 2013-08-04      female        186.           227.
   8 2013-08-04      male          954.           809.
   9 2013-08-05      female      28451          34696.
  10 2013-08-05      male        65211.         55263.
  # … with 3,918 more rows
  
  </code></pre>
  <p>I divided by 2 at the end to bring the numbers back down.</p>
  <p>Does this look methodologically sound?</p>