1.最原始的做法
gen area=1 if province=="北京市"|province=="天津市"|province=="河北省"|province=="上海市"|province=="江苏省"|province=="浙江省"|province=="福建省"|province=="山东省"|province=="广东省"|province=="海南省" //东部地区
2. inlist命令
gen area=1 if inlist2(CITY,"北京市","天津市","河北省,"上海市","江苏省","浙江省","福建省","山东省","广东省","海南省") ///如果超过10个省份,这个命令将无法运行