Hi, I have a dataset that looks a little like this:
household id stove fridge wardrobe water pump
1 2 0 4 0
2 0 1 3 2
3 4 0 1 1
I would like to generate a variable summing how many different types of asset each household owns but I am unsure as to how to replace values greater than 1 with just the value 1 to signify whether they own that asset (as I don't need the number of each asset that each has). I have tried the 'egen assets = rowtotal()' but I am not sure how to add the replace command to this.
would be super appreciative for any help! thanks in advance!
household id stove fridge wardrobe water pump
1 2 0 4 0
2 0 1 3 2
3 4 0 1 1
I would like to generate a variable summing how many different types of asset each household owns but I am unsure as to how to replace values greater than 1 with just the value 1 to signify whether they own that asset (as I don't need the number of each asset that each has). I have tried the 'egen assets = rowtotal()' but I am not sure how to add the replace command to this.
would be super appreciative for any help! thanks in advance!
Comment