黃河泉 发表于 2019-3-16 17:59 
老师求助,您的代码是可以的,但是现在我需要按照hydm分组,求各组内sfwzx==3的fzlxlz的均值,然后再删除fzlxl大于均值的样本,需要怎么做?
----------------------- copy starting from the next line -----------------------
- * Example generated by -dataex-. To install: ssc install dataex
- clear
- input str60 dwxxmc int hydm byte sfwzx float fzlxl
- "杭州亿万饲料科技有限公司" 1320 3 .
- "杭州昌兴饲料有限公司" 1320 1 .0553824
- "杭州八鲜禽业有限公司" 1320 1 .03914649
- "浙江恒辉水产饲料有限公司" 1320 1 .017968317
- "浙江国茂饲料有限公司" 1320 1 .04656504
- "杭州科皇饲料有限公司" 1320 1 .03029735
- "杭州后秀饲料有限公司" 1320 1 .033720125
- "浙江明珠动物保健品有限公司" 1320 3 .
- "临安文华饲料有限公司" 1320 1 .04140253
- "杭州希望饲料厂" 1320 1 .
- end
- label values sfwzx _merge
- label def _merge 1 "master only (1)", modify
- label def _merge 3 "matched (3)", modify
复制代码------------------ copy up to and including the previous line ------------------