楼主: zespri
5882 16

[原创博文] 请问: 如何把tabulate结果存为SAS数据 [推广有奖]

11
crackman 发表于 2010-7-6 14:54:39
7# pobel title;
proc tabulate data=sashelp.class out=results;
                var weight height;
                table weight "weight" ,(mean*f=7.2 n*f=5.0);
                table height "height",(mean*f=7.2 n*f=5.0);/*不要用**/
run;

data results;
     set results;
         Var=ifc(_table_=1,"Weight","Height");
         Mean=ifn(_table_=1,weight_mean,height_mean);
         N=ifn(_table_=1,weight_n,height_n);
         keep var mean n;
run;

12
crackman 发表于 2010-7-6 14:56:08
IFC在9.2中可以用

13
pobel 在职认证  发表于 2010-7-6 14:59:47
11# crackman
敬请版主指教
和谐拯救危机

14
zespri 发表于 2010-7-6 15:07:19
10# pobel


谢谢了

15
zespri 发表于 2010-7-6 15:10:51
11# crackman

请问版主, 为什么? (没有错啊)

table height "height",(mean*f=7.2 n*f=5.0);/*不要用**/

16
crackman 发表于 2010-7-6 18:04:30
table height "height",(mean*f=7.2 n*f=5.0);/*不要用*号*/


proc tabulate data=sashelp.class out=results;
                var weight height;
                table weight*"Weight", (mean*f=7.2 n*f=5.0);
                table height*"height", (mean*f=7.2 n*f=5.0);

/*上面标红的语句   weight*"Weight" 中间的*号我运行的时候出错了,除掉就可以了  */
run;

data results;
     set results;
         Var=ifc(_table_=1,"Weight","Height");
         Mean=ifn(_table_=1,weight_mean,height_mean);
         N=ifn(_table_=1,weight_n,height_n);
         keep var mean n;
run;
已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 3 精彩帖子

总评分: 经验 + 3  论坛币 + 3   查看全部评分

17
zespri 发表于 2010-7-7 07:30:27
16# crackman


感谢

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

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