楼主: andybee
20825 19

[数据管理求助] 如何找到数据最10%和90%分位点,然后删掉大于90%和小于是10%的样本点 [推广有奖]

11
lianzhongren 发表于 2015-1-18 10:25:56
受教了,多谢

12
zhaijiali 发表于 2015-4-14 14:08:10
太有用啦

13
auirzxp 学生认证  发表于 2015-4-14 14:15:52
提示: 作者被禁止或删除 内容自动屏蔽

14
shy1130 发表于 2015-9-28 22:39:08
haoxianghenyu daoli

15
powelton 发表于 2015-9-29 23:30:45
保存!保存

16
阿璇2016 发表于 2016-8-11 17:07:40
你好,我想问一下,一组变量的分布是这样的:先大于70的,然后是小于70的,最后又升到了70以上。但是有的小于70的会夹杂着个别大于70的数,或者大于70的数会夹杂一些小于70的数。有没有一种办法能让stata按照分类的方法,忽略个别异常的数,分成3类?????

17
zabbyy 发表于 2017-2-9 21:57:54
受教了,多谢

18
lcqqbb 发表于 2017-7-17 11:23:31
受教了!

19
黃河泉 在职认证  发表于 2017-7-17 16:42:14
连老师的 (ssc install) winsor2 很方便使用:
  1. In defult, winsor2 winsorize wage at 1th and 99th percentiles,

  2.         . winsor2 wage, replace cuts(1 99)

  3.     which can be done by hands:

  4.         . replace wage=1.930993 if wage<1.930993
  5.         . replace wage=38.70926 if wage>38.70926

  6.     Note that, values smaller than the 1th percentile is repalce by the 1th percentile, and the similar thing is done with the 99th percentile.

  7.     Things change when -trim- option is specified:

  8.         . winsor2 wage, replace cuts(1 99) trim

  9.     which can also be done by hands:

  10.         . replace wage=. if wage<1.930993
  11.         . replace wage=. if wage>38.70926
复制代码

20
Bernard9303 发表于 2019-1-12 16:41:44

连老师的 (ssc install) winsor2的确很强大

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-31 16:32