BookmarkSubscribeRSS Feed

[SAS 프로그래밍 고수 백승민] [프로시져] 표본추출(proc surveyselect )

Started ‎06-11-2020 by
Modified ‎06-12-2020 by
Views 260

 

* Survyselect 참고 페이지

http://cafe.daum.net/statsas/3Hlv/58
http://cafe.daum.net/statsas/3Hlv/93
http://cafe.daum.net/statsas/3Oum/5

http://cafe.daum.net/statsas/3F8j/42
 

출처 : 인터넷 미상

표본 추출시 사용되는 여러 방법이 정리되어있습니다. 자주 사용되지는 않지만, 간혹 필요할 경우가 있어서 올려봅니다.

 

data : survey of youth in custody
출처 : Loht(1999),pp,445
표본수 : 2621

먼저 pop라는 이름으로 자료를 불러오시고.
data frame; set pop;
if stratum=7 then stratum=6;
if psu=20 then psu=30;

비복원단순랜덤추출(srswor)
모집단으로부터 n=50개의 표본추출:
proc surveyselect data=frame method=srs n=50 seed=1000 out=srswor;
id stratum psu race sex crimetype numarr;
proc print; run;

모집단으로부터 5%의 표본추출 :
proc surveyselect data=frame method=srs rate=0.05 seed=2000 out=srswor;
id stratum psu age race sex crimetype numarr;
proc print; run;

계통추출하기(systematic sampling)
모집단으로부터 50개의 표본추출
순환계통추출
proc surveyselect data=frame method=sys n=50 seed=1000 out=systematic;
id stratum psu age race sex crimetype numarr;
proc print; run;

복원확률비례추출(ppswr)
모집단의 49개 psu로부터 5개 psu 복원확률비례추출
집락크기에 확률비례추출
proc freq data=frame noprint;
table stratum*psu/out=frame_cl;
proc surveyselect data=frame_cl method=pps_wr n=5 seed=3000 out=ppswr;
size count;
proc print; run;

포함확률비례추출(pi ps)
모집단의 49개의 psu로부터 5개 psu 비복원확률비례추출
추출방법으로 sampford방법사용
proc surveyselect data=frame_cl method=pps_sampford n=5 seed=5000 out=ppswor;
size count;
run;

층화랜덤추출(stsrs)
모집단에서 1.5%의 표본을 층화랜덤 추출
proc surveyselect data=frame method=srs rate=0.015 seed=6000 out=stsrs;
strata stratum;
id stratum psu age race sex crimetype numarr;
proc print; run;

비복원단순랜덤추출(srswor)
추출된 50개의 표본의 총합, 평균, 평균의 표준오차, 표준편차
표본자료는 앞에서 구해진 srswor사용
proc surveyselect data=frame method=srs n=50 seed=1000 out=srswor;
id stratum psu race sex crimetype numarr;

proc surveymeans data=srswor total=2621;
var age numarr; run;

층화랜덤추출(stsrs)
모집단에서 추출된 1.5%의 층화표본의 평균, 평균의 표준오차등
proc freq data=frame; table strayum/out=total;

data total; set total;
rename count=_total_;
proc surveymeans data=ststrs mean clm total=total;
strata stratum;
var age numarr;
weight samplingweight;
run;

Version history
Last update:
‎06-12-2020 01:07 AM
Updated by:
Contributors

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Article Labels
Article Tags