Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65573

Replace observations

$
0
0
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.

Viewing all articles
Browse latest Browse all 65573

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>