I have this data frame where I should count for each household how much monetary support they should get;
My data looks like this:
| hh_id | gender | hh_income |
|---|---|---|
| 1 | F | 563 |
| 1 | H | 563 |
| 1 | H | 563 |
| 2 | F | 0 |
| 2 | F | 0 |
| 2 | F | 0 |
| 3 | H | 0 |
| 3 | F | 0 |
Those with the same hh_id are from the same household;
If hh_icome == 0; I should count how many people are in that household and multiply that number by 175$ and that is the hh_income for that hh.
Example: the hh with the Id == 2 has the income of 0; have 3 individuals so The income should change from 0 to 3*175=525; so the data for that he would look like this:
| hh_id | gender | hh_income |
|---|---|---|
| 2 | F | 525 |
| 2 | F | 525 |
| 2 | F | 525 |
any ideas please;
best regards