----------------------- copy starting from the next line -----------------------
- * Example generated by -dataex-. To install: ssc install dataex
- clear
- input str6 name int year byte zhi str9 bili
- "000001" 2007 2 "2/(2+4+3)"
- "000001" 2008 3 "3/(3+5+2)"
- "000001" 2009 4 "4/(4+7+1)"
- "000002" 2007 4 ""
- "000002" 2008 5 "5/(3+5+2)"
- "000002" 2009 7 ""
- "000003" 2007 3 ""
- "000003" 2008 2 ""
- "000003" 2009 1 ""
- end
------------------ copy up to and including the previous line ------------------
如图所示,需要得到每一个样本中zhi在每一年所占的比例。也就是000001样本2007年zhi占所有样本2007年zhi的加总的比重,不知道应该如何做呢?谢谢啦!