楼主: belindade
5482 2

求助:GAUSS数据输入的随机选择 [推广有奖]

  • 0关注
  • 2粉丝

博士生

59%

还不是VIP/贵宾

-

威望
0
论坛币
2223 个
通用积分
0.0051
学术水平
3 点
热心指数
4 点
信用等级
2 点
经验
20518 点
帖子
92
精华
0
在线时间
536 小时
注册时间
2006-1-20
最后登录
2018-12-16

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
我现在有上千组数据,要随机从中抽取500组,load到GAUSS中进行数据分析,哪位高手指点一下,我该怎么做?
二维码

扫码加我 拉你入群

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

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

关键词:GAUSS 数据输入 Aus USS 数据分析 求助 数据 随机 GAUSS 输入

沙发
zhaosweden 发表于 2006-2-20 03:42:00 |只看作者 |坛友微信交流群

Simple. Suppose you have 1110 groups of data (let us say vectors).

Firstly you can import all the 1110 groups into your disk and saved them in a matrix, say matrix A.

Now suppose you have 1110 rows for the matrix.

then define a 2*1110 matrix (say matrix B), 1st col for the indexes, from row 1: 1, row2:2, ..., last row: 1110.

then draw 1110*1 vector of uniform(0,1) random numbers. store this vector into the 2nd col of this matrix B.

then sort matrix B on the 2nd col, say from small to large values. then keep/choose the first 500 rows.

note that the index values corresponding the 500 rows are now disordered.

then use such indexes to help keep the vectors(groups of data) for further analysis.

----------------

Note that the above analysis is absed on the requirement that each group has the probability of 500/1110 to be selected.

and also based on the fact that you need 500 and only 500 groups.

----------------

Ensure that you understand what you really want to...

------------------

sortc(.,.) is in ascending order, to use desceding order, use rev(...)

------------------------------

[此贴子已经被作者于2006-2-20 3:44:26编辑过]

使用道具

藤椅
belindade 发表于 2006-2-26 10:04:00 |只看作者 |坛友微信交流群
豁然开朗,多谢指教!

使用道具

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

本版微信群
加好友,备注jltj
拉您入交流群

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

GMT+8, 2024-4-30 19:12