I have a education variable, q15_educ, in my data set and I need to create a new education variable, educ, based on that. I have a method, but do you have easier method?

Array

Code:
gen educ = 1 if (q15_educ == "High school graduate, diploma or equivalent") | (q15_educ == "Some high school") | (q15_educ == "Trade/Technical/vocational training")
replace educ = 2 if (q15_educ == "Associate degree") | (q15_educ == "Bachelor's degree") | (q15_educ == "Some college credit, no degree") 
replace educ = 3 if (q15_educ == "Doctorate degree") | (q15_educ == "Master's degree")