楼主: zchq100
4494 13

[原创博文] 有求某一列数据缺失值个数的函数吗? [推广有奖]

11
zchq100 发表于 2012-6-1 00:09:35 |只看作者 |坛友微信交流群
感谢楼上各位高手。

使用道具

12
bobguy 发表于 2012-6-1 06:55:06 |只看作者 |坛友微信交流群
SAS  functions operate on rows. You can use proc means to have a simple statistics for all USEFUL numerc variables.

data t1;
   r=0.1;
   do i=1 to 100;
      x=rannor(123); x2=(x+r*rannor(123))/sqrt(1+r**2);
          y=0.001+1*x+1*x2>rannor(123);
          if mod(i,5)=0 then x=.;
      else if mod(i,6)=0 then x2=.;
          output;
        end;
run;

proc means data=t1 n nmiss mean std skew kurt;
var _numeric_;
run;

使用道具

13
sunset1986 发表于 2012-7-3 14:24:39 |只看作者 |坛友微信交流群
bobguy 发表于 2012-6-1 06:55
SAS  functions operate on rows. You can use proc means to have a simple statistics for all USEFUL nu ...
赞!!!!!
An honest tale speeds best being plainly told.
Cheers!

使用道具

14
darkworld 发表于 2012-7-3 15:20:14 |只看作者 |坛友微信交流群
bobguy 发表于 2012-6-1 06:55
SAS  functions operate on rows. You can use proc means to have a simple statistics for all USEFUL nu ...
对啊,直接用proc means的nmiss不是很方便?

使用道具

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

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

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

GMT+8, 2024-5-21 19:19