简而言之,SAS 实现随机抽取样本有两种方法:
1.在DATA步 +随机函数 实现
2.用proc surveyselec 实现
但是随机抽取时,有放回和不放回两种方式,应以区别对待。
下面还是以sashelp.class 为例,做简要说明。
http://blog.sina.com.cn/s/blog_41889b9001016663.html
key point:
1. DATA 步实现关键:DO LOOP +随机函数+set statement opion(point ,nobs)
2. PROC 步实现关键:Method 选项设置。