Q:生成dummy但是条件太多(string太长)
A:参考【 】合成控制法时候expression too long错误解决问题 - Stata专版 - 经管之家(原人大经济论坛) (pinggu.org)
local code1 ""C25","C26","C27","C28""
local code2 ""C29","C31","C32","C34""
local code3 ""C35","C36","C37","C38""
local code4 ""C39","C40","C41","I63""
local code5 ""I64","I65","M73""
gen hightech = inlist(industry,`code1') | inlist(industry,`code2')| inlist(industry,`code3')| inlist(industry,`code4')| inlist(industry,`code5')
Q:如何生成含有某个字段的dummy
A:参考【 】【求助】如何用stata查询不包含某一字符串的数据 - Stata专版 - 经管之家(原人大经济论坛) (pinggu.org)
gen PC=0
replace PC=1 if regexm( ActualControllerNatureID ,"1100")==1