/* =====================기본 자료 만들기========================== */

/*개인 식별번호 생성*/

data a1; set skill.data_0827;
pid=c1_id1*100000+w1_id2*10000+w1_id3*10+w1_id4;
run;

/*인적속성 변수 생성*/

 

data a2; set a1;
if w1_sex=2 then sex=0;*성별 더미화. 남자 1;
if w1_sex=1 then sex=1;
age=108-w1_birthy;
if w1_birthy=-9 then age=.;
if w1_edu=-9 then edu=.;
if w1_edu=1 then edu=1;
if w1_edu=2 then edu=1;*초중졸, 인문고졸;
if w1_edu=3 then edu=2;*공고졸;
if w1_edu=4 then edu=3;*기타실고졸;
if w1_edu=5 then edu=4;*전문대졸;
if w1_edu=6 then edu=5;*대졸;
if w1_edu=7 then edu=6;*석박사졸;
if age<=29 then age1=1;*20대;
if age>=30 and age<=39 then age1=2;*30대;
if age>=41 and age<=49 then age1=3;*40대;
if age>=50 then age1=4;*50대이상;
if w1_id4=0 then leader=1;*팀장 더미;
if w1_id4>=1 then leader=0;
run;
proc freq; tables sex edu age1; run;


/* 업무 대분류로 묶기*/

data a3; set a2;

keep pid w104_01 w113_01 w113_07 w113_13 w114_07 w114_12 w114_17;

array  jobvar{7}  w104_01 w113_01 w113_07 w113_13 w114_07 w114_12 w114_17;

do i=1 to 7;
if 101<=jobvar{i}<=199 then jobvar{i}=1; *연구개발;
if 801<=jobvar{i}<=802 then jobvar{i}=1; *연구개발;
if 201<=jobvar{i}<=299 then jobvar{i}=2; *영업및서비스;
if jobvar{i}=808 then jobvar{i}=2; *영업및서비스;
if jobvar{i}=903 then jobvar{i}=2; *영업및서비스;
if 301<=jobvar{i}<=399 then jobvar{i}=3; *관리(경영지원);
if jobvar{i}=810 then jobvar{i}=3; *관리(경영지원);
if jobvar{i}=904 then jobvar{i}=3; *관리(경영지원);
if 401<=jobvar{i}<=599 then jobvar{i}=4; *생산제조;
if 601<=jobvar{i}<=701 then jobvar{i}=5; *상품개발/자금운용;
if 901<=jobvar{i}<=902 then jobvar{i}=5; *상품개발/자금운용;
if 803<=jobvar{i}<=807 then jobvar{i}=6; *전문서비스;
if jobvar{i}=809 then jobvar{i}=6; *전문서비스;
if jobvar{i}=899 then jobvar{i}=6; *전문서비스;
if jobvar{i}=9901 then jobvar{i}=.;
if jobvar{i}=-9 then jobvar{i}=.;
if jobvar{i}=22 then jobvar{i}=.;

end; run;

proc freq; tables w104_01 w113_01 w113_07 w113_13 w114_07 w114_12 w114_17 ;
run;

/* 직무 변화 보기 080820 작업*/

data a3; set a3;

if w104_01=w113_01 then jobpc=1;* 현직장에서의 동일 직무 유지;
if w104_01=. then jobpc=.;
if w113_01=. then jobpc=.;
if w104_01^=w113_01 then jobpc=0;

run;

proc freq; tables jobpc;
run;

data a3; set a3;

if w104_01=w114_07 then jobpp=1;* 전직장과 현직장에서의 동일 직무 유지;
if w104_01=. then jobpp=.;
if w104_01^=w114_07 then jobpp=0;
if w114_07=. then jobpp=.;

run;

proc freq; tables jobpp;
run;

data a3; set a3;

if w113_01=w114_07 then jobpp1=1;* 전직장과 현직장에서 가장 오래 맡은 업무의 동일 직무 유지;
if w113_01=. then jobpp1=.;
if w113_01^=w114_07 then jobpp1=0;
if w114_07=. then jobpp1=.;

run;

proc freq; tables jobpp1;
run;

proc freq data=a3; tables w114_07*w113_01 w113_01*w104_01;
run;

proc sort data=a3; by pid;
proc sort data=a2; by pid;
run;

data b1; merge a2 a3; by pid; run;


/*======= 전현직장 업종 이동 보기=================*/

/* 전직장과 현직장 업종 일치 여부 보기*/

data b2; set b1;
keep pid c1a01_02  w114_02;
run;
proc freq; tables c1a01_02  w114_02; run;

data b2; set b2;
if c1a01_02=35 then c1a01_02=37;
if w114_02=-9 then w114_02=.;
run;
proc freq; tables c1a01_02  w114_02; run;

data b2; set b2;
if c1a01_02<=16 then find=c1a01_02+2;*현직장의 업종을 전직장 업종 코드에 맞게 변화시키기;
if c1a01_02=21 then find=24;*현직장의 업종을 전직장 업종 코드에 맞게 변화시키기;
if c1a01_02>=31 then find=c1a01_02-11;*현직장의 업종을 전직장 업종 코드에 맞게 변화시키기;
run;

proc freq; tables c1a01_02 w114_02 find; run;

data b2; set b2;
if find=. then indp=.;
if find=w114_02 then indp=1;*전현직징 업종 일치;
if find^=w114_02 then indp=0;*전형직장 업종 상이;
if w114_02=. then indp=.;
run;

proc freq; tables indp; run;
proc freq; tables w114_02*find; run;

proc sort data=b2; by pid;
proc sort data=b1; by pid;
data c1; merge b1 b2; by pid; run;


/* 인적속성별로 업무이동 및 업종이동 보기*/

proc freq data=c1; tables sex*jobpc sex*jobpp sex*jobpp1 sex*indp/chisq nopercent nocol; run;

proc freq data=c1; tables age1*jobpc age1*jobpp age1*jobpp1 age1*indp/chisq nopercent nocol; run;

proc freq data=c1; tables edu*jobpc edu*jobpp edu*jobpp1 edu*indp/chisq nopercent nocol; run;

proc freq data=c1; tables edu*w104_01 edu*w113_01 edu*w114_07/chisq nopercent nocol; run;

proc freq data=c1; tables leader*w104_01 leader*w113_01 leader*w114_07/chisq nopercent nocol; run;

proc freq data=c1; tables leader*jobpc leader*jobpp leader*jobpp1 leader*indp/chisq nopercent nocol; run;

 

/*========전공 대학과 업무 일치 여부 보기 080828==========================*/

/* 38개 중분류 전공 빈도 파악 */

data c2; set c1;*대학전공;
if w1_maj=-9 then w1_maj=.;
if w1_maj=999999999996 then w1_maj=.;
tem=int(w1_maj/10000000);
maj=mod(tem, 1000);
proc freq; tables maj; run;

data c2; set c2;*석사전공;
if w1_mmaj=-9 then w1_mmaj=.;
if w1_mmaj=9999996 then w1_mmaj=.;
tem1=int(w1_mmaj/100);
mmaj=mod(tem1, 1000);
proc freq; tables mmaj; run;

data c2; set c2;*박사전공;
if w1_dmaj=-9 then w1_dmaj=.;
if w1_dmaj=9999996 then w1_dmaj=.;
tem2=int(w1_dmaj/100);
dmaj=mod(tem2, 1000);
proc freq; tables dmaj; run;

data c2; set c2;* 최종 전공;
if dmaj^=. then fmaj=dmaj;
if dmaj=. and mmaj^=. then fmaj=mmaj;
if dmaj=. and mmaj=. then fmaj=maj;
if maj=. then fmaj=.;*중분류 전공;
fmaj1=int(fmaj/100);*대분류 전공;
proc freq; tables fmaj fmaj1; run;

proc freq data=c2; tables fmaj1*w104_01 fmaj1*w113_01 fmaj1*w114_07/chisq nopercent nocol; run;

proc freq data=c2; tables fmaj1*jobpc fmaj1*jobpp fmaj1*jobpp1 fmaj1*indp/chisq nopercent nocol; run;

 

/* 기업자료에서 필요 변수 가져오기*/
data t1; set skill.ana071119;
keep c1_id1 worker_gr_dummy1 worker_gr_dummy2 dunion;
run;

proc sort data=t1; by c1_id1;
proc sort data=skill.ana; by c1_id1;run;

data skill.ana; merge skill.ana t1; by c1_id1; run;

 

/* 대학과 업무일치 보기*/


data a1; set skill.ana;
sch_t=int(w1_sch/10000000);
if w1_sch=-9 then sch_t=.;
if w1_sch=99999995 then sch_t=.;
run;

proc freq data=a1; tables sch_t; run;

data a2; set a1;
tem2=int(w1_sch/100000);
tem3=mod(tem2, 100);
run;

/* 수도권과 비수도권 비교*/

data a3; set a2;
if tem3=11 then u_reg=1;*수도권 서울 경기;*수도권과 비수도권 나누어 보기;
if tem3=41 then u_reg=1;*수도권 서울 경기;
if tem3>=21 and tem3<=26 then u_reg=0;*지방대;
if tem3>=42 and tem3<=49 then u_reg=0;* 지방대;

proc freq; tables u_reg; run;

proc freq data=a3; tables u_reg*w104_01 u_reg*w113_01 u_reg*w114_07/chisq nopercent nocol; run;

proc freq data=a3; tables u_reg*jobpc u_reg*jobpp u_reg*jobpp1 u_reg*indp/chisq nopercent nocol; run;

proc freq data=a3; tables w1_sch; run;

/* 학벌 */

data a4; set a3;
if w1_sch=11110201 then sect=1;*서울대;
if w1_sch=11120701 then sect=1;*고려대;
if w1_sch=11123201 then sect=1;*연세대;
if w1_sch=11122601 then sect=1;*성균관대;
if w1_sch=11110103 then sect=0;
if w1_sch>=11110304 and w1_sch<=11120606 then sect=0;
if w1_sch>=11120801 and w1_sch<=11122501 then sect=0;
if w1_sch>=11122701 and w1_sch<=11123101 then sect=0;
if w1_sch>=11123306 and w1_sch<=14920101 then sect=0;
if w1_sch=-9 then sect=.;
if w1_sch=99999995 then sect=.;
if w1_sch>=14920102 then sect=.;

proc freq; tables sect; run;

proc freq data=a4; tables sect*w104_01 sect*w113_01 sect*w114_07/chisq nopercent nocol; run;

proc freq data=a4; tables sect*jobpc sect*jobpp sect*jobpp1 sect*indp/chisq nopercent nocol; run;


/* 숙련형성과 임금 및 승진*/

/* 임금함수를 위한 변수 생성*/

data a5; set a4;

if w125=-9 then wage=.;
if w125>=1 then wage=w125;
if w124=-9 then wtime=.;
if w124>=1 then wtime=w124;
lnwage=log(wage*10000);*로그 평균임금;
lnwage1=log(wage*10000/wtime);*로그 시간당임금;

if edu=4 then dedu1=1;*전문대 더미;
if edu>=1 and edu<=3 then dedu1=0;
if edu>=5 then dedu1=0;
if edu=5 then dedu2=1;*대졸 더미;
if edu>=1 and edu<=4 then dedu2=0;
if edu=6 then dedu2=0;
if edu=6 then dedu3=1;*석박사졸 더미;
if edu>=1 and edu<=5 then dedu3=0;
 
if w104_01=2 then djob1=1;*영업 및 서비스직 더미;
if w104_01=1 then djob1=0;
if w104_01>=3 then djob1=0;
if w104_01=3 then djob2=1;*관리(경영지원)직 더미;
if w104_01=>1 and w104_01<=2 then djob2=0;
if w104_01=>4 then djob2=0;
if w104_01=4 then djob3=1;*생산제조기술직 더미;
if w104_01=>1 and w104_01<=3 then djob3=0;
if w104_01=>5 then djob3=0;
if w104_01=5 then djob4=1;*상품개발/자금운용직 더미;
if w104_01=>1 and w104_01<=4 then djob4=0;
if w104_01=6 then djob4=0;
if w104_01=6 then djob5=1;*전문서비스직 더미;
if w104_01=>1 and w104_01<=5 then djob5=0;

if w1_ind1=2 then dind1=1;*금융업 더미;
if w1_ind1=1 then dind1=0;
if w1_ind1=3 then dind1=0;*비금융서비스업 더미;
if w1_ind1=3 then dind2=1;
if w1_ind1<=2 then dind2=0;

ten=(2006-w101_01)*12+(12-w101_02);
ten2=ten*ten;

age2=age*age;


run;

proc reg data=a5;
 model lnwage1=worker_gr_dummy1 worker_gr_dummy2 dunion sex age age2 ten ten2 dind1 dind2 dedu1 dedu2 deud3 djob1 djob2 djob3 djob4 djob5
                          jobpc ;* 학력과 수도권 더미, 학벌 더미에 중복이 있음;
 run;

proc reg data=a5;
 model lnwage1=worker_gr_dummy1 worker_gr_dummy2 dunion sex age age2 ten ten2 dind1 dind2 dedu1 dedu2 dedu3  djob1 djob2 djob3 djob4 djob5
                          jobpc jobpp jobpp1 indp ;
 run;

data a6; set a5;
if edu=<4 then delete;
run;

proc reg data=a6;
 model lnwage1=worker_gr_dummy1 worker_gr_dummy2 dunion sex age age2 ten ten2 dind1 dind2  dedu3  djob1 djob2 djob3 djob4 djob5
                          jobpc jobpp jobpp1 indp ;
 run;

 


 /* ============================2 차년도 자료 분석======================================*/
 /*============================2차년도 자료 분석=======================================*/

 /* 자료 가져오기 */

 /* 근로자 자료와 기업자료 머지하기 산업중분류 및  규모 변수 가져오기*/

data a1; set skill.hccp_head_2nd;
keep c2_id1 c2_ind2 c2_scale;
rename c2_id1=w2_id1;
run;
proc sort data=a1; by w2_id1;
proc sort data=skill.hccp_work_2nd; by w2_id1;
data skill.ana2; merge skill.hccp_work_2nd a1; by w2_id1; run;


 /* 근로자 자료에서 필요 변수들 가져오기*/

 data w1; set skill.ana2;
 keep w2_id1 w2_id2 w2_id3 w2_id4 w2_ind1 c2_ind2  c2_scale  w2_team w2_posit w201_01 w201_02 w202_01 w202_02 w203_01 w203_02 w204
          w205_01 w205_02  w216_01 w216_02 w216_03 w216_04 w216_05 w216_06 w217_02 w217_03 w217_04 w217_06 w217_07 w217_08 w217_05 w217_09
          w222 w223 w224 w239 w241 w242_01 w242_02 w243_01 w243_02 w2_sex w2_birthy w2_edu w2_sch w2_maj w2_mmaj w2_dmaj;
run;


/*개인 식별번호 생성*/

data a2; set w1;
pid=w2_id1*100000+w2_id2*10000+w2_id3*10+w2_id4;
run;
proc sort data=a2; by pid; run;
 

/*인적속성 변수 생성*/

data a3; set a2;
if w2_sex=2 then sex=0;*성별 더미화. 남자 1;
if w2_sex=1 then sex=1;
age=108-w2_birthy;
if w2_birthy=-9 then age=.;
if w2_edu=-9 then edu=.;
if w2_edu=1 then edu=1;
if w2_edu=2 then edu=1;*초중졸, 인문고졸;
if w2_edu=3 then edu=2;*공고졸;
if w2_edu=4 then edu=3;*기타실고졸;
if w2_edu=5 then edu=4;*전문대졸;
if w2_edu=6 then edu=5;*대졸;
if w2_edu=7 then edu=6;*석박사졸;
if age<=29 then age1=1;*20대;
if age>=30 and age<=39 then age1=2;*30대;
if age>=41 and age<=49 then age1=3;*40대;
if age>=50 then age1=4;*50대이상;
if w2_id4=0 then leader=1;*팀장 더미;
if w2_id4>=1 then leader=0;
run;
proc freq; tables sex edu age1 leader; run;


 /* 업무이동 자료 만들기*/

data a3; set a3;

array  jobvar{5}  w204 w216_01 w216_04 w217_02 w217_06 ;

do i=1 to 5;
if 101<=jobvar{i}<=199 then jobvar{i}=1; *연구개발;
if 801<=jobvar{i}<=802 then jobvar{i}=1; *연구개발;
if 201<=jobvar{i}<=299 then jobvar{i}=2; *영업및서비스;
if jobvar{i}=808 then jobvar{i}=2; *영업및서비스;
if jobvar{i}=903 then jobvar{i}=2; *영업및서비스;
if 301<=jobvar{i}<=399 then jobvar{i}=3; *관리(경영지원);
if jobvar{i}=810 then jobvar{i}=3; *관리(경영지원);
if jobvar{i}=904 then jobvar{i}=3; *관리(경영지원);
if 401<=jobvar{i}<=599 then jobvar{i}=4; *생산제조;
if 601<=jobvar{i}<=701 then jobvar{i}=5; *상품개발/자금운용;
if 901<=jobvar{i}<=902 then jobvar{i}=5; *상품개발/자금운용;
if 803<=jobvar{i}<=807 then jobvar{i}=6; *전문서비스;
if jobvar{i}=809 then jobvar{i}=6; *전문서비스;
if jobvar{i}=899 then jobvar{i}=6; *전문서비스;
if jobvar{i}=9901 then jobvar{i}=.;
if jobvar{i}=-8 then jobvar{i}=.;
if jobvar{i}=-9 then jobvar{i}=.;

end; run;

proc freq; tables  w204 w216_01 w216_04 w217_02 w217_06 ;
run;


/* 직무 변화 보기 080820 작업*/

data a3; set a3;

if w204=w216_01 then jobpc=1;* 현직장에서의 동일 직무 유지;
if w204=. then jobpc=.;
if w204^=w216_01 then jobpc=0;
if w216_01=. then jobpc=.;

run;

proc freq; tables jobpc;
run;

data a3; set a3;

if w204=w217_02 then jobpp=1;* 전직장과 현직장에서의 동일 직무 유지;
if w204=. then jobpp=.;
if w204^=w217_02 then jobpp=0;
if w217_02=. then jobpp=.;

run;

proc freq; tables jobpp;
run;

data a3; set a3;

if w216_01=w217_02 then jobpp1=1;* 전직장과 현직장에서 가장 오래 맡은 업무의 동일 직무 유지;
if w216_01=. then jobpp1=.;
if w216_01^=w217_02 then jobpp1=0;
if w217_02=. then jobpp1=.;

run;

proc freq; tables jobpp1;
run;

proc freq data=a3; tables w204 w216_01 w217_02 ;
run;


/* 전현직장 업종 차이*/

proc freq data=a3; tables w217_05; run;

data a3; set a3;

if w217_05=-9 then indp=.;
if w217_05=1 then indp=1;* 전현직장 업종 일치;
if w217_05=2 then indp=0;
if w217_05=3 then indp=1;* 전현직장 업종에 같음과 다름이 섞여 있을 때는 같음으로 처리;
run;

proc freq data=a3; tables indp; run;

proc freq data=a3; tables w204 w216_01 w217_02; run;

proc freq data=a3; tables w217_02*w216_01/chisq nopercent nocol; run;
proc freq data=a3; tables w216_01*w204/chisq nopercent nocol; run;

proc freq data=a3; tables indp*jobpp1/chisq ; run;

 
/* 인적속성별 업무이동 및 업종이동 차이 보기*/

proc freq data=a3; tables  sex*jobpp1 sex*indp/chisq nopercent nocol; run;

proc freq data=a3; tables  age1*jobpp1 age1*indp/chisq nopercent nocol; run;

proc freq data=a3; tables  edu*jobpp1 edu*indp/chisq nopercent nocol; run;

proc freq data=a3; tables edu*w216_01/chisq nopercent nocol; run;

proc freq data=a3; tables  leader*w216_01 leader*w217_07/chisq nopercent nocol; run;

proc freq data=a3; tables  leader*jobpp1 leader*indp/chisq nopercent nocol; run;

data a3; set a3;
if w222=-9 then s_type=.;
if w222=5 then s_type=.;
if w222=1 then s_type=1;*기업특수숙련;
if w222=2 then s_type=2;*업종특수숙련;
if w222=3 then s_type=3;*직종특수숙련;
if w222=4 then s_type=4;*일반숙련;
run;
proc freq data=a3; tables  s_type*jobpp1 s_type*indp/chisq nopercent nocol; run;


/* 대학전공과 업무 및 업종이동*/

/* 38개 중분류 전공 빈도 파악 */

data a3; set a3;*대학전공;
if w2_maj=-9 then w2_maj=.;
if w2_maj=9999996 then w2_maj=.;
tem=int(w2_maj/100);
maj=mod(tem, 1000);
proc freq; tables maj; run;

data a3; set a3;*석사전공;
if w2_mmaj=-9 then w2_mmaj=.;
if w2_mmaj=9999996 then w2_mmaj=.;
tem1=int(w2_mmaj/100);
mmaj=mod(tem1, 1000);
proc freq; tables mmaj; run;

data a3; set a3;*박사전공;
if w2_dmaj=-9 then w2_dmaj=.;
if w2_dmaj=9999996 then w2_dmaj=.;
tem2=int(w2_dmaj/100);
dmaj=mod(tem2, 1000);
proc freq; tables dmaj; run;

data a3; set a3;* 최종 전공;
if dmaj^=. then fmaj=dmaj;
if dmaj=. and mmaj^=. then fmaj=mmaj;
if dmaj=. and mmaj=. then fmaj=maj;
if maj=. then fmaj=.;*중분류 전공;
fmaj1=int(fmaj/100);*대분류 전공;
proc freq; tables fmaj fmaj1; run;

proc freq data=a3; tables fmaj1*w204 /chisq nopercent nocol; run;

proc freq data=a3; tables fmaj1*s_type/chisq nopercent nocol; run;

proc freq data=a3; tables  fmaj1*jobpp1 fmaj1*indp/chisq nopercent nocol; run;

 


/* 직급승진과 숙련형성 */

data a3; set a3;
promotion_f=w203_01*w203_01;
promotion_t=w203_02*w203_02;
if promotion_f=64 then promotion_f=.;
if promotion_t=64 then promotion_t=.;
run;
proc freq; tables promotion_f promotion_t; run;

data a3; set a3;
promotion=promotion_t - promotion_f;
run;
proc freq; tables promotion; run;

/* 회귀추정을 위한 변수 만들기*/

data a3; set a3;

if w242_01=-9 then wtime=.;
if w242_01>=1 then wtime=w242_01;
if w242_02=-9 then w242_02=.;
if w242_02>=1 then wtime=w242_01+w242_02;*주당총근로시간;
if w243_01=-9 then wage=.;
if w243_01>=1 then wage=w243_01;
if w243_02=-9 then w243_02=.;
if w243_02>=1 then wage=w243_02*12;
lnwage=log(wage*10000);*로그 평균임금;
lnwage1=log(wage*10000/wtime);*로그 시간당임금;

if edu=4 then dedu1=1;*전문대 더미;
if edu>=1 and edu<=3 then dedu1=0;
if edu>=5 then dedu1=0;
if edu=5 then dedu2=1;*대졸 더미;
if edu>=1 and edu<=4 then dedu2=0;
if edu=6 then dedu2=0;
if edu=6 then dedu3=1;*석박사졸 더미;
if edu>=1 and edu<=5 then dedu3=0;
 
if w204=2 then djob1=1;*영업 및 서비스직 더미;
if w204=1 then djob1=0;
if w204>=3 then djob1=0;
if w204=3 then djob2=1;*관리(경영지원)직 더미;
if w204=>1 and w204<=2 then djob2=0;
if w204=>4 then djob2=0;
if w204=4 then djob3=1;*생산제조기술직 더미;
if w204=>1 and w204<=3 then djob3=0;
if w204=>5 then djob3=0;
if w204=5 then djob4=1;*상품개발/자금운용직 더미;
if w204=>1 and w204<=4 then djob4=0;
if w204=6 then djob4=0;
if w204=6 then djob5=1;*전문서비스직 더미;
if w204=>1 and w204<=5 then djob5=0;

if w222=1 then ds_type1=1;*기업특수숙련더미;
if w222=>2 and w222<=4 then ds_type1=0;
if w222=5 then ds_type1=.;
if w222=3 then ds_type2=1;*직종특수숙련더미;
if w222=<2 and w222>=1 then ds_type2=0;
if w222=5 then ds_type2=.;
if w222=4 then ds_type2=0;
if w222=4 then ds_type3=1;*일반숙련더미;
if w222=>1 and w222<=3 then ds_type3=0;
if w222=5 then ds_type3=.;

if w2_ind1=2 then dind1=1;*금융업 더미;
if w2_ind1=1 then dind1=0;
if w2_ind1=3 then dind1=0;
if w2_ind1=3 then dind2=1;*비금융서비스업 더미;
if w2_ind1=2 then dind2=0;
if w2_ind1=1 then dind2=0;

if c2_scale=2 then dsize1=1;* 300-999인;
if c2_scale>=3 then dsize1=0;
if c2_scale=1 then dsize1=0;
if c2_scale=3 then dsize2=1;*1000-1999인;
if c2_scale=<2 then dsize2=0;
if c2_scale=4 then dsize2=0;
if c2_scale=4 then dsize3=1;* 2000인 이상;
if c2_scale<=3 then dsize3=0;

ten=(2006-w201_01)*12+(12-w201_02);
ten2=ten*ten;

age2=age*age;

carr=age-ten/12;
carr2=carr*carr;
run;

proc freq data=a3; tables dsize1 dsize2 dsize3; run;
 
proc reg data=a3;
 model promotion=ten ten2 age age2 ds_type1 ds_type2 ds_type3   djob1 djob2 djob3 djob4 djob5 sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3;
 run;

 proc reg data=a3;
 model promotion=ten ten2 age age2 ds_type1 ds_type2 ds_type3   djob1 djob2 djob3 djob4 djob5 sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3 jobpp1 indp;
 run;

proc reg data=a3;
 model promotion=ten ten2 carr carr2 ds_type1 ds_type2 ds_type3   djob1 djob2 djob3 djob4 djob5 sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3;
 run;

proc reg data=a3;
 model promotion=ten ten2 carr carr2 ds_type1 ds_type2 ds_type3   djob1 djob2 djob3 djob4 djob5 sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3 jobpp1 indp;
 run;

proc reg data=a3;
 model lnwage1=ten ten2 carr carr2 ds_type1 ds_type2 ds_type3   djob1 djob2 djob3 djob4 djob5 sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3;
 run;

proc reg data=a3;
 model lnwage1=ten ten2 carr carr2 ds_type1 ds_type2 ds_type3   djob1 djob2 djob3 djob4 djob5 sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3 jobpp1 indp;
 run;

proc freq data=a3; tables w223 w224; run;


/* 분석 자료 만들기__ 이걸로 앞으로 분석*/

data skill.ana_f; set a3;
drop tem tem1 maj mmaj fmaj;
run;

data an; set skill.ana_f;
if w204>=1;
run;
proc freq; tables leader; run;
proc freq; tables w223; run;
proc freq; tables w222; run;
proc freq; tables w204*w223/chisq nopercent nocol ; run;
proc freq; tables w204*s_type/chisq nopercent nocol ; run;
proc freq; tables w223*s_type/chisq nopercent nocol ; run;
proc freq; tables jobpp1*w223/chisq nopercent nocol ; run;
proc freq; tables indp*w223/chisq nopercent nocol ; run;
proc freq; tables jobpp1*s_type/chisq nopercent nocol ; run;
proc freq; tables indp*s_type/chisq nopercent nocol ; run;


/* 프로빗 분석 직종특수숙련 획득에 대한 업무이동, 업종이동 효과*/

proc probit data=an;*직종특수숙련 프로빗;
 class ds_type2;
  model ds_type2=ten ten2 carr carr2 djob1 djob2 djob3 djob4 djob5 sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3 jobpp indp;
 run;

data an1; set an;*업종특수숙련 더미 만들기;
if s_type=2 then ds_typei=1;
if s_type=1 then ds_typei=0;
if s_type>=3 then ds_typei=0;
run;
 
proc probit data=an1;*업종특수숙련 프로빗;
 class ds_typei;
  model ds_typei=ten ten2 carr carr2 djob1 djob2 djob3 djob4 djob5 sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3 jobpp indp;
 run;


 /* 직급 및 임금상승 회귀분석*/

data an; set an;
if w223=>3 and w223<=4 then dj_type=1;*새로운 일이거나 새로운 일 많음;
else dj_type=0;
if w224=>1 and w224<=2 then dj_depth=1;*문제의 원인을 정확히 혹은 어느 정도 알고 있음;
else dj_depth=0;
run;

data an2; set an;*업종특수숙련 획득자만 추출;
if s_type=2;
run;

 proc reg data=an2;
 model promotion=ten ten2 carr carr2  djob1 djob2 djob3 djob4 djob5 dj_type sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3 jobpp indp;
 run;

 proc reg data=an2;
 model lnwage1=ten ten2 carr carr2  djob1 djob2 djob3 djob4 djob5 dj_type sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3 jobpp indp;
 run;

data an3; set an;*직종특수숙련 획득자만 추출;
if s_type=3;
run;

 proc reg data=an3;
 model promotion=ten ten2 carr carr2  djob1 djob2 djob3 djob4 djob5 dj_type sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3 jobpp indp;
 run;

 proc reg data=an3;
 model lnwage1=ten ten2 carr carr2  djob1 djob2 djob3 djob4 djob5 dj_type sex dedu1 dedu2 dedu3  dind1 dind2
                             dsize1 dsize2 dsize3 jobpp indp;
 run;

 

찌발 데이타 1821039개 찌발