楼主: zhangzachary
3729 7

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

  • 8关注
  • 18粉丝

讲师

11%

还不是VIP/贵宾

-

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

楼主
zhangzachary 发表于 2011-8-30 17:29:46 |AI写论文

+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
拉您进交流群
GMT+8, 2025-12-9 06:35