大家好,昨天检查数据的时候,发现一个点,是关于govcon1和govcon1_p两个变量的,大家可以修改一下,修改方法如下:
请大家输入如下代码:
drop govcon1 govcon1_p
gen govcon1 = 1 if ustrregexm(S0702b, "1100") ///
| ustrregexm(S0702b, "1210") ///
| ustrregexm(S0702b, "2000") ///
| ustrregexm(S0702b, "2100") ///
| ustrregexm(S0702b, "2120")
replace govcon1 = 0 if govcon1 ==.
label define govcon1 1 "国有控股" 0 "非国有控股"
label value govcon1 govcon1
label var govcon1 "是否为国有控股-依据实际控制人性质筛选"
gen govcon1_p = 1 if ustrregexm(S0702b_p, "1100") ///
| ustrregexm(S0702b_p, "1210") ///
| ustrregexm(S0702b_p, "2000") ///
| ustrregexm(S0702b_p, "2100") ///
| ustrregexm(S0702b_p, "2120")
replace govcon1_p = 0 if govcon1_p ==.
label define govcon1_p 1 "国有控股" 0 "非国有控股"
label value govcon1_p govcon1_p
label var govcon1_p "是否为国有控股-依据实际控制人性质筛选"
输入完上述代码以后,可以重新保存一下数据,保存前可以先给变量排个序(不排序也可以)
