How can I replace an observation with the value of a other observation?
I have some observations with Brand = n/a, but I have the name of the Retailer.
In the case the Brand = n/a, Brand should become the same as Retailer.
This holds for a lot of different retailers, so is there a easy solution for doing this at once.
I know I can do it this way:
replace Brand = "WalMart" if Brand=="n/a" & Retailer=="WalMart"
But since I have a lot of different retailers around the world, this will take me a long time to do this for all the retailers where this holds for.
I have some observations with Brand = n/a, but I have the name of the Retailer.
In the case the Brand = n/a, Brand should become the same as Retailer.
This holds for a lot of different retailers, so is there a easy solution for doing this at once.
I know I can do it this way:
replace Brand = "WalMart" if Brand=="n/a" & Retailer=="WalMart"
But since I have a lot of different retailers around the world, this will take me a long time to do this for all the retailers where this holds for.