全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
7170 6
2017-06-06
clear
set obs 100
gen x=runiform(0,100)

哪里错了?
invalid syntax
r(198);


二维码

扫码加我 拉你入群

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

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

全部回复
2017-6-6 01:42:06
好像不是r代码?
二维码

扫码加我 拉你入群

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

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

2017-6-6 04:56:14
在我这里运行是没错的。重启试试~
二维码

扫码加我 拉你入群

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

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

2017-6-6 07:31:28
stata13 那个命令就不对
stata14那个命令就是对的

遇到问题为什么就不能看看人家软件的help文件的介绍
二维码

扫码加我 拉你入群

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

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

2017-6-6 11:50:42
蓝色 发表于 2017-6-6 07:31
stata13 那个命令就不对
stata14那个命令就是对的
谢谢老版主

我有看过help,也看过文件,只是的确没有发现他说只适用于14,因为我这里版本是13.1
runiform()
Range: 0 to nearly 1 (0 to 1 − 2−32)
Description: returns uniform random variates.
runiform() returns uniformly distributed random variates on the interval
[ 0, 1). runiform() takes no arguments, but the parentheses must be typed.
runiform() can be seeded with the set seed command; see the technical note at
the end of this subsection. (See Matrix functions for the related matuniform()
matrix function.)
To generate random variates over the interval [ a, b), use
a+(b-a)*runiform().
To generate random integers over [ a, b ], use a+int((b-a+1)*runiform()).

同时我也查看过这个错误代码,里面也没提到版本问题
[P]     error . . . . . . . . . . . . . . . . . . . . . . . .  Return code 198
        invalid syntax;
        option __________ incorrectly specified;
        option __________ not allowed;
        __________ invalid;
        range invalid;
        __________ invalid obs no;
        invalid filename;
        __________ invalid varname;
        __________ invalid name;
        multiple by's not allowed;
        __________ found where number expected;
        on or off required;


二维码

扫码加我 拉你入群

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

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

2017-6-6 12:26:08
stata13的
stata13.png
stata14的
stata14.png


怎么能没有区别呢
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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