rem calculate soctyp$ and related variables for ethnographic atlas basic use ethnoatlas2 let hg=v1+v2 let domsub$='OTH' if hg>=6 then let domsub$='1-HG' if v3>=6 then let domsub$='5-FI' if v4>=6 then let domsub$='6-HE' if v5>=6 then let domsub$='FA' if hg=5 and max(v3,v4,v5)<5 then let domsub$='1-HG' if v3=5 and max(hg,v4,v5)<5 then let domsub$='5-FI' if v4=5 and max(hg,v3,v5)<5 then let domsub$='6-HE' if v5=5 and max(hg,v3,v4)<5 then let domsub$='FA' if hg=4 and max(v3,v4,v5)<4 then let domsub$='1-HG' if v3=4 and max(hg,v4,v5)<4 then let domsub$='5-FI' if v4=4 and max(hg,v3,v5)<4 then let domsub$='6-HE' if v5=4 and max(hg,v3,v4)<4 then let domsub$='FA' if v1=. or v2=. or v3=. or v4=. or v5=. then let domsub$='' let soctyp$=domsub$ if v39=1 then let plow=0 else if inc(v39,2,3) then let plow=1 else let plow=. if v44=0 and v55=0 then let metals=. else if v44=9 and v55=9 then let metals=0 else let metals=1 rem farming & plow absent & metal working absent -> SH if domsub$='FA' then for if plow=0 then for if metals=0 then let soctyp$='2-SH' else if metals=1 then let soctyp$='3-AH' else let soctyp$='' next else if plow=1 then let soctyp$='4-AG' else let soctyp$='' next rem if HG and equine animals present -> OTH if domsub$='1-HG' and v40=4 then for let soctyp$='OTH' let domsub$='OTH' next if soctyp$='' then let othtyp=. else if soctyp$='OTH' then let othtyp=1 else let othtyp=0 if soctyp$='OTH' then let soctyp$='' let soctyp=cod(soctyp$,'1-HG','2-SH','3-AH','4-AG','5-FI','6-HE') rem socty42$ assign type FI if v42 indicates fishing contributes most rem discrepancy with EA is due to combining hunting and gathering rem thus socty42$ combines soctyp$ and EA v42 let socty42$=soctyp$ if v42=2 then let socty42$='5-FI' let HG=0 if soctyp$='' then let HG=. if soctyp$='1-HG' then let HG=1 let SH=0 if soctyp$='' then let SH=. if soctyp$='2-SH' then let SH=1 let AH=0 if soctyp$='' then let AH=. if soctyp$='3-AH' then let AH=1 let AG=0 if soctyp$='' then let AG=. if soctyp$='4-AG' then let AG=1 let FI=0 if soctyp$='' then let FI=. if soctyp$='5-FI' then let FI=1 let HE=0 if soctyp$='' then let HE=. if soctyp$='6-HE' then let HE=1 save 'ethnoatlas3.syd' run use ethnoatlas3 xtab print none/freq tab soctyp$ soctyp socty42$ domsub$ othtyp plow metals tab soctyp$*socty42$ tab v42*othtyp