楼主: 道心种魔
2777 3

[原创博文] 求大家帮忙解决一个PROC IML的题 [推广有奖]

  • 0关注
  • 1粉丝

大专生

75%

还不是VIP/贵宾

-

威望
0
论坛币
2343 个
通用积分
1.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
5008 点
帖子
23
精华
0
在线时间
74 小时
注册时间
2007-1-2
最后登录
2022-5-8

50论坛币
有一个数据,它包含10个变量和一个分类变量(classification variable)。
现在用前35个观察值(observation)来构造一个分类函数,以一个新观察值分为group1和group2。
这个method我们将用来解决 W:
   W.jpg
X是我们试图分类的10个变量中的一个向量(vector)
x1.png 是group1里面10个变量中的一个向量(vector),

x2.png 是group2里面10个变量中的一个向量(vector)  ,

Sp 是汇集group1和group2的10个变量的方差协方差的矩阵。

当W>0 时,分配X去group1,否则分配X去group2。

现在请分类最后五个观察值,也就是36-40的观察值。要求用SAS PROC  IML解决。

数据为:
  1. 2   1  3.55  410   0  17  43  61 129   3 2                                      
  2. 2   1  2.7   390   0  20  50  47  60   1 1                                      
  3. 2   1  3.5   510   0  22  47  79 119   1 1                                      
  4. 3   1  2.91  430   0  13  24  40 100   1 2                                      
  5. 2   1  3.1   600   0  16  47  60  79   2 1                                      
  6. 3   1  3.49  610   0  28  57  59  99   1 1                                      
  7. 1   0  3.17  610   0  14  42  61  92   3 1                                      
  8. 2   1  3.57  560   0  10  42  79 107   2 2                                      
  9. 3   1  3.76  700   1  28  69  83 156   1 1                                      
  10. 2   0  3.81  460   1  30  48  67 110   1 2                                      
  11. 2   0  3.6   590   1  28  59  74 116   1 1                                      
  12. 3   0  3.1   500   1  15  21  40  49   1 1                                      
  13. 1   1  3.08  410   0  24  52  71 107   5 2                                      
  14. 2   1  3.5   470   1  15  35  40 125   1 1                                      
  15. 2   1  3.43  210   1  26  35  57  64   5 2                                      
  16. 2   0  3.39  610   0  16  59  58 100   1 1                                      
  17. 2   0  3.76  510   1  25  68  66 138   2 1                                      
  18. 3   0  3.71  600   0   3  38  58  63   1 1                                      
  19. 2   1  3.00  470   1   5  45  24  82   3 1                                      
  20. 2   0  3.47  460   0  16  37  48  73   3 1                                      
  21. 2   1  3.69  800   1  28  54 100 132   2 1                                      
  22. 1   1  3.24  610   0  13  45  83  87   2 1                                      
  23. 2   1  3.46  490   0   9  31  70  89   2 2                                      
  24. 2   0  3.39  470   0  13  39  48  99   1 2                                      
  25. 2   0  3.9   610   1  30  67  85 119   2 1                                      
  26. 1   0  2.76  580   0  10  30  14 100   1 2                                      
  27. 2   1  2.7   410   0  13  19  55  84   2 2                                      
  28. 1   1  3.77  630   1   8  71 100 166   3 1                                      
  29. 2   1  4.00  790   1  29  80  94 111   2 1                                      
  30. 3   1  3.4   490   0  17  47  45 110   1 2                                      
  31. 2   0  3.09  400   0  15  46  58  93   1 1                                      
  32. 2   1  3.8   610   1  16  59  90 141   2 1                                      
  33. 1   1  3.28  610   1  13  48  84  99   2 2                                      
  34. 1   1  3.7   500   1  30  68  81 114   5 1                                      
  35. 2   1  3.42  430   1  17  43  49  96   1 1                                      
  36. 3   1  3.09  540   0  17  31  54  39   1 0                                      
  37. 1   1  3.7   610   0  25  64  87 149   4 0                                      
  38. 2   1  2.69  400   0  10  19  36  53   3 0                                      
  39. 3   1  3.4   390   0  23  43  51  39   1 0                                      
  40. 1   0  2.95  490   0  18  20  59  91   1 0
复制代码

请懂的高手帮帮忙。

x2.png (503 Bytes)

x2.png

x1.png (265 Bytes)

x1.png

关键词:求大家帮忙 ROC observation observat Variable method
沙发
yunqingwang 在职认证  发表于 2011-12-7 17:22:21 |只看作者 |坛友微信交流群
没看明白要干嘛,是在循环吗

使用道具

藤椅
道心种魔 发表于 2011-12-7 17:37:41 |只看作者 |坛友微信交流群
原文的要求如下:
It contains 10 measure (or variables) and a classification variable on the first 35 observations.  
The objective is to use this data (the first 35 observations) to construct a classification function which will be able to classify new observations into group 1 or 2.
The method we will use is to construct W, where:
W.jpg

Where X is a vector of the 10 measures on each person we are trying to classify.

x1.png

is a vector of means for the 10 measures of the observations in group 1.

x2.png

is a vector of means for the 10 measures of the observations in group 2.

Sp is the pooled variance covariance matrix of the 10 measures on the observations in groups 1 and 2.  

The decision rule is:  Assign X to group 1 if W > 0, otherwise assign X to group 2.  Please classify the last five observations in the file, observations 36-40.  Print your results and SAS PROC IML code.

使用道具

板凳
五福四海 发表于 2012-9-1 08:59:36 |只看作者 |坛友微信交流群
yunqingwang 发表于 2011-12-7 17:22
没看明白要干嘛,是在循环吗
应该是简单的

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-5-2 15:32