目前的:
*整理父亲的编码
use "/Users/rannie/STATA/CFPS/CFPS2018/三个都合并.dta"
keep pid qka203 qm509 qm510/*删除父亲主观态度外的变量*/
rename pid pid_a_f
save "/Users/rannie/STATA/CFPS/CFPS2018/合并父.dta"/*先保存一下*/
*整理母亲的编码
use "/Users/rannie/STATA/CFPS/CFPS2018/三个都合并的副本.dta"
keep pid qka203 qm509 qm510/*删除母亲除主观态度外的变量*/
rename pid pid_a_m
save "/Users/rannie/STATA/CFPS/CFPS2018/合并母.dta"/*先保存一下*/
use "/Users/rannie/STATA/CFPS/CFPS2018/三个都合并.dta"
merge m:1 pid_a_f using "/Users/rannie/STATA/CFPS/CFPS2018/合并父.dta"/*合并父亲的编码*/
drop _merge
merge m:1 pid_a_m using "/Users/rannie/STATA/CFPS/CFPS2018/合并母.dta"/*合并母亲的编码*/
drop _merge