Hi,
I have a dataset looks like this:
I want to replace the value of the location by the most frequently happened one. For instance, for id 1, "A" appears 4 times, so I want to replace all the locations for id 1 to "A", and "E" to id 2.
I wonder if anyone knows how to realize this in stata.
Thank you !
I have a dataset looks like this:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str2 id str8 location "1" "A" "1" "A" "1" "A" "1" "A" "1" "B" "1" "B" "1" "C" "2" "E" "2" "E" "2" "C" end
I wonder if anyone knows how to realize this in stata.
Thank you !
Comment