±¹¹Î³ëÈĺ¸ÀåÆгÎÀº 3Â÷ºÎÅÍ »çÀûÀÌÀü¼Òµæ ¹× »çÀûÀÌÀüÁöÃâ, »ó¼Ó°ú Áõ¿©, µ¹º½³ëµ¿°ú °ü·ÃµÈ ¿µ¿ª¿¡¼ °¡Á·Äڵ带 È°¿ëÇÏ¿© °¡Á· ÁÖü¸¦ ÆľÇÇÏ°í ÀÖ´Ù. »Ó¸¸ ¾Æ´Ï¶ó °³ÀÎÁ¶»ç¿¡¼ ºÎ¸ðÀÇ ³ªÀÌ ¹× »ýÁ¸¿©ºÎ, µ¿°Å¿©ºÎ, °Ç°»óÅ ¹× °æÁ¦Àû »óÅÂ, ÀÚ³àÀÇ ³ªÀÌ, µ¿°Å¿©ºÎ, ¼ºº°, È¥ÀλóÅ µîÀ» ÇÔ²² ÆľÇÇÏ°í ÀÖ´Ù.
À̶§, ¿¬±¸ ÁÖÁ¦¿¡ µû¶ó °¡Á·Äڵ忡¼ ÀÀ´äÇÑ °¡Á·ÀÇ Æ¯¼ºÀ» ¿¬°èÇÏ¿© ºÐ¼®ÇÒ °æ¿ì°¡ ÀÖÀ» °ÍÀÌ´Ù. ¿¹¸¦ µé¾î ¡®³ëÈÄ¿¡ °æÁ¦ÀûÀÎ µµ¿òÀ» ´©±¸¿¡°Ô °¡Àå ¹Þ°í ½ÍÀºÁö¡¯¿¡ ´ëÇØ ¡®Àڳ࡯¶ó°í ÀÀ´äÇÑ »ç¶÷µéÀÇ °¡Á·Äڵ带 È°¿ëÇÏ¿© ÀÚ³àÀÇ Æ¯¼º(¿¬·É, ¼ºº°) º¯¼ö¸¦ ¸¸µé¾î ºÐ¼®ÇÑ´Ù°í ÇÏÀÚ. ÀÌ °æ¿ì ´ÙÀ½°ú °°Àº ÀýÂ÷¸¦ È°¿ëÇÑ´Ù.
/* sas ¸í·É¾îÀÇ È°¿ë*/
data a;set k.kreisp07; where p07c021^=.;
keep pid p07c021 p07z026--p07z065 cage csex;
if p07c021<300 or p07c021>400 then delete; /*°¡Á·Äڵ忡 ÀÚ³à¶ó°í ÀÀ´äÇÑ »ç¶÷¸¸ ³²±è*/
/*ù¹ø° ÀÚ³à¶ó°í ÀÀ´äÇÑ »ç¶÷Àº ù ¹ø° ÀÚ³àÀÇ ¿¬·ÉÀ» cage·Î ÁöÁ¤*/
if p07c021=301 then cage=p07z026;
if p07c021=302 then cage=p07z030;
if p07c021=303 then cage=p07z034;
if p07c021=304 then cage=p07z038;
if p07c021=305 then cage=p07z042;
if p07c021=306 then cage=p07z046;
if p07c021=307 then cage=p07z050;
if p07c021=308 then cage=p07z054;
if p07c021=309 then cage=p07z058;
/*ù¹ø° ÀÚ³à¶ó°í ÀÀ´äÇÑ »ç¶÷Àº ù ¹ø° ÀÚ³àÀÇ ¼ºº°À» csex·Î ÁöÁ¤*/
if p07c021=301 then csex=p07z028;
if p07c021=302 then csex=p07z032;
if p07c021=303 then csex=p07z036;
if p07c021=304 then csex=p07z040;
if p07c021=305 then csex=p07z044;
if p07c021=306 then csex=p07z048;
if p07c021=307 then csex=p07z052;
if p07c021=308 then csex=p07z056;
if p07c021=309 then csex=p07z060;
run;
/* spss ¸í·É¾îÀÇ È°¿ë*/
get file='D:\KReIS\SPSS\kreisp07.sav'
/*°¡Á·Äڵ忡 ÀÚ³à¶ó°í ÀÀ´äÇÑ »ç¶÷¸¸ ³²±è*/
select if (300<p07c021 & p07c021<400).
exe.
save out ='D:\KReIS\SPSS\kreisp07_working.sav'
/*ù¹ø° ÀÚ³à¶ó°í ÀÀ´äÇÑ »ç¶÷Àº ù ¹ø° ÀÚ³àÀÇ ¿¬·ÉÀ» cage·Î ÁöÁ¤*/
if (p07c021=301) cage=p07z026.
if (p07c021=302) cage=p07z030.
if (p07c021=303) cage=p07z034.
if (p07c021=304) cage=p07z038.
if (p07c021=305) cage=p07z042.
if (p07c021=306) cage=p07z046.
if (p07c021=307) cage=p07z050.
if (p07c021=308) cage=p07z054.
if (p07c021=309) cage=p07z058.
/*ù¹ø° ÀÚ³à¶ó°í ÀÀ´äÇÑ »ç¶÷Àº ù ¹ø° ÀÚ³àÀÇ ¼ºº°À» csex·Î ÁöÁ¤*/
if (p07c021=301) csex=p07z028.
if (p07c021=302) csex=p07z032.
if (p07c021=303) csex=p07z036.
if (p07c021=304) csex=p07z040.
if (p07c021=305) csex=p07z044.
if (p07c021=306) csex=p07z048.
if (p07c021=307) csex=p07z052.
if (p07c021=308) csex=p07z056.
if (p07c021=309) csex=p07z060.
exe.
/* stata ¸í·É¾îÀÇ È°¿ë*/
clear
set mem 300m
use "D:\KReIS\STATA\kreisp07.dta", clear
keep if p07c021~=.
gen cage=.
gen csex=.
keep pid p07c021 p07z026-p07z065 cage csex
drop if p07c021<300 | p07c021>400 /*°¡Á·Äڵ忡 ÀÚ³à¶ó°í ÀÀ´äÇÑ »ç¶÷¸¸ ³²±è*/
/*ù¹ø° ÀÚ³à¶ó°í ÀÀ´äÇÑ »ç¶÷Àº ù ¹ø° ÀÚ³àÀÇ ¿¬·ÉÀ» cage·Î ÁöÁ¤*/
replace cage=p07z026 if p07c021==301
replace cage=p07z030 if p07c021==302
replace cage=p07z034 if p07c021==303
replace cage=p07z038 if p07c021==304
replace cage=p07z042 if p07c021==305
replace cage=p07z046 if p07c021==306
replace cage=p07z050 if p07c021==307
replace cage=p07z054 if p07c021==308
replace cage=p07z058 if p07c021==309
/*ù¹ø° ÀÚ³à¶ó°í ÀÀ´äÇÑ »ç¶÷Àº ù ¹ø° ÀÚ³àÀÇ ¼ºº°À» csex·Î ÁöÁ¤*/
replace csex=p07z028 if p07c021==301
replace csex=p07z032 if p07c021==302
replace csex=p07z036 if p07c021==303
replace csex=p07z040 if p07c021==304
replace csex=p07z044 if p07c021==305
replace csex=p07z048 if p07c021==306
replace csex=p07z052 if p07c021==307
replace csex=p07z056 if p07c021==308
replace csex=p07z060 if p07c021==309