黃河泉 发表于 2017-8-26 09:28
我觉得你可能需要:
前辈您好,我试了一下,还是没有得到满意的结果。
1.我需要的结果是每个代码每一年的结果是一致的。
2.如下图,是简化版的结果。最右列是我想要的结果。
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input str6 var10 str4 var11 str10 var12 str18 var13
"name" "year" "sctzggysly" "jieguo"
"000006" "2009" "3" "=(3-1)*(2-1)*(3-1)"
"000006" "2009" "2" "=(3-1)*(2-1)*(3-1)"
"000006" "2009" "3" "=(3-1)*(2-1)*(3-1)"
"000006" "2010" "4" "=(4-1)*(2-1)*(2-1)"
"000006" "2010" "2" "=(4-1)*(2-1)*(2-1)"
"000006" "2010" "2" "=(4-1)*(2-1)*(2-1)"
"000012" "2009" "4" "=(4-1)*(6-1)*(4-1)"
"000012" "2009" "6" "=(4-1)*(6-1)*(4-1)"
"000012" "2009" "4" "=(4-1)*(6-1)*(4-1)"
"000012" "2010" "3" ""
"000012" "2010" "2" ""
"000012" "2010" "1" ""