libname ds 'C:\Users\PBLH1\Documents\2023大学院SAS演習'; proc import out=JAC20 datafile='C:\Users\PBLH1\OneDrive - 近畿大学\ドキュメント\近大・法医\JACSIS\data\JAC20.csv' dbms=CSV replace; getnames=YES; datarow=2; guessingrows=MAX; run; data ds.JAC20; set JAC20; rename JAC20_ID=ID; run; proc import out=JAC21 datafile='C:\Users\PBLH1\OneDrive - 近畿大学\ドキュメント\近大・法医\JACSIS\data\JAC21.csv' dbms=CSV replace; getnames=YES; datarow=2; guessingrows=MAX; run; data ds.JAC21; set JAC21; rename JAC21_ID=ID; run; proc import out=JAC22 datafile='C:\Users\PBLH1\OneDrive - 近畿大学\ドキュメント\近大・法医\JACSIS\data\JAC22.csv' dbms=CSV replace; getnames=YES; datarow=2; guessingrows=MAX; run; data ds.JAC22; set JAC22; rename JAC22_ID=ID; run; proc import out=JAC23 datafile='C:\Users\PBLH1\OneDrive - 近畿大学\ドキュメント\近大・法医\JACSIS\data\JAC23.csv' dbms=CSV replace; getnames=YES; datarow=2; guessingrows=MAX; run; data ds.JAC23; set JAC23; rename JAC23_ID=ID; run; data A; set ds.JAC20; flag20=1; if JAC20_Q62_5=1 and JAC20_Q62_6=1 and JAC20_Q62_7=1 and JAC20_Q62_8=1 and JAC20_Q62_9=1 then drug20=0; else if JAC20_Q62_5>=2 or JAC20_Q62_6>=2 or JAC20_Q62_7>=2 or JAC20_Q62_8>=2 or JAC20_Q62_9>=2 then drug20=1; if JAC20_Q62_8=1 then taima20=0; else if JAC20_Q62_8>=2 then taima20=1; if JAC20_Q62_5=1 then morphine20=0; else if JAC20_Q62_5>=2 then morphine20=1; if JAC20_Q12=4 then JAC20_Q12_correct=1; if JAC20_Q12=2 then JAC20_Q12_correct=0.5; if JAC20_Q12 in (1, 3, 5) then JAC20_Q12_correct=0; JAC20_Q75_allari=0; if JAC20_Q75_1 in (3, 4) and JAC20_Q75_2 in (3, 4) and JAC20_Q75_3 in (3, 4) and JAC20_Q75_4 in (3, 4) and JAC20_Q75_5 in (3, 4) and JAC20_Q75_6 in (3, 4) and JAC20_Q75_7 in (3, 4) and JAC20_Q75_8 in (3, 4) and JAC20_Q75_9 in (3, 4) and JAC20_Q75_10 in (3, 4) and JAC20_Q75_11 in (3, 4) and JAC20_Q75_12 in (3, 4) and JAC20_Q75_13 in (3, 4) and JAC20_Q75_14 in (3, 4) and JAC20_Q75_15 in (3, 4) and JAC20_Q75_16 in (3, 4) then JAC20_Q75_allari=1; mujun20=0; if JAC20_Q12_correct in (0, 0.5) or JAC20_Q75_allari=1 then mujun20=1; if mujun20=1 then delete; run; proc freq data=A; tables JAC20_SC1 JAC20_Q12 drug20 / missing; tables JAC20_Q75_1-JAC20_Q75_16 / missing; tables JAC20_Q62_1-JAC20_Q62_9 / missing; run; proc freq data=A; tables ID mujun20 JAC20_Q75_allari JAC20_Q12_correct / missing; run; data ds.JAC20; set A; run; data B; set ds.JAC21; flag21=1; if JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_9=1 and JAC21_Q68_10=1 then drug21=0; else if JAC21_Q68_6>=2 or JAC21_Q68_7>=2 or JAC21_Q68_8>=2 or JAC21_Q68_9>=2 or JAC21_Q68_10>=2 then drug21=1; if JAC21_Q68_9=1 then taima21=0; else if JAC21_Q68_9>=2 then taima21=1; if JAC21_Q68_6=1 then morphine21=0; else if JAC21_Q68_6>=2 then morphine21=1; if JAC21_Q18=4 then JAC21_Q18_correct=1; if JAC21_Q18=2 then JAC21_Q18_correct=0.5; if JAC21_Q18 in (1,3,5) then JAC21_Q18_correct=0; JAC21_Q26_allari=0; if JAC21_Q26_1 in (3,4,5) and JAC21_Q26_2 in (3,4,5) and JAC21_Q26_3 in (3,4,5) and JAC21_Q26_4 in (3,4,5) and JAC21_Q26_5 in (3,4,5) and JAC21_Q26_6 in (3,4,5) and JAC21_Q26_7 in (3,4,5) and JAC21_Q26_8 in (3,4,5) and JAC21_Q26_9 in (3,4,5) and JAC21_Q26_10 in (3,4,5) and JAC21_Q26_11 in (3,4,5) and JAC21_Q26_12 in (3,4,5) and JAC21_Q26_13 in (3,4,5) and JAC21_Q26_14 in (3,4,5) and JAC21_Q26_15 in (3,4,5) and JAC21_Q26_16 in (3,4,5) and JAC21_Q26_17 in (3,4,5) and JAC21_Q26_18 in (3,4,5) and JAC21_Q26_19 in (3,4,5) and JAC21_Q26_20 in (3,4,5) then JAC21_Q26_allari=1; mujun21=0; if JAC21_Q18_correct in (0,0.5) or JAC21_Q26_allari=1 then mujun21=1; if mujun21=1 then delete; run; proc freq data=B; tables JAC21_SC1_1 JAC21_Q18 drug21 / missing; tables JAC21_Q26_1-JAC21_Q26_20 / missing; tables JAC21_Q68_1-JAC21_Q68_10 / missing; run; proc freq data=B; tables flag21 mujun21 JAC21_Q26_allari JAC21_Q18_correct / missing; run; data ds.JAC21; set B; run; data C; set ds.JAC22; flag22=1; if JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_8=1 and JAC22_Q72_9=1 then drug22=0; else if JAC22_Q72_5>=2 or JAC22_Q72_6>=2 or JAC22_Q72_7>=2 or JAC22_Q72_8>=2 or JAC22_Q72_9>=2 then drug22=1; if JAC22_Q72_8=1 then taima22=0; else if JAC22_Q72_8>=2 then taima22=1; if JAC22_Q72_5=1 then morphine22=0; else if JAC22_Q72_5>=2 then morphine22=1; if JAC22_Q22=4 then JAC22_Q22_correct=1; if JAC22_Q22=2 then JAC22_Q22_correct=0.5; if JAC22_Q22 in (1,3,5) then JAC22_Q22_correct=0; JAC22_Q32_allari=0; if JA22_Q32_1 in (3,4,5) and JAC22_Q32_2 in (3,4,5) and JAC22_Q32_3 in (3,4,5) and JAC22_Q32_4 in (3,4,5) and JAC22_Q32_5 in (3,4,5) and JAC22_Q32_6 in (3,4,5) and JAC22_Q32_7 in (3,4,5) and JAC22_Q32_8 in (3,4,5) and JAC22_Q32_9 in (3,4,5) and JAC22_Q32_10 in (3,4,5) and JAC22_Q32_11 in (3,4,5) and JAC22_Q32_12 in (3,4,5) and JAC22_Q32_13 in (3,4,5) and JAC22_Q32_14 in (3,4,5) and JAC22_Q32_15 in (3,4,5) and JAC22_Q32_16 in (3,4,5) and JAC22_Q32_17 in (3,4,5) and JAC22_Q32_18 in (3,4,5) and JAC22_Q32_19 in (3,4,5) and JAC22_Q32_20 in (3,4,5) then JAC22_Q32_allari=1; mujun22=0; if JAC22_Q22_correct in (0,0.5) or JAC22_Q32_allari=1 then mujun22=1; if mujun22=1 then delete; run; proc freq data=C; tables JAC22_Q1_1 JAC22_Q22 drug22 / missing; tables JAC22_Q32_1-JAC22_Q32_20 / missing; tables JAC22_Q72_1-JAC22_Q72_9 / missing; run; data ds.JAC22; set C; run; data D; set ds.JAC23; flag23=1; if JAC23_Q82_5=1 and JAC23_Q82_6=1 and JAC23_Q82_7=1 and JAC23_Q82_8=1 and JAC23_Q82_9=1 then drug23=0; else if JAC23_Q82_5>=2 or JAC23_Q82_6>=2 or JAC23_Q82_7>=2 or JAC23_Q82_8>=2 or JAC23_Q82_9>=2 then drug23=1; if JAC23_Q82_8=1 then taima23=0; else if JAC23_Q82_8>=2 then taima23=1; if JAC23_Q82_5=1 then morphine23=0; else if JAC23_Q82_5>=2 then morphine23=1; if JAC23_Q22=4 then JAC23_Q22_correct=1; if JAC23_Q22=2 then JAC23_Q22_correct=0.5; if JAC23_Q22 in (1,3,5) then JAC23_Q22_correct=0; JAC23_Q41_allari=0; if JAC23_Q41_1 in (3,4,5) and JAC23_Q41_2 in (3,4,5) and JAC23_Q41_3 in (3,4,5) and JAC23_Q41_4 in (3,4,5) and JAC23_Q41_5 in (3,4,5) and JAC23_Q41_6 in (3,4,5) and JAC23_Q41_7 in (3,4,5) and JAC23_Q41_8 in (3,4,5) and JAC23_Q41_9 in (3,4,5) and JAC23_Q41_10 in (3,4,5) and JAC23_Q41_11 in (3,4,5) and JAC23_Q41_12 in (3,4,5) and JAC23_Q41_13 in (3,4,5) and JAC23_Q41_14 in (3,4,5) and JAC23_Q41_15 in (3,4,5) and JAC23_Q41_16 in (3,4,5) and JAC23_Q41_17 in (3,4,5) and JAC23_Q41_18 in (3,4,5) and JAC23_Q41_19 in (3,4,5) and JAC23_Q41_20 in (3,4,5) then JAC23_Q41_allari=1; mujun23=0; if JAC23_Q22_correct in (0,0.5) or JAC23_Q41_allari=1 then mujun23=1; if mujun23=1 then delete; run; proc freq data=D; tables JAC23_doukyon15over JAC23_Q22_correct JAC23_Q82_allari / missing; run; proc freq data=D; tables JAC23_Q1_1 JAC23_Q22 drug23 / missing; tables JAC23_Q41_1-JAC23_Q41_20 / missing; tables JAC23_Q82_1-JAC23_Q82_9 / missing; run; data ds.JAC23; set D; run; data A; set ds.JAC20; run; data B; set ds.JAC21; run; data C; set ds.JAC22; run; data D; set ds.JAC23; run; proc sort data=A; by ID; run; proc sort data=B; by ID; run; proc sort data=C; by ID; run; proc sort data=D; by ID; run; data ds.JAC20to23; merge A (in=X) B C D; by ID; if X; run; data E; set ds.JAC20to23; run; proc freq data=E; tables mujun20 mujun21 mujun22 mujun23 / missing; run; data ds.JAC20to22; merge A (in=X) B C; by ID; if X; run; data F; set ds.JAC20to22; run; proc freq data=F; tables mujun20 mujun21 mujun22 flag20 flag21 flag22/ missing; run; data A; set ds.JAC20to22; run; proc means data=A; var flag20 flag21 flag22; run; data A; set A; if JAC20_SEX=. then sex=.; if JAC20_SEX=1 then sex=1; if JAC20_SEX=2 then sex=0; if JAC20_AGE=. then age=.; if JAC20_AGE>=15 and JAC20_AGE<=24 then age=5; if JAC20_AGE>=25 and JAC20_AGE<=34 then age=4; if JAC20_AGE>=35 and JAC20_AGE<=44 then age=3; if JAC20_AGE>=45 and JAC20_AGE<=54 then age=2; if JAC20_AGE>=55 and JAC20_AGE<=64 then age=1; if JAC20_AGE>=65 then age=0; if JAC20_Q1=. then job=.; if JAC20_Q1>=11 and JAC20_Q1<=13 then job=2; if JAC20_Q1=10 then job=1; if JAC20_Q1>=1 and JAC20_Q1<=9 then job=0; if JAC20_SC1=. then setain=.; if JAC20_SC1=1 then setain=1; if JAC20_SC1>=2 then setain=0; if JAC20_Q69=. then income=.; if JAC20_Q69>=1 and JAC20_Q69<=5 then income=3; if JAC20_Q69>=10 and JAC20_Q69<=18 then income=2; if JAC20_Q69>=19 and JAC20_Q69<=20 then income=1; if JAC20_Q69>=6 and JAC20_Q69<=9 then income=0; if JAC20_Q8=. then haigusha=.; if JAC20_Q8>=2 and JAC20_Q8<=6 then haigusha=1; if JAC20_Q8=1 then haigusha=0; if JAC20_Q10=. or JAC20_Q11=. then kyoiku=.; if (JAC20_Q10>=1 and JAC20_Q10<=5 and JAC20_Q11>=1 and JAC20_Q11<=3) or (JAC20_Q10>=6 and JAC20_Q10<=8 and JAC20_Q11=2) then kyoiku=2; if JAC20_Q10=10 and JAC20_Q11>=1 and JAC20_Q11<=3 then kyoiku=1; if (JAC20_Q10>=6 and JAC20_Q10<=8 and (JAC20_Q11=1 or JAC20_Q11=3)) or (JAC20_Q10=9 and JAC20_Q11>=1 and JAC20_Q11<=3) then kyoiku=0; if JAC20_Q62_1=. then inshu4=.; if JAC20_Q62_1=5 then inshu4=3; if JAC20_Q62_1=4 then inshu4=2; if JAC20_Q62_1=1 then inshu4=1; if JAC20_Q62_1>=2 and JAC20_Q62_1<=3 then inshu4=0; if inshu4=. then inshu2=.; if inshu4 in (2, 3) then inshu2=1; else inshu2=0; if JAC20_Q65_1=. then tabako3=.; if JAC20_Q65_1>=4 and JAC20_Q65_1<=5 then tabako3=2; if JAC20_Q65_1>=2 and JAC20_Q65_1<=3 then tabako3=1; if JAC20_Q65_1=1 then tabako3=0; if tabako3=. then tabako2=.; else if tabako3 in (1, 2) then tabako2=1; else tabako2=0; if JAC20_Q53_1=. or JAC20_Q53_2=. or JAC20_Q53_3=. or JAC20_Q53_4=. or JAC20_Q53_5=. or JAC20_Q53_6=. then k6=.; if JAC20_Q53_1+JAC20_Q53_2+JAC20_Q53_3+JAC20_Q53_4+JAC20_Q53_5+JAC20_Q53_6>=5 and JAC20_Q53_1+JAC20_Q53_2+JAC20_Q53_3+JAC20_Q53_4+JAC20_Q53_5+JAC20_Q53_6<=20 then k6=1; if JAC20_Q53_1+JAC20_Q53_2+JAC20_Q53_3+JAC20_Q53_4+JAC20_Q53_5+JAC20_Q53_6>=21 then k6=0; if JAC20_Q75_15=. or JAC20_Q75_16=. then mental=.; else if JAC20_Q75_15>=3 or JAC20_Q75_16>=3 then mental=1; else if JAC20_Q75_15<=2 and JAC20_Q75_16<=2 then mental=0; if JAC20_Q75_15=. then utsu=.; else if JAC20_Q75_15>=3 then utsu=1; else if JAC20_Q75_15<=2 then utsu=0; if JAC20_Q42_1=. or JAC20_Q42_2=. or JAC20_Q42_3=. or JAC20_Q42_4=. or JAC20_Q42_5=. or JAC20_Q42_6=. or JAC20_Q42_7=. then fear=.; if JAC20_Q42_1+JAC20_Q42_2+JAC20_Q42_3+JAC20_Q42_4+JAC20_Q42_5+JAC20_Q42_6+JAC20_Q42_7>=29 and JAC20_Q42_1+JAC20_Q42_2+JAC20_Q42_3+JAC20_Q42_4+JAC20_Q42_5+JAC20_Q42_6+JAC20_Q42_7<=35 then fear=3; if JAC20_Q42_1+JAC20_Q42_2+JAC20_Q42_3+JAC20_Q42_4+JAC20_Q42_5+JAC20_Q42_6+JAC20_Q42_7>=23 and JAC20_Q42_1+JAC20_Q42_2+JAC20_Q42_3+JAC20_Q42_4+JAC20_Q42_5+JAC20_Q42_6+JAC20_Q42_7<=28 then fear=2; if JAC20_Q42_1+JAC20_Q42_2+JAC20_Q42_3+JAC20_Q42_4+JAC20_Q42_5+JAC20_Q42_6+JAC20_Q42_7>=17 and JAC20_Q42_1+JAC20_Q42_2+JAC20_Q42_3+JAC20_Q42_4+JAC20_Q42_5+JAC20_Q42_6+JAC20_Q42_7<=22 then fear=1; if JAC20_Q42_1+JAC20_Q42_2+JAC20_Q42_3+JAC20_Q42_4+JAC20_Q42_5+JAC20_Q42_6+JAC20_Q42_7>=7 and JAC20_Q42_1+JAC20_Q42_2+JAC20_Q42_3+JAC20_Q42_4+JAC20_Q42_5+JAC20_Q42_6+JAC20_Q42_7<=16 then fear=0; run; proc export data=A outfile='C:\Users\PBLH1\Documents\2023大学院SAS演習\JAC20to22.xlsx' dbms=xlsx replace; sheet='Sheet1'; run; data A; set A; if JAC20_Q62_5=. or JAC20_Q62_6=. or JAC20_Q62_7=. or JAC20_Q62_8=. or JAC20_Q62_9=. then drug20=.; else if JAC20_Q62_5=5 or JAC20_Q62_6=5 or JAC20_Q62_7=5 or JAC20_Q62_8=5 or JAC20_Q62_9=5 then drug20=5; else if JAC20_Q62_5=4 or JAC20_Q62_6=4 or JAC20_Q62_7=4 or JAC20_Q62_8=4 or JAC20_Q62_9=4 then drug20=4; else if JAC20_Q62_5=3 or JAC20_Q62_6=3 or JAC20_Q62_7=3 or JAC20_Q62_8=3 or JAC20_Q62_9=3 then drug20=3; else if JAC20_Q62_5=2 or JAC20_Q62_6=2 or JAC20_Q62_7=2 or JAC20_Q62_8=2 or JAC20_Q62_9=2 then drug20=2; else if JAC20_Q62_5=1 or JAC20_Q62_6=1 or JAC20_Q62_7=1 or JAC20_Q62_8=1 or JAC20_Q62_9=1 then drug20=1; if JAC21_Q68_6=. or JAC21_Q68_7=. or JAC21_Q68_8=. or JAC21_Q68_9=. or JAC21_Q68_10=. then drug21=.; else if JAC21_Q68_6=5 or JAC21_Q68_7=5 or JAC21_Q68_8=5 or JAC21_Q68_9=5 or JAC21_Q68_10=5 then drug21=5; else if JAC21_Q68_6=4 or JAC21_Q68_7=4 or JAC21_Q68_8=4 or JAC21_Q68_9=4 or JAC21_Q68_10=4 then drug21=4; else if JAC21_Q68_6=3 or JAC21_Q68_7=3 or JAC21_Q68_8=3 or JAC21_Q68_9=3 or JAC21_Q68_10=3 then drug21=3; else if JAC21_Q68_6=2 or JAC21_Q68_7=2 or JAC21_Q68_8=2 or JAC21_Q68_9=2 or JAC21_Q68_10=2 then drug21=2; else if JAC21_Q68_6=1 or JAC21_Q68_7=1 or JAC21_Q68_8=1 or JAC21_Q68_9=1 or JAC21_Q68_10=1 then drug21=1; if JAC22_Q72_5=. or JAC22_Q72_6=. or JAC22_Q72_7=. or JAC22_Q72_8=. or JAC22_Q72_9=. then dru22g=.; else if JAC22_Q72_5=5 or JAC22_Q72_6=5 or JAC22_Q72_7=5 or JAC22_Q72_8=5 or JAC22_Q72_9=5 then drug22=5; else if JAC22_Q72_5=4 or JAC22_Q72_6=4 or JAC22_Q72_7=4 or JAC22_Q72_8=4 or JAC22_Q72_9=4 then drug22=4; else if JAC22_Q72_5=3 or JAC22_Q72_6=3 or JAC22_Q72_7=3 or JAC22_Q72_8=3 or JAC22_Q72_9=3 then drug22=3; else if JAC22_Q72_5=2 or JAC22_Q72_6=2 or JAC22_Q72_7=2 or JAC22_Q72_8=2 or JAC22_Q72_9=2 then drug22=2; else if JAC22_Q72_5=1 or JAC22_Q72_6=1 or JAC22_Q72_7=1 or JAC22_Q72_8=1 or JAC22_Q72_9=1 then drug22=1; if drug20=1 and ((drug21>=2 and drug22>=2) or (drug21>=2 and (drug22=1 or flag22=.)) or (drug22>=2 and (drug21=1 or flag21=.))) then drug_c=1; else if (drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and flag22=.) or (drug20=1 and glag21=. and drug22=1) then drug_c=0; else drug_c=.; if drug20=1 and ((drug21>=2 and drug22>=2) or (drug21>=2 and (drug22=1 or flag22=.)) or (drug22>=2 and (drug21=1 or flag21=.))) and sex=1 then drug_cm=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and flag22=.) or (drug20=1 and glag21=. and drug22=1)) and sex=1 then drug_cm=0; else drug_cm=.; if drug20=1 and ((drug21>=2 and drug22>=2) or (drug21>=2 and (drug22=1 or flag22=.)) or (drug22>=2 and (drug21=1 or flag21=.))) and sex=0 then drug_cf=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and flag22=.) or (drug20=1 and glag21=. and drug22=1)) and sex=0 then drug_cf=0; else drug_cf=.; if drug20=1 and ((drug21>=2 and drug22>=2) or (drug21>=2 and (drug22=1 or flag22=.)) or (drug22>=2 and (drug21=1 or flag21=.))) and tabako2=1 then drug_cth=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and flag22=.) or (drug20=1 and glag21=. and drug22=1)) and tabako2=1 then drug_cth=0; else drug_cth=.; if drug20=1 and ((drug21>=2 and drug22>=2) or (drug21>=2 and (drug22=1 or flag22=.)) or (drug22>=2 and (drug21=1 or flag21=.))) and tabako2=0 then drug_cnth=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and flag22=.) or (drug20=1 and glag21=. and drug22=1)) and tabako2=0 then drug_cnth=0; else drug_cnth=.; if drug20=1 and ((drug21>=2 and drug22>=2) or (drug21>=2 and (drug22=1 or flag22=.)) or (drug22>=2 and (drug21=1 or flag21=.))) and inshu2=1 then drug_ci=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and flag22=.) or (drug20=1 and glag21=. and drug22=1)) and inshu2=1 then drug_ci=0; else drug_ci=.; if drug20=1 and ((drug21>=2 and drug22>=2) or (drug21>=2 and (drug22=1 or flag22=.)) or (drug22>=2 and (drug21=1 or flag21=.))) and inshu2=0 then drug_cni=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and flag22=.) or (drug20=1 and glag21=. and drug22=1)) and inshu2=0 then drug_cni=0; else drug_cni=.; if drug20=1 and if (drug20=1 and JAC21_Q68_9>=2 and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8>=2 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) or (drug20=1 and (JAC21_Q68_9>=2 or JAC22_Q72_8>=2) and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) then taima_c=1; else if (drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1) then taima_c=0; else taima_c=.; if (drug20=1 and JAC21_Q68_9>=2 and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8>=2 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) or (drug20=1 and (JAC21_Q68_9>=2 or JAC22_Q72_8>=2) and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) and sex=1 then taima_cm=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and sex=1 then taima_cm=0; else taima_cm=.; if (drug20=1 and JAC21_Q68_9>=2 and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8>=2 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) or (drug20=1 and (JAC21_Q68_9>=2 or JAC22_Q72_8>=2) and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) and sex=0 then taima_cf=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and sex=0 then taima_cf=0; else taima_cf=.; if (drug20=1 and JAC21_Q68_9>=2 and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8>=2 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) or (drug20=1 and (JAC21_Q68_9>=2 or JAC22_Q72_8>=2) and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) and tabakoa=1 then taima_ct=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and tabakoa=1 then taima_ct=0; else taima_ct=.; if (drug20=1 and JAC21_Q68_9>=2 and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8>=2 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) or (drug20=1 and (JAC21_Q68_9>=2 or JAC22_Q72_8>=2) and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) and tabakoa=0 then taima_cnt=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and tabakoa=0 then taima_cnt=0; else taima_cnt=.; if (drug20=1 and JAC21_Q68_9>=2 and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8>=2 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) or (drug20=1 and (JAC21_Q68_9>=2 or JAC22_Q72_8>=2) and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) and tabakob=1 then taima_cth=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and tabakob=1 then taima_cth=0; else taima_cth=.; if (drug20=1 and JAC21_Q68_9>=2 and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8>=2 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) or (drug20=1 and (JAC21_Q68_9>=2 or JAC22_Q72_8>=2) and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) and tabakob=0 then taima_cnth=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and tabakob=0 then taima_cnth=0; else taima_cnth=.; if (drug20=1 and JAC21_Q68_9>=2 and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8>=2 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) or (drug20=1 and (JAC21_Q68_9>=2 or JAC22_Q72_8>=2) and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) and inshua=1 then taima_ci=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and inshua=1 then taima_ci=0; else taima_ci=.; if (drug20=1 and JAC21_Q68_9>=2 and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8>=2 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) or (drug20=1 and (JAC21_Q68_9>=2 or JAC22_Q72_8>=2) and JAC21_Q68_6=1 and JAC21_Q68_7=1 and JAC21_Q68_8=1 and JAC21_Q68_10=1 and JAC22_Q72_5=1 and JAC22_Q72_6=1 and JAC22_Q72_7=1 and JAC22_Q72_9=1) and inshua=0 then taima_cni=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and inshua=0 then taima_cni=0; else taima_cni=.; if JAC20_Q62_5=. or JAC20_Q62_6=. or JAC20_Q62_7=. or JAC20_Q62_9=. then taimaigai20=.; if JAC20_Q62_5=5 or JAC20_Q62_6=5 or JAC20_Q62_7=5 or JAC20_Q62_9=5 then taimaigai20=5; if JAC20_Q62_5=4 or JAC20_Q62_6=4 or JAC20_Q62_7=4 or JAC20_Q62_9=4 then taimaigai20=4; if JAC20_Q62_5=3 or JAC20_Q62_6=3 or JAC20_Q62_7=3 or JAC20_Q62_9=3 then taimaigai20=3; if JAC20_Q62_5=2 or JAC20_Q62_6=2 or JAC20_Q62_7=2 or JAC20_Q62_9=2 then taimaigai20=2; if JAC20_Q62_5=1 or JAC20_Q62_6=1 or JAC20_Q62_7=1 or JAC20_Q62_9=1 then taimaigai20=1; if JAC21_Q68_6=. or JAC21_Q68_7=. or JAC21_Q68_8=. or JAC21_Q68_10=. then taimaigai22=.; if JAC21_Q68_6=5 or JAC21_Q68_7=5 or JAC21_Q68_8=5 or JAC21_Q68_10=5 then taimaigai21=5; if JAC21_Q68_6=4 or JAC21_Q68_7=4 or JAC21_Q68_8=4 or JAC21_Q68_10=4 then taimaigai21=4; if JAC21_Q68_6=3 or JAC21_Q68_7=3 or JAC21_Q68_8=3 or JAC21_Q68_10=3 then taimaigai21=3; if JAC21_Q68_6=2 or JAC21_Q68_7=2 or JAC21_Q68_8=2 or JAC21_Q68_10=2 then taimaigai21=2; if JAC21_Q68_6=1 or JAC21_Q68_7=1 or JAC21_Q68_8=1 or JAC21_Q68_10=1 then taimaigai21=1; if JAC22_Q72_5=. or JAC22_Q72_6=. or JAC22_Q72_7=. or JAC22_Q72_9=. then taimaigai22=.; if JAC22_Q72_5=5 or JAC22_Q72_6=5 or JAC22_Q72_7=5 or JAC22_Q72_9=5 then taimaigai22=5; if JAC22_Q72_5=4 or JAC22_Q72_6=4 or JAC22_Q72_7=4 or JAC22_Q72_9=4 then taimaigai22=4; if JAC22_Q72_5=3 or JAC22_Q72_6=3 or JAC22_Q72_7=3 or JAC22_Q72_9=3 then taimaigai22=3; if JAC22_Q72_5=2 or JAC22_Q72_6=2 or JAC22_Q72_7=2 or JAC22_Q72_9=2 then taimaigai22=2; if JAC22_Q72_5=1 or JAC22_Q72_6=1 or JAC22_Q72_7=1 or JAC22_Q72_9=1 then taimaigai22=1; if (drug20=1 and JAC21_Q68_9=1 and taimaigai21>=2 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8=1 and taimaigai22>=2) or (drug20=1 and JAC21_Q68_9=1 and JAC22_Q72_8=1 and (taimaigai21>=2 or taimaigai22>=2)) then taimaigai_c=1; else if (drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1) then taimaigai_c=0; else taimaigai_c=.; if ((drug20=1 and JAC21_Q68_9=1 and taimaigai21>=2 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8=1 and taimaigai22>=2) or (drug20=1 and JAC21_Q68_9=1 and JAC22_Q72_8=1 and (taimaigai21>=2 or taimaigai22>=2))) and sex=1 then taimaigai_cm=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and sex=1 then taimaigai_cm=0; else taimaigai_cm=.; if ((drug20=1 and JAC21_Q68_9=1 and taimaigai21>=2 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8=1 and taimaigai22>=2) or (drug20=1 and JAC21_Q68_9=1 and JAC22_Q72_8=1 and (taimaigai21>=2 or taimaigai22>=2))) and sex=0 then taimaigai_cf=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and sex=0 then taimaigai_cf=0; else taimaigai_cf=.; if ((drug20=1 and JAC21_Q68_9=1 and taimaigai21>=2 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8=1 and taimaigai22>=2) or (drug20=1 and JAC21_Q68_9=1 and JAC22_Q72_8=1 and (taimaigai21>=2 or taimaigai22>=2))) and tabakoa=1 then taimaigai_ct=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and tabakoa=1 then taimaigai_ct=0; else taimaigai_ct=.; if ((drug20=1 and JAC21_Q68_9=1 and taimaigai21>=2 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8=1 and taimaigai22>=2) or (drug20=1 and JAC21_Q68_9=1 and JAC22_Q72_8=1 and (taimaigai21>=2 or taimaigai22>=2))) and tabakoa=0 then taimaigai_cnt=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and tabakoa=0 then taimaigai_cnt=0; else taimaigai_cnt=.; if ((drug20=1 and JAC21_Q68_9=1 and taimaigai21>=2 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8=1 and taimaigai22>=2) or (drug20=1 and JAC21_Q68_9=1 and JAC22_Q72_8=1 and (taimaigai21>=2 or taimaigai22>=2))) and tabakob=1 then taimaigai_cth=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and tabakob=1 then taimaigai_cth=0; else taimaigai_cth=.; if ((drug20=1 and JAC21_Q68_9=1 and taimaigai21>=2 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8=1 and taimaigai22>=2) or (drug20=1 and JAC21_Q68_9=1 and JAC22_Q72_8=1 and (taimaigai21>=2 or taimaigai22>=2))) and tabakob=0 then taimaigai_cnth=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and tabakob=0 then taimaigai_cnth=0; else taimaigai_cnth=.; if ((drug20=1 and JAC21_Q68_9=1 and taimaigai21>=2 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8=1 and taimaigai22>=2) or (drug20=1 and JAC21_Q68_9=1 and JAC22_Q72_8=1 and (taimaigai21>=2 or taimaigai22>=2))) and inshua=1 then taimaigai_ci=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and inshua=1 then taimaigai_ci=0; else taimaigai_ci=.; if ((drug20=1 and JAC21_Q68_9=1 and taimaigai21>=2 and drug22=.) or (drug20=1 and drug21=. and JAC22_Q72_8=1 and taimaigai22>=2) or (drug20=1 and JAC21_Q68_9=1 and JAC22_Q72_8=1 and (taimaigai21>=2 or taimaigai22>=2))) and inshua=0 then taimaigai_cni=1; else if ((drug20=1 and drug21=1 and drug22=1) or (drug20=1 and drug21=1 and drug22=.) or (drug20=1 and drug21=. and drug22=1)) and inshua=0 then taimaigai_cni=0; else taimaigai_cni=.; run; proc freq data=A; tables drug20 drug21 drug22 taimaigai20 taimaigai21 taimaigai22 alldrug_c alldrug_cm alldrug_cf alldrug_ct alldrug_cnt alldrug_cth alldrug_cnth alldrug_ci alldrug_cni taima_c taima_cm taima_cf taima_ct taima_cnt taima_cth taima_cnth taima_ci taima_cni taimaigai_c taimaigai_cm taimaigai_cf taimaigai_ct taimaigai_cnt taimaigai_cth taimaigai_cnth taimaigai_ci taimaigai_cni / missing; run; proc freq data=A; tables sex age job setain income haigusha kyoiku inshu inshua inshub tabako tabakoa tabakob k6 mental utsu fear / missing; run; data ds.JAC20to22_hensuari; set A; run; proc import out=jaclogi datafile='C:\Users\PBLH1\Documents\2023大学院SAS演習\SASver_short.csv' dbms=CSV replace; getnames=YES; datarow=2; guessingrows=MAX; run; proc freq data=jaclogi; tables drug_c drug_cth drug_cnth drug_ci drug_cni drug_cm drug_cf taima_c taima_cth taima_cnth taima_ci taima_cni taima_cm taima_cf taimato_c taimato_cth taimato_cnth taimato_ci taimato_cni taimato_cm taimato_cf ntaima_c ntaima_cth ntaima_cnth ntaima_ci ntaima_cni ntaima_cm ntaima_cf morphine_c morphine_cth morphine_cnth morphine_ci morphine_cni morphine_cm morphine_cf / missing; run; data A; set jaclogi; run; proc means data=A n nmiss; var drug_c drug_cm drug_cf drug_cth drug_cnth drug_ci drug_cni taima_c taima_cm taima_cf taima_cth taima_cnth taima_ci taima_cni taimato_c taimato_cth taimato_cnth taimato_ci taimato_cni taimato_cm taimato_cf ntaima_c ntaima_cth ntaima_cnth ntaima_ci ntaima_cni ntaima_cm ntaima_cf morphine_c morphine_cth morphine_cnth morphine_ci morphine_cni morphine_cm morphine_cf sex age job setain income haigusha kyoiku inshu2 inshu4 tabako2 tabako3 k6 mental fear ; run; proc reg data=A; model drug_c = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental / vif; run; proc logistic data=A; where drug_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model drug_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where drug_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu2(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model drug_c(event='1') = fear sex age job setain income haigusha kyoiku inshu2 tabako3 k6 mental fear*inshu2; run; proc logistic data=A; where drug_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako2(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model drug_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako2 k6 mental fear*tabako2; run; proc logistic data=A; where drug_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model drug_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental fear*sex; run; proc logistic data=A; where drug_cm^=.; class age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model drug_cm(event='1') = fear age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where drug_cf^=.; class age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model drug_cf(event='1') = fear age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where drug_cth^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model drug_cth(event='1') = fear sex age job setain income haigusha kyoiku inshu4 k6 mental; run; proc logistic data=A; where drug_cnth^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model drug_cnth(event='1') = fear sex age job setain income haigusha kyoiku inshu4 k6 mental; run; proc logistic data=A; where drug_ci^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model drug_ci(event='1') = fear sex age job setain income haigusha kyoiku tabako3 k6 mental; run; proc logistic data=A; where drug_cni^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model drug_cni(event='1') = fear sex age job setain income haigusha kyoiku tabako3 k6 mental; run; proc reg data=A; model taimanomi_c = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental / vif; run; proc logistic data=A; where taimanomi_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model taimanomi_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where taimanomi_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu2(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model taimanomi_c(event='1') = fear sex age job setain income haigusha kyoiku inshu2 tabako3 k6 mental fear*inshu2; run; proc logistic data=A; where taimanomi_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako2(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model taimanomi_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako2 k6 mental fear*tabako2; run; proc logistic data=A; where taimanomi_c^=.; / class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model taimanomi_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental fear*sex; run; proc logistic data=A; where taimanomi_cm^=.; class age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimanomi_cm(event='1') = fear age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where taimanomi_cf^=.; class age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimanomi_cf(event='1') = fear age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where taimanomi_cth^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimanomi_cth(event='1') = fear sex age job setain income haigusha kyoiku inshu4 k6 mental; run; proc logistic data=A; where taimanomi_cnth^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimanomi_cnth(event='1') = fear sex age job setain income haigusha kyoiku inshu4 k6 mental; run; proc logistic data=A; where taimanomi_ci^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model taimanomi_ci(event='1') = fear sex age job setain income haigusha kyoiku tabako3 k6 mental; run; proc logistic data=A; where taimanomi_cni^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model taimanomi_cni(event='1') = fear sex age job setain income haigusha kyoiku tabako3 k6 mental; run; proc reg data=A; model ntaima_c = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental / vif; run; proc logistic data=A; where taimaigai_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model taimaigai_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where taimaigai_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu2(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model taimaigai_c(event='1') = fear sex age job setain income haigusha kyoiku inshu2 tabako3 k6 mental fear*inshu2; run; proc logistic data=A; where taimaigai_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako2(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model taimaigai_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako2 k6 mental fear*tabako2; run; proc logistic data=A; where taimaigai_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model taimaigai_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental fear*sex; run; proc logistic data=A; where taimaigai_cm^=.; class age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimaigai_cm(event='1') = fear age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where taimaigai_cf^=.; class age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimaigai_cf(event='1') = fear age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where taimaigai_cth^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimaigai_cth(event='1') = fear sex age job setain income haigusha kyoiku inshu4 k6 mental; run; proc logistic data=A; where taimaigai_cnth^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimaigai_cnth(event='1') = fear sex age job setain income haigusha kyoiku inshu4 k6 mental; run; proc logistic data=A; where taimaigai_ci^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model taimaigai_ci(event='1') = fear sex age job setain income haigusha kyoiku tabako3 k6 mental; run; proc logistic data=A; where taimaigai_cni^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model taimaigai_cni(event='1') = fear sex age job setain income haigusha kyoiku tabako3 k6 mental; run; proc reg data=A; model taimato_c = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental / vif; run; proc logistic data=A; where taimato_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model taimato_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where taimato_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu2(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model taimato_c(event='1') = fear sex age job setain income haigusha kyoiku inshu2 tabako3 k6 mental fear*inshu2; run; proc logistic data=A; where taimato_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako2(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model taimato_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako2 k6 mental fear*tabako2; run; proc logistic data=A; where taimato_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model taimato_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental fear*sex; run; proc logistic data=A; where taimato_cm^=.; class age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimato_cm(event='1') = fear age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where taimato_cf^=.; class age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimato_cf(event='1') = fear age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where taimato_cth^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimato_cth(event='1') = fear sex age job setain income haigusha kyoiku inshu4 k6 mental; run; proc logistic data=A; where taimato_cnth^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model taimato_cnth(event='1') = fear sex age job setain income haigusha kyoiku inshu4 k6 mental; run; proc logistic data=A; where taimato_ci^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model taimato_ci(event='1') = fear sex age job setain income haigusha kyoiku tabako3 k6 mental; run; proc logistic data=A; where taimato_cni^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model taimato_cni(event='1') = fear sex age job setain income haigusha kyoiku tabako3 k6 mental; run; proc reg data=A; model morphine_c = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental / vif; run; proc logistic data=A; where morphine_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model morphine_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where morphine_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu2(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model morphine_c(event='1') = fear sex age job setain income haigusha kyoiku inshu2 tabako3 k6 mental fear*inshu2; run; proc logistic data=A; where morphine_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako2(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model morphine_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako2 k6 mental fear*tabako2; run; proc logistic data=A; where morphine_c^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=glm; model morphine_c(event='1') = fear sex age job setain income haigusha kyoiku inshu4 tabako3 k6 mental fear*sex; run; proc logistic data=A; where morphine_cm^=.; class age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model morphine_cm(event='1') = fear age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where morphine_cf^=.; class age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model morphine_cf(event='1') = fear age job setain income haigusha kyoiku inshu4 tabako3 k6 mental; run; proc logistic data=A; where morphine_cth^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model morphine_cth(event='1') = fear sex age job setain income haigusha kyoiku inshu4 k6 mental; run; proc logistic data=A; where morphine_cnth^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') inshu4(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') /param=ref; model morphine_cnth(event='1') = fear sex age job setain income haigusha kyoiku inshu4 k6 mental; run; proc logistic data=A; where morphine_ci^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model morphine_ci(event='1') = fear sex age job setain income haigusha kyoiku tabako3 k6 mental; run; proc logistic data=A; where morphine_cni^=.; class sex(ref='0') age(ref='0') job(ref='0') setain(ref='0') income(ref='0') haigusha(ref='0') kyoiku(ref='0') tabako3(ref='0') k6(ref='0') mental(ref='0') fear(ref='0') / param=ref; model morphine_cni(event='1') = fear sex age job setain income haigusha kyoiku tabako3 k6 mental; run; data jaclogi; set A; run; options missing=' '; proc import out=fordrug datafile='C:\Users\PBLH1\OneDrive - 近畿大学\ドキュメント\近大・法医\じぶんの論文\コロナと違法薬物_JACSIS_PeerJ\SAS\forest_drug.csv' dbms=CSV replace; getnames=YES; datarow=2; guessingrows=MAX; run; data A; set fordrug; rename aOR__95__CI_=OR; rename No__of_persons=NO; run; data B; set A; run; ods html path='C:\Users\PBLH1\Documents\2023大学院SAS演習' (url=NONE) style=Pearl image_dpi=300; ods graphics on / attrpriority=none imagename="fordrug" imagefmt=png noborder width=170mm height=120mm; proc sgplot data=B nowall noborder noautolegend ; highlow y=obsid low=low high=upper; scatter y=obsid x=middle / markerattrs=(symbol=squarefilled size=6); scatter y=obsid x=middle / markerattrs=(size=0) x2axis; refline 1 / axis=x; yaxistable subgroup / label="Subgroup" location=outside position=left indentweight=W; yaxistable Level / label="Fear of COVID-19" labeljustify=center location=outside position=left; yaxistable NO / label="No. of persons" labeljustify=center location=outside position=left; yaxistable OR / label="aOR (95% CI)" labeljustify=center location=outside position=right; yaxistable P / label="P for interaction" labeljustify=center location=outside position=right; yaxis reverse display=none type=discrete colorbands=odd colorbandsattrs=(transparency=1); xaxis display=(nolabel) values=(0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0); x2axis label=' ' display=(noline noticks novalues); run; ods graphics off; ods html close; data forest_drug; set B; run; proc import out=fortaima datafile='C:\Users\PBLH1\OneDrive - 近畿大学\ドキュメント\近大・法医\じぶんの論文\コロナと違法薬物_JACSIS_PeerJ\SAS\forest_taimanomi.csv' dbms=CSV replace; getnames=YES; datarow=2; guessingrows=MAX; run; data C; set fortaima; rename aOR__95__CI_=OR; rename No__of_persons=NO; run; ods html path='C:\Users\PBLH1\Documents\2023大学院SAS演習' (url=NONE) style=Pearl image_dpi=300; ods graphics on / attrpriority=none imagename="fortaima" imagefmt=png noborder width=170mm height=120mm; proc sgplot data=C nowall noborder noautolegend ; highlow y=obsid low=low high=upper; scatter y=obsid x=middle / markerattrs=(symbol=squarefilled size=6); scatter y=obsid x=middle / markerattrs=(size=0) x2axis; refline 1 / axis=x; yaxistable subgroup / label="Subgroup" location=outside position=left indentweight=W; yaxistable Level / label="Fear of COVID-19" labeljustify=center location=outside position=left; yaxistable NO / label="No. of persons" labeljustify=center location=outside position=left; yaxistable OR / label="aOR (95% CI)" labeljustify=center location=outside position=right; yaxistable P / label="P for interaction" labeljustify=center location=outside position=right; yaxis reverse display=none type=discrete colorbands=odd colorbandsattrs=(transparency=1); xaxis display=(nolabel) values=(0.0 1.5 3.0 4.5 6.0 7.5 9.0 10.5 12.0); x2axis label=' ' display=(noline noticks novalues); run; ods graphics off; ods html close; data forest_taima; set C; run; proc import out=fortaimaigai datafile='C:\Users\PBLH1\OneDrive - 近畿大学\ドキュメント\近大・法医\じぶんの論文\コロナと違法薬物_JACSIS_PeerJ\SAS\forest_taimaigai.csv' dbms=CSV replace; getnames=YES; datarow=2; guessingrows=MAX; run; data D; set fortaimaigai; rename aOR__95__CI_=OR; rename No__of_persons=NO; run; ods html path='C:\Users\PBLH1\Documents\2023大学院SAS演習' (url=NONE) style=Pearl /*my_style*/ image_dpi=300; ods graphics on / attrpriority=none imagename="fortaimaigai" imagefmt=png noborder width=170mm height=120mm; proc sgplot data=D nowall noborder noautolegend ; highlow y=obsid low=low high=upper; scatter y=obsid x=middle / markerattrs=(symbol=squarefilled size=6); scatter y=obsid x=middle / markerattrs=(size=0) x2axis; refline 1 / axis=x; yaxistable subgroup / label="Subgroup" location=outside position=left indentweight=W; yaxistable Level / label="Fear of COVID-19" labeljustify=center location=outside position=left; yaxistable NO / label="No. of persons" labeljustify=center location=outside position=left; yaxistable OR / label="aOR (95% CI)" labeljustify=center location=outside position=right; yaxistable P / label="P for interaction" labeljustify=center location=outside position=right; yaxis reverse display=none type=discrete colorbands=odd colorbandsattrs=(transparency=1); xaxis display=(nolabel) values=(0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0); x2axis label=' ' display=(noline noticks novalues); run; ods graphics off; ods html close; data forest_taimaigai; set D; run;