由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS sampling的问题
相关主题
Help on understanding how to Creating a Random Sample without Replacementin =option的一道题
请教SAS random sample的问题Ask a SAS Base question?
[合集] how to randomly draw 10% sample from a data set?求问一道SAS adv 题
SAS base questionSAS应用问题
求教 SAS base 123 Q 16[提问]怎样提取SAS Dateset的observation number?
请教一个SAS 数据分配问题[SAS] data set options (obs=) in output tables
A SAS problemSAS QUESTION:how to capture the last nonmissing observation?
[合集] SAS里如何实现LOCF(LAST OBS CARRIED FORWARD)?请教SAS BASE 70题里的第35题
相关话题的讨论汇总
话题: sampsize话题: obsleft话题: sas话题: set话题: pickit
进入Statistics版参与讨论
1 (共1页)
p********r
发帖数: 1465
1
比如我有个1000个observation的,怎么把它随机的分成两个?一个100的,另一个900
的。
谢谢大家!
k*******a
发帖数: 772
2
surveyselect 可以随机取出100个
D*D
发帖数: 236
3
for large dataset and exact number of samples the following is an example
from the SAS advanced certificate guide of the fastest algorithm to serve
that purpose
much faster than proc surveyselct
data work.rsubset(drop=obsleft sampsize);
sampsize=100;
obsleft=totobs;
do while(sampsize>0);
pickit+1;
if ranuni(0) set sasuser.revenue point=pickit
nobs=totobs;
output;
sampsize=sampsize-1;
end;
obsleft=obsleft-1;
end;
stop;
run;
Sasuser.Revenue is the original data set.
sampsize is the number of observations to read into the sample.
Work.Rsubset is the data set that contains the random sample that you are
creating.
obsleft is the number of observations in the original data set that have not
yet
been considered for selection.
totobs is the total number of observations in the original data set.
pickit is the number of the observation to be read into the sample data set
(if the
RANUNI expression is true), and its starting value is 0.

【在 k*******a 的大作中提到】
: surveyselect 可以随机取出100个
1 (共1页)
进入Statistics版参与讨论
相关主题
请教SAS BASE 70题里的第35题求教 SAS base 123 Q 16
【求助】Large Dataset Management请教一个SAS 数据分配问题
怎么用SAS做加减乘除A SAS problem
how to generate a large SAS data set?[合集] SAS里如何实现LOCF(LAST OBS CARRIED FORWARD)?
Help on understanding how to Creating a Random Sample without Replacementin =option的一道题
请教SAS random sample的问题Ask a SAS Base question?
[合集] how to randomly draw 10% sample from a data set?求问一道SAS adv 题
SAS base questionSAS应用问题
相关话题的讨论汇总
话题: sampsize话题: obsleft话题: sas话题: set话题: pickit