楼主: GuiiuG
3670 6

sas code 去掉outliers [推广有奖]

  • 4关注
  • 1粉丝

硕士生

83%

还不是VIP/贵宾

-

威望
0
论坛币
27 个
通用积分
8.8500
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
8863 点
帖子
131
精华
0
在线时间
177 小时
注册时间
2011-11-17
最后登录
2022-10-12

楼主
GuiiuG 发表于 2013-1-26 01:37:47 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
有谁知道去掉极值的outliers 的sas code 怎么写吗
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Outliers outlier Liers outl code

沙发
yongyitian 发表于 2013-1-26 11:00:26
Suppose you have a dataset test, run

proc univariate data=test;
   var _numeric_;
run;

From output window, you can find 5 lowest and 5 highest values for each variable, such as this
                                     Extreme Observations
                              ----Lowest----        ----Highest----
                              Value      Obs         Value      Obs
                               1.20       37         16.35       63
                               2.21       88         18.95       23
                               3.19       82         18.95       40
                               3.50       19         19.34       16
                               3.52       77         22.46        1

then delete the obsrvations you don't want.

data test_1;
    set test;
    if _N_ = 1 then delete;
run;
已有 2 人评分经验 论坛币 学术水平 热心指数 收起 理由
webgu + 60 + 10 + 5 热心帮助其他会员
Imasasor + 60 + 1 热心帮助其他会员

总评分: 经验 + 60  论坛币 + 70  学术水平 + 1  热心指数 + 5   查看全部评分

藤椅
webgu 发表于 2013-1-26 11:26:00
data class;
  set sashelp.class;
run;

ods output extremeobs=outliers;
proc univariate data=class;
  var height;
run;

proc sql noprint;
  select lowobs, highobs
  into: lowobs separated by ' ' ,: highobs  separated by ' '
  from outliers;
quit;

%put  &lowobs   &highobs;

data want;
   set class;
if _n_ not in(&lowobs &highobs);
run;
SAS资源
1. SAS 微信:StatsThinking
2. SAS QQ群:348941365

板凳
webgu 发表于 2013-1-26 11:38:55
但是认真说来,确定一个值是否是outlier,并不是简单的最小,最大的五个值。可能还要看强影响点,杠杆值,并依据经验,专业知识。
SAS资源
1. SAS 微信:StatsThinking
2. SAS QQ群:348941365

报纸
playmore 发表于 2013-1-26 16:54:33
这个就是winsorize
用SAS+winsorize作为关键词在google上搜就可以找到现成的宏
我记得我在版上也贴过,你找找看吧
playmore邀请您访问ChinaTeX论坛!!!进入ChinaTeX论坛

地板
Bridgenc 发表于 2013-1-26 21:34:03
removing 1% or 99% extreme may not be perfect, ROBUSTREG Procedure could give more reasonable idea,
here is example
http://support.sas.com/onlinedoc ... hlp/rreg_sect27.htm
已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
webgu + 60 + 60 + 1 + 1 + 1 精彩帖子

总评分: 经验 + 60  论坛币 + 60  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

7
webgu 发表于 2013-1-26 22:41:08
Bridgenc 发表于 2013-1-26 21:34
removing 1% or 99% extreme may not be perfect, ROBUSTREG Procedure could give more reasonable idea,
...
非常受用的实例。
SAS资源
1. SAS 微信:StatsThinking
2. SAS QQ群:348941365

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-30 19:49