Hi,
I have a dataset in which I have households' expenditures over some months. For instance,
household_id, year, month, price
1, 2020, 2, 10.00
1, 2020, 3, 12.00
1, 2019, 5, 7.00
2, 2018, 1, 5.00
The dataset records expenditures only for those months that any purchase occurs and does not include months in which no purchase occurs.
I want to add all months for each household_id like below:
household_id, year, month, price
1, 2020, 1, 0.00
1, 2020, 2, 10.00
1, 2020, 3, 12.00
1, 2020, 4, 0.00
...
How can I do this?
Thanks,
I have a dataset in which I have households' expenditures over some months. For instance,
household_id, year, month, price
1, 2020, 2, 10.00
1, 2020, 3, 12.00
1, 2019, 5, 7.00
2, 2018, 1, 5.00
The dataset records expenditures only for those months that any purchase occurs and does not include months in which no purchase occurs.
I want to add all months for each household_id like below:
household_id, year, month, price
1, 2020, 1, 0.00
1, 2020, 2, 10.00
1, 2020, 3, 12.00
1, 2020, 4, 0.00
...
How can I do this?
Thanks,
Comment