楼主: zhangzachary
3466 7

[原创博文] Question on RANUNI [推广有奖]

  • 8关注
  • 18粉丝

讲师

11%

还不是VIP/贵宾

-

威望
0
论坛币
338 个
通用积分
456.1783
学术水平
38 点
热心指数
49 点
信用等级
30 点
经验
54925 点
帖子
348
精华
0
在线时间
501 小时
注册时间
2011-7-20
最后登录
2023-9-11

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
Hello,
I have tried the program:
  1. data _null_;
  2. do i=1 to 10;
  3. a=ranuni(1);
  4. put a;
  5. end;
  6. run;
复制代码

and it returned:
0.1849625698
0.9700887157
0.3998243061
0.2593986454
0.9216025779
0.9692773498
0.5429791731
0.5316917228
0.0497940262
0.0665665516

but when i re-ran the program, the result didn't change...
I don't know why...
*** the function RANUNI returns a random value from (0,1) doesn't it? ***

thanks in avance!
二维码

扫码加我 拉你入群

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

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

关键词:question ranuni Quest ANU Est function returns result null

沙发
爱萌 发表于 2011-8-30 19:18:50 |只看作者 |坛友微信交流群
because the random seed is keep constant,you can try with random seed 0
最恨对我说谎或欺骗我的人

使用道具

藤椅
zhangzachary 发表于 2011-8-30 20:03:51 |只看作者 |坛友微信交流群
爱萌 发表于 2011-8-30 19:18
because the random seed is keep constant,you can try with random seed 0
thank you very much~~ and i found the explanation in the help document:

Random-number functions and CALL routines generate streams of random numbers from an initial starting point, called a seed, that either the user or the computer clock supplies. A seed must be a nonnegative integer with a value less than 231-1 (or 2,147,483,647). If you use a positive seed, you can always replicate the stream of random numbers by using the same DATA step. If you use zero as the seed, the computer clock initializes the stream, and the stream of random numbers is not replicable.

寒冰凤凰 My blog: http://blog.sina.com.cn/u/1058955485

使用道具

板凳
leedx 发表于 2011-8-30 21:22:08 |只看作者 |坛友微信交流群
learning,thank you very much~~~

使用道具

报纸
sunset1986 发表于 2012-2-23 22:44:50 |只看作者 |坛友微信交流群
thx for sharing
An honest tale speeds best being plainly told.
Cheers!

使用道具

地板
flutter88 发表于 2012-2-24 10:12:43 |只看作者 |坛友微信交流群
伪随机数

使用道具

7
944536616@qq.co 发表于 2016-6-8 15:22:23 |只看作者 |坛友微信交流群
不错,学到很多

使用道具

8
944536616@qq.co 发表于 2016-6-8 15:28:51 |只看作者 |坛友微信交流群
ranuni(1) or ranuni(0),口号里面的种子是如何确定的?有没有什么要求?
谢谢!

使用道具

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

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

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

GMT+8, 2024-5-1 12:50