Dear All, I found this question here (in Chinese). Suppose that I have the data
For each company (`stkcd'), there are two auditors (`auditor1' and `auditor2'). For this company (000002), there are two auditors "赵奇" (auditor1) and "罗科" (auditor2) in year 2002. In year 2003, there are two auditors "罗科" (auditor1) and "金乃雯" (auditor2). Since "罗科" is auditor2 in the previous year, I'd like to put "罗科" into auditor2 in year 2003 (Of course, "金乃雯" is now auditor1). That is, whether a person is auditor1 or auditor2 depends on its status (1 or 2) in the prior year.
The purpose is to obtain
Any suggestions are highly appreciated.
Code:
// https://bbs.pinggu.org/thread-11172305-1-1.html * Example generated by -dataex-. For more info, type help dataex clear input str12 stkcd double year str54 auditor1 str18 auditor2 "000002" 2000 "许丽周" "李莉" "000002" 2001 "赵奇" "金乃雯" "000002" 2002 "赵奇" "罗科" "000002" 2003 "罗科" "金乃雯" "000002" 2004 "罗科" "彭菁" "000002" 2005 "李婉薇" "彭菁" "000002" 2006 "李婉薇" "彭菁" end
The purpose is to obtain
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str12 stkcd double year str54 auditor1 str18 auditor2 "000002" 2000 "许丽周" "李莉" "000002" 2001 "赵奇" "金乃雯" "000002" 2002 "赵奇" "罗科" "000002" 2003 "金乃雯" "罗科" "000002" 2004 "彭菁" "罗科" "000002" 2005 "彭菁" "李婉薇" "000002" 2006 "彭菁" "李婉薇" end

Comment