use third_ecs_mm_dataset_2015.dta set more off log using mylog_mm_feb2016, replace *** generating variables: codebook MM602_1 -MM602_4 replace MM602_1=. if MM602_1==3 replace MM602_2=. if MM602_2==3 replace MM602_3=. if MM602_3==3 replace MM602_4=. if MM602_4==3 codebook MM602_1 -MM602_4 sum MM602_1 -MM602_4 replace MM602_1=0 if MM602_1==2 replace MM602_2=0 if MM602_2==2 replace MM602_3=0 if MM602_3==2 replace MM602_4=0 if MM602_4==2 sum MM602_1 -MM602_4 replace ASINGLE=. if ASINGLE==8 | ASINGLE==9 replace APRIVATE=. if APRIVATE==8 | APRIVATE==9 replace ACHOWNER=. if ACHOWNER==8 | ACHOWNER==9 replace AEMPORG=. if AEMPORG==8 | AEMPORG==9 replace ASINGLE=0 if ASINGLE==2 replace APRIVATE=0 if APRIVATE==2 replace ACHOWNER=0 if ACHOWNER==2 replace AEMPORG=0 if AEMPORG==2 codebook CEMPPERM_CEMPPERM_N-CONJOB_CONJOB_N_CONJOBPC rename CEMPPERM_CEMPPERM_N q33perm rename CEMPWOM_CEMPWOM_N q33wom rename CEMPOLD_CEMPOLD_N q33old rename CEMPHIED_CEMPHIED_N q33univ rename CEMPPART_CEMPPART_N q33pt rename CONJOB_CONJOB_N_CONJOBPC q16 replace q33perm=. if q33perm==8 | q33perm==9 replace q33wom=. if q33wom==8 | q33wom==9 replace q33old=. if q33old==8 | q33old==9 replace q33univ=. if q33univ==8 | q33univ==9 replace q33pt=. if q33pt==8 | q33pt==9 replace q16=. if q16==8 | q16==9 *** Assigning the middle point codebook q33perm q33wom q33old q33univ q33pt q16 gen q33perm_g=. replace q33perm_g=0 if q33perm==1 replace q33perm_g=10 if q33perm==2 replace q33perm_g=30 if q33perm==3 replace q33perm_g=50 if q33perm==4 replace q33perm_g=70 if q33perm==5 replace q33perm_g=90 if q33perm==6 replace q33perm_g=100 if q33perm==7 codebook q33perm q33perm_g sum q33perm q33perm_g codebook q33wom gen q33wom_g=. replace q33wom_g=0 if q33wom==1 replace q33wom_g=10 if q33wom==2 replace q33wom_g=30 if q33wom==3 replace q33wom_g=50 if q33wom==4 replace q33wom_g=70 if q33wom==5 replace q33wom_g=90 if q33wom==6 replace q33wom_g=100 if q33wom==7 codebook q33wom q33wom_g sum q33wom q33wom_g codebook q33univ gen q33univ_g=. replace q33univ_g=0 if q33univ==1 replace q33univ_g=10 if q33univ==2 replace q33univ_g=30 if q33univ==3 replace q33univ_g=50 if q33univ==4 replace q33univ_g=70 if q33univ==5 replace q33univ_g=90 if q33univ==6 replace q33univ_g=100 if q33univ==7 codebook q33univ q33univ_g sum q33univ q33univ_g codebook q33pt gen q33pt_g=. replace q33pt_g=0 if q33pt==1 replace q33pt_g=10 if q33pt==2 replace q33pt_g=30 if q33pt==3 replace q33pt_g=50 if q33pt==4 replace q33pt_g=70 if q33pt==5 replace q33pt_g=90 if q33pt==6 replace q33pt_g=100 if q33pt==7 codebook q33pt q33pt_g sum q33pt q33pt_g sum q33perm_g q33wom_g q33univ_g q33pt_g codebook HTRAIN_HTRAIN_N_HTRAIPC - HVPSHOW rename HTRAIN_HTRAIN_N_HTRAIPC qh13 rename HONJOB_HONJOB_N_HONJOBPC qh15 replace qh13=. if qh13==8 |qh13==9 replace qh15=. if qh15==8 |qh15==9 codebook IINIMWPP IINDELAY IINDIR IINIMPEA IERTRUS ICAEST ICASECT ICAOCC ICANAT rename IINIMWPP er15a rename IINDELAY er15b rename IINDIR er15c rename IINIMPEA er15d rename IERTRUS er15e rename ICAEST er12a rename ICASECT er12b rename ICAOCC er12c rename ICANAT er12d replace er15a=. if er15a==8 | er15a==9 replace er15b=. if er15b==8 | er15b==9 replace er15c=. if er15c==8 | er15c==9 replace er15d=. if er15d==8 | er15d==9 replace er15e=. if er15e==8 | er15e==9 replace er12a=. if er12a==8 | er12a==9 replace er12b=. if er12b==8 | er12b==9 replace er12c=. if er12c==8 | er12c==9 replace er12d=. if er12d==8 | er12d==9 *** 1/0 dummies replace er12a=0 if er12a==2 replace er12b=0 if er12b==2 replace er12c=0 if er12c==2 replace er12d=0 if er12d==2 ***generating cbtype: codebook er12a er12b er12c er12d drop cbtype gen cbtype=. replace cbtype=1 if er12a==1 & er12b==0 & er12c==0 & er12d==0 replace cbtype=2 if (er12b==1 | er12c==1 | er12d==1) & er12a==0 replace cbtype=3 if (er12b==1 | er12c==1 | er12d==1) & er12a==1 replace cbtype=0 if er12a==0 & er12b==0 & er12c==0 & er12d==0 list er12a er12b er12c er12d cbtype codebook cbtype sum cbtype tab cbtype table country , cont(freq mean cbtype ) format (%6.2f) ***** CHANGES IN THE ESTABLISHHMENT: E0A_A E0A_B E0A_C E0A_D E0A_E sum E0A_A E0A_B E0A_C E0A_D E0A_E // from THE MM SURVEY * FROM THE ER SURVEY codebook q26_a sum q26_a replace q26_a=. if q26_a==8 |q26_a==9 sum q26_a codebook q26_a replace q26_a=0 if q26_a==2 codebook q26_a sum q26_a replace q26_b=. if q26_b==8 |q26_b==9 codebook q26_b replace q26_b=0 if q26_b==2 codebook q26_b replace q26_e=. if q26_e==8 |q26_e==9 codebook q26_e replace q26_e=0 if q26_e==2 codebook q26_e replace q26_f=. if q26_f==8 |q26_f==9 codebook q26_f replace q26_f=0 if q26_f==2 codebook q26_f sum q26_a q26_b q26_e q26_f drop q26_e_u_domi_w q26_e_u_domi_u gen q26_e_u_domi_w=q26_e*union_domin_woco gen q26_e_u_domi_u=q26_e*union_domin_union *** MODELING EMPLOYEE INVOLVEMENT rename JREGMEE E1_A rename JSTAFFME E1_B rename JADHOC E1_C rename JDISSINF E1_D rename JSOMEDI E1_E rename JSUGGS E1_F rename JSURVEY E1_G replace E1_A=. if E1_A==8 | E1_A==9 replace E1_B=. if E1_B==8 | E1_B==9 replace E1_C=. if E1_C==8 | E1_C==9 replace E1_D=. if E1_D==8 | E1_D==9 replace E1_E=. if E1_E==8 | E1_E==9 replace E1_F=. if E1_F==8 | E1_F==9 replace E1_G=. if E1_G==8 | E1_G==9 *** 1/0 dummies replace E1_A=0 if E1_A==2 replace E1_B=0 if E1_B==2 replace E1_C=0 if E1_C==2 replace E1_D=0 if E1_D==2 replace E1_E=0 if E1_E==2 replace E1_F=0 if E1_F==2 replace E1_G=0 if E1_G==2 table country , cont(freq mean E1_A mean E1_B mean E1_C mean E1_D ) format (%6.2f) table country , cont(freq mean E1_E mean E1_F mean E1_G ) format (%6.2f) rename JCHREMU E0A_A rename JCHTECH E0A_B rename JCHALLOC E0A_C rename JCHRECRU E0A_D rename JCHTIME E0A_E replace E0A_A=. if E0A_A==8 | E0A_A==9 replace E0A_B=. if E0A_B==8 | E0A_B==9 replace E0A_C=. if E0A_C==8 | E0A_C==9 replace E0A_D=. if E0A_D==8 | E0A_D==9 replace E0A_E=. if E0A_E==8 | E0A_E==9 replace E0A_A=0 if E0A_A==2 replace E0A_B=0 if E0A_B==2 replace E0A_C=0 if E0A_C==2 replace E0A_D=0 if E0A_D==2 replace E0A_E=0 if E0A_E==2 table country , cont(freq mean E0A_A mean E0A_B mean E0A_C mean E0A_D ) format (%6.2f) table country , cont(freq mean E0A_E ) format (%6.2f) rename JERINF E0E_A rename JERCONS E0E_B rename JERDEC E0E_C rename JEMPINF E0C_A rename JEMPCONS E0C_B rename JEMPEC E0C_C replace E0E_A=. if E0E_A==8 | E0E_A==9 replace E0E_B=. if E0E_B==8 | E0E_B==9 replace E0E_C=. if E0E_C==8 | E0E_C==9 replace E0C_A=. if E0C_A==8 | E0C_A==9 replace E0C_B=. if E0C_B==8 | E0C_B==9 replace E0C_C=. if E0C_C==8 | E0C_C==9 replace E0E_A=0 if E0E_A==2 replace E0E_B=0 if E0E_B==2 replace E0E_C=0 if E0E_C==2 replace E0C_A=0 if E0C_A==2 replace E0C_B=0 if E0C_B==2 replace E0C_C=0 if E0C_C==2 table country , cont(freq mean E0E_A mean E0E_B mean E0E_C ) format (%6.2f) table country , cont(freq mean E0C_A mean E0C_B mean E0C_C ) format (%6.2f) rename JERCOPR E0F_A rename JEMCOPR E0F_B replace E0F_A=. if E0F_A==8 | E0F_A==9 replace E0F_B=. if E0F_B==8 | E0F_B==9 rename JEIDELAY E7_A rename JEIRETEN E7_B rename JEICOMP E7_C replace E7_A=. if E7_A==8 | E7_A==9 replace E7_B=. if E7_B==8 | E7_B==9 replace E7_C=. if E7_C==8 | E7_C==9 table country , cont(freq mean E0F_A mean E0F_B ) format (%6.2f) table country , cont(freq mean E7_A mean E7_B mean E7_C ) format (%6.2f) *** *** OUTCOMES *** replace KCLIMATE=. if KCLIMATE==8 | KCLIMATE==9 replace KFINAN=. if KFINAN==8 | KFINAN==9 replace KLABPRCH=. if KLABPRCH==8 | KLABPRCH==9 | KLABPRCH==7 *generating 1/0 dummy: very good=1/good/neither good nor bad/bad/very bad gen KFINAN_D=. replace KFINAN_D=1 if KFINAN==1 |KFINAN==2 replace KFINAN_D=0 if KFINAN==3 |KFINAN==4 |KFINAN==5 sum KFINAN codebook er_present // no missings in ER // replace ERTYPE_A=. if ERTYPE_A==8 | ERTYPE_A==9 replace ERTYPE_B=. if ERTYPE_B==8 | ERTYPE_B==9 replace ERTYPE_C=. if ERTYPE_C==8 | ERTYPE_C==9 replace ERTYPE_D=. if ERTYPE_D==8 | ERTYPE_D==9 replace ERTYPE_E=. if ERTYPE_E==8 | ERTYPE_E==9 replace ERTYPE_F=. if ERTYPE_F==8 | ERTYPE_F==9 replace ERTYPE_G=. if ERTYPE_G==8 | ERTYPE_G==9 *** 1/0 dummies replace ERTYPE_A=0 if ERTYPE_A==2 replace ERTYPE_B=0 if ERTYPE_B==2 replace ERTYPE_C=0 if ERTYPE_C==2 replace ERTYPE_D=0 if ERTYPE_D==2 replace ERTYPE_E=0 if ERTYPE_E==2 replace ERTYPE_F=0 if ERTYPE_F==2 replace ERTYPE_G=0 if ERTYPE_G==2 *** *** RECODING *** set more off *drop union gen union=ERTYPE_A replace union=0 if country==5 |country==16 |country==19 |country==20 drop woco gen woco=ERTYPE_B replace woco=0 if country==13 |country==18 |country==27 |country==30 *bulg, estonia, latvia replace woco=ERTYPE_D if country==2 |country==6 |country==14 *belgique replace woco=1 if ERTYPE_B==0 & ERTYPE_E==1 & country==1 * germany replace woco=1 if ERTYPE_B==0 & ERTYPE_F==1 & country==5 *spain replace woco=1 if ERTYPE_B==0 & ERTYPE_D==1 & country==9 *luxemburg replace woco=1 if ERTYPE_B==0 & ERTYPE_E==1 & country==16 *Irlanda //nunca é commum replace woco=1 if ERTYPE_B==0 & ERTYPE_C==1 & country==7 *france //nunca é commum replace woco=1 if ERTYPE_B==0 & ERTYPE_D==1 & country==10 *hungary //nunca é commum replace woco=1 if ERTYPE_B==0 & ERTYPE_E==1 & country==17 *netherlands // nunca é commum replace woco=1 if ERTYPE_B==0 & ERTYPE_E==1 & country==19 *slovenia // nunca é commum replace woco=1 if ERTYPE_B==0 & ERTYPE_D==1 & country==24 *slovakia // nunca é commum replace woco=1 if ERTYPE_B==0 & ERTYPE_D==1 & country==25 *finlandia //nunca é commum replace woco=1 if ERTYPE_B==0 & ERTYPE_E==1 & country==26 *romania replace woco=ERTYPE_E if country==23 *UK replace woco=ERTYPE_C if country==28 *tabstat ERTYPE_A- ERTYPE_G, by(country) stat(mean count) tabstat union woco, by(country) stat(mean count) *** *** *** drop ER_formal gen ER_formal=. replace ER_formal=1 if union==1 | woco==1 replace ER_formal=0 if union==0 & woco==0 sum ER_formal * generating ER_informal (only!) drop ER_informal gen ER_informal=. replace ER_informal=1 if er_present==1 & ER_formal==0 * help generates the percentage of ER_informal in total of er_present drop help gen help=. replace help=1 if er_present==1 & ER_formal==0 replace help=0 if er_present==1 & ER_formal==1 tabstat help ER_formal, by(country) stat(mean count) *** *** generating only_union, only_woco, both drop both1 only_union only_woco gen both1=union+woco-ER_formal gen only_union=union-both1 gen only_woco=woco-both1 tabstat union woco both1 only_union only_woco ER_formal ER_informal help er_present, by(country) stat(mean count) table country [pweight=w4_MM_unit_freq] , cont(freq mean union mean woco mean ER_formal) format (%6.2f) table country [pweight=w4_MM_unit_freq] if country~=29 & country~=30, cont(freq mean only_union mean only_woco mean ER_formal mean help) format (%6.2f) table country [pweight=w4_MM_unit_freq] if country~=29 & country~=30, cont(freq mean both1 mean er_present) format (%6.2f) table country , cont(freq mean ASINGLE mean APRIVATE mean ACHOWNER mean AEMPORG ) format (%6.2f) table country , cont(freq mean est_size3) format (%6.2f) table country , cont(freq mean q33perm mean q33wom mean q33old mean q33univ ) format (%6.2f) table country , cont(freq mean q33pt) format (%6.2f) table country , cont(freq mean qh13 mean qh15 ) format (%6.2f) table country if er15e~=., cont(freq mean er15a mean er15b mean er15c mean er15e) format (%6.2f) table country , cont(freq mean er15a mean er15b mean er15c mean er15d) format (%6.2f) table country , cont(freq mean er15e ) format (%6.2f) table country , cont(freq mean er12a mean er12b mean er12c mean er12d) format (%6.2f) table country , cont(freq mean anycb ) format (%6.2f) table country , cont(freq mean KCLIMATE mean KFINAN mean KLABPRCH ) format (%6.2f) table country , cont(freq mean ERTYPE_A mean ERTYPE_B mean ERTYPE_C mean ERTYPE_D ) format (%6.2f) table country , cont(freq mean ERTYPE_E mean ERTYPE_F mean ERTYPE_G ) format (%6.2f) table country , cont(freq mean er_present ) format (%6.2f) describe ASINGLE APRIVATE ACHOWNER AEMPORG est_size3 q33perm q33wom q33old q33univ q33pt qh13 qh15 anycb describe KCLIMATE KFINAN KLABPRCH er_present describe ERTYPE_A ERTYPE_B ERTYPE_C ERTYPE_D ERTYPE_E ERTYPE_F ERTYPE_G sum ASINGLE APRIVATE ACHOWNER AEMPORG est_size3 q33perm q33wom q33old q33univ q33pt qh13 qh15 anycb sum KCLIMATE KFINAN KLABPRCH er_present sum ERTYPE_A ERTYPE_B ERTYPE_C ERTYPE_D ERTYPE_E ERTYPE_F ERTYPE_G log close **** now for the ER QUESTIONNAIRE use third_ecs_er_dataset_2015.dta set more off log using mylog_ER_feb2016, replace *composition of trade unions in germany: you might like to know this. * # members replace q1=. if q1==99998 | q1==99999 sum q1 replace q1=q1+1 sum q1 * need to drop some outliers! * # trade union members replace q2=. if q2==99998 | q2==99999 sum q2 * generate percentage of trade union members in ER: drop perc_union_er gen perc_union_er=q2/q1 codebook perc_union_er sum perc_union_er *** yes, a lot of missing cases. YOU CAN TRY FOR THOSE WHO HAVE JUST A FEW MISINGS (DE, ETC.) *table country , cont(freq mean perc_union_er ) format (%6.2f) table country if perc_union_er~=. , cont(freq mean perc_union_er ) format (%6.2f) replace q4_rec=. if q4_rec==8 | q4_rec==9 table country if q4_rec~=. , cont(freq mean q4_rec ) format (%6.2f) *** assigning the middle point gen q4_rec_g=. replace q4_rec_g=0 if q4_rec==1 replace q4_rec_g=10 if q4_rec==2 replace q4_rec_g=30 if q4_rec==3 replace q4_rec_g=50 if q4_rec==4 replace q4_rec_g=70 if q4_rec==5 replace q4_rec_g=90 if q4_rec==6 replace q4_rec_g=100 if q4_rec==7 codebook q4_rec q4_rec_g sum q4_rec q4_rec_g *** new figure a la alex: table country , cont(freq mean union_ext mean woco_ext mean ER_formal mean both_ext) format (%6.2f) table country [pweight=w4_MM_unit_freq] , cont(freq mean union_ext mean woco_ext mean ER_formal mean both_ext) format (%6.2f) *or tabstat union_ext woco_ext both_ext , by(country) stat(mean count) *now union-dominated woco /ER rather!!// sum strike_incid_2 ER_formal if strike_incid_2~=. sum woco union if both==1 & strike_incid_2~=. sum woco union if both==2 & strike_incid_2~=. sum perc_union_er if both==1 & union==1 & strike_incid_2~=., det sum perc_union_er if both==1 & woco==1 & strike_incid_2~=., det sum perc_union_er if both==2 & strike_incid_2~=., det gen union_domin_ER=. replace union_domin_ER=1 if perc_union_er>0.50 & perc_union_er<1.01 replace union_domin_ER=0 if perc_union_er<0.501 sum union_domin_ER if strike_incid_2~=. table country if union_domin_ER~=. , cont(freq mean union_domin_ER) format (%6.2f) replace union_domin_ER=1 if country==27 drop union_domin_woco gen union_domin_woco=0 if perc_union_er~=. replace union_domin_woco=1 if perc_union_er>0.50 & perc_union_er<1.01 & woco_ext==1 sum union_domin_woco if strike_incid_2~=. drop union_domin_union gen union_domin_union=0 if perc_union_er~=. replace union_domin_union=1 if perc_union_er>0.50 & perc_union_er<1.01 & union_ext==1 sum union_domin_union if strike_incid_2~=. replace union_domin_union=1 if country==27 replace union_domin_woco=0 if country==27 sum union_domin_union union_domin_woco if country==27 *gen interation_1=ER107*ER106 drop interation_21 interation_22 gen interation_21=q4_rec_g*union_domin_woco gen interation_22=q4_rec_g*union_domin_union sum interation_21 interation_22 *Q20: Do you agree or disagree with the following statements replace q20_a=. if q20_a==8 | q20_a==9 replace q20_b=. if q20_b==8 | q20_b==9 * _c for hostility replace q20_c=. if q20_c==8 | q20_c==9 replace q20_d=. if q20_d==8 | q20_d==9 replace q20_e=. if q20_e==8 | q20_e==9 replace q20_f=. if q20_f==8 | q20_f==9 codebook q20_a q20_b q20_c q20_d q20_e q20_f table country , cont(freq mean q20_a mean q20_b mean q20_c mean q20_d ) format (%6.2f) table country , cont(freq mean q20_e mean q20_f ) format (%6.2f) replace q21_a=. if q21_a==8 | q21_a==9 | q21_a==7 replace q21_b=. if q21_b==8 | q21_b==9 | q21_b==7 replace q21_c=. if q21_c==8 | q21_c==9 | q21_c==7 replace q21_d=. if q21_d==8 | q21_d==9 | q21_d==7 replace q21_e=. if q21_e==8 | q21_e==9 | q21_e==7 *** 1/0 dummies replace q21_a=0 if q21_a==2 replace q21_b=0 if q21_b==2 replace q21_c=0 if q21_c==2 replace q21_d=0 if q21_d==2 replace q21_e=0 if q21_e==2 replace q25=. if q25==8 | q25==9 *** 1/0 dummies replace q25=0 if q25==2 replace q38=. if q38==8 | q38==9 replace q39=. if q39==8 | q39==9 *Q42a. Thinking more generally about the involvement of employees and of the [ER-body] in decision making in this establishment replace q42a_a=. if q42a_a==8 | q42a_a==9 replace q42a_b=. if q42a_b==8 | q42a_b==9 * _c for management can be trusted replace q42a_c=. if q42a_c==8 | q42a_c==9 *Q44. How would you rate the current general work climate in this establishment? replace q44=. if q44==8 | q44==9 *** ***recoding IR quality to 1/0 dummies; 1 always equal to 'high quality': 0=low quality. *** codebook KCLIMATE gen KCLIMATE_D=. replace KCLIMATE_D=1 if KCLIMATE==1 |KCLIMATE==2 replace KCLIMATE_D=0 if KCLIMATE==3 |KCLIMATE==4 |KCLIMATE==5 sum KCLIMATE KCLIMATE_D codebook er15e gen er15e_D=. replace er15e_D=1 if er15e==1 |er15e==2 replace er15e_D=0 if er15e==3 |er15e==4 sum er15e er15e_D codebook q20_c gen q20_c_D=. replace q20_c_D=1 if q20_c==3 |q20_c==4 replace q20_c_D=0 if q20_c==1 |q20_c==2 sum q20_c q20_c_D codebook q42a_c drop q42a_c_D gen q42a_c_D=. replace q42a_c_D=1 if q42a_c==1 |q42a_c==2 replace q42a_c_D=0 if q42a_c==3 |q42a_c==4 sum q42a_c q42a_c_D codebook q44 gen q44_D=. replace q44_D=1 if q44==1 |q44==2 replace q44_D=0 if q44==3 |q44==4 |q44==5 sum q44 q44_D ** CODING KCLIMACH codebook KCLIMACH gen KCLIMACH_D=. replace KCLIMACH_D=1 if KCLIMACH==1 replace KCLIMACH_D=0 if KCLIMACH==2 |KCLIMACH==3 sum KCLIMACH KCLIMACH_D *****INDUSTRIAL ACTION replace q46_a=. if q46_a==8 | q46_a==9 replace q46_b=. if q46_b==8 | q46_b==9 replace q46_c=. if q46_c==8 | q46_c==9 replace q46_d=. if q46_d==8 | q46_d==9 *** 1/0 dummies replace q46_a=0 if q46_a==2 replace q46_b=0 if q46_b==2 replace q46_c=0 if q46_c==2 replace q46_d=0 if q46_d==2 *** FOR THE SET OF ESTABLISHMENTS WITH AN ER BODY, of course *** compare with the Dutch guy gen anystrike=. replace anystrike=1 if q46_a==1 | q46_b==1 | q46_c==1 | q46_d==1 replace anystrike=0 if q46_a==0 & q46_b==0 & q46_c==0 & q46_d==0 codebook anystrike sum anystrike table country if anystrike~=. , cont(freq mean anystrike ) format (%6.2f) ***level //lots of missings, useless. codebook q47 replace q47=. if q47==8 replace q47=0 if q47==2 codebook q47 sum q47 table country if q47~=. , cont(freq mean q47 ) format (%6.2f) drop strike_incid_2 gen strike_incid_2=. replace strike_incid_2=0 if q46_a==1 | q46_d==1 replace strike_incid_2=0 if q46_b==0 | q46_d==0 replace strike_incid_2=1 if q46_b==1 | q46_c==1 list q46_a q46_b q46_c q46_d strike_incid_2 ***** this alternative commands give exactlyy the same result drop strike_dec gen strike_dec=. replace strike_dec=0 if q46_a==1 | q46_d==1 replace strike_dec=0 if q46_a==0 | q46_d==0 replace strike_dec=1 if q46_b==1 | q46_c==1 codebook strike_dec tab strike_incid_2 strike_dec list q46_a q46_b q46_c q46_d strike_incid_2 strike_dec if strike_dec==. codebook strike_incid_2 sum strike_incid_2 table country if strike_incid_2~=., cont(freq mean strike_incid_2 ) format (%6.2f)