全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1954 5
2010-09-09
如题.2.13%  4.62%  -2.32%等等如何导入数据集?
二维码

扫码加我 拉你入群

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

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

全部回复
2010-9-9 22:22:47
复制代码
二维码

扫码加我 拉你入群

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

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

2010-9-10 12:54:33
2# soporaeternus
谢谢高手!太厉害了.请问高手percent 8.2后面的8.2怎么解释?
二维码

扫码加我 拉你入群

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

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

2010-9-10 13:47:20
PERCENTw.d 中,w表示宽度,d表示对读取的数字除以10的d次方,当数中有小数点时,d不起作用。

data test;
     input a : percent8.1  b : percent8.2;
       put a=     @10 b=;
        datalines;
15%    15%
15.%   15.%
0.23   0.23
1   1
1.    1.
;
二维码

扫码加我 拉你入群

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

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

2010-9-10 13:58:18
From SAS Help:
Syntax
PERCENTw.d  
Syntax Description
w
specifies the width of the input field.
Default: 6
Range: 1-32
d
optionally specifies the power of 10 by which to divide the value. If the data contain decimal points, the d value is ignored.
Range: 0-31
--------------------------------------------------------------------------------
Details
The PERCENTw.d informat converts the numeric portion of the input data to a number using the same method as the COMMAw.d informat. If a percent sign (%) follows the number in the input field, PERCENTw.d divides the number by 100.

觉得很难说清楚,CV了SAS的帮助
下面的代码和输出可能说明一些问题
复制代码
LOG:

126  data _null_;
127      input x:percent8. y:percent8.2 z:percent8.4;
128      put x= y= z=;
129      datalines;

x=323 y=3.23 z=0.0323
x=3.23 y=0.0323 z=0.000323
x=0.2 y=0.2 z=0.2
x=3.22222 y=0.04322 z=0.031222
NOTE: “DATA 语句”所用时间(总处理时间):
      实际时间         0.00 秒
      CPU 时间         0.00 秒


134      ;
135  run;

1 源数据有%,则源数据 /100 否则不除
2 源数据有小数点,源数据导入,无小数点则按percentw.d的中源数据 /10^d输入

我开始晕了,求高手补充
二维码

扫码加我 拉你入群

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

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

2010-9-10 19:40:51
5# soporaeternus
谢谢副教授和博士的鼎力相助,其乐于助人和学术严谨的态度实在让我膜拜!
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群