Group categories in a string variable based on first letters

#1
Referral_Serv
Childcare 3
School 4
other:foster 2
othersocial 1
otherHousing 1

I would like to group all the "other" categories into only ONE "other".

Anyone? thanks!
 

bukharin

RoboStataRaptor
#2
One option would simply be to use -replace- along with a string matching function such as substr(), regexm() or strpos(). For example:
replace Referral_Serv="Other" if substr(lower(Referral_Serv), 1, 5)=="other"

(I also used the lower() function in case Referral_Serv started with "Other" rather than "other")