data un; infile 'echant.complet'; file 'toto'; input vil zone cod sev lieu age per ptot nid prix sex habitat mur propc propm transp tontine taux occup vente vivri peche chasse eleva artisa revent vprotr salarie s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 lieux; y=s1+s2+s3+s4+s5+s6+s7+s8+s9+s10+s11; if zone = 1 then zone1=1; else zone1=0; if zone = 2 then zone2=1; else zone2=0; if zone = 3 then zone3=1; else zone3=0; if habitat = 1 then paille=1; else paille=0; if habitat = 2 then tole=1; else tole=0; if habitat = 3 then tuile=1; else tuile=0; if habitat = 4 then autreh=1; else autreh=0; if mur = 1 then ciment=1; else ciment=0; if mur = 2 then terre=1; else terre=0; if mur = 3 then bambou=1; else bambou=0; if mur = 4 then autrem=1; else autrem=0; if transp = 1 then bicycle=1; else bicycle=0; if transp = 2 then mobyle=1; else mobyle=0; if transp = 3 then pirog=1; else pirog=0; if transp = 4 then voiture=1; else voiture=0; if transp = 0 then autret=1; else autret=0; if occup = 1 then agri=1; else agri=0; if occup = 2 then venagr=1; else venagr=0; if occup = 3 then pech=1; else pech=0; if occup = 4 then chass=1; else chass=0; if occup = 5 then ventpra=1; else ventpra=0; if occup = 6 then venprt=1; else venprt=0; if occup = 7 then salaire=1; else salaire=0; if occup = 8 then artisan=1; else artisan=0; if occup = 9 then autreo=1; else autreo=0; if propm = 1 then maisonp=1; else maisonp=0; if propm = 0 then mlocat=1; else mlocat=0; if propc = 1 then champp=1; else champp=0; if propc = 0 then terrel=1; else terrel=0; if vil=1 then a=1; dist=log(a); if vil=2 then a=4; dist=log(a); if vil=3 then a=3; dist=log(a); if vil=4 then a=4; dist=log(a); if vil=5 then a=3; dist=log(a); if vil=6 then a=3.5; dist=log(a); if vil=7 then a=10; dist=log(a); if vil=8 then a=4; dist=log(a); if vil=9 then a=4; dist=log(a); if vil=10 then a=3; dist=log(a); if vil=11 then a=7.5; dist=log(a); if vil=12 then a=9; dist=log(a); if vil=13 then a=9; dist=log(a); if vil=14 then a=7; dist=log(a); if vil=15 then a=9; dist=log(a); if vil=16 then a=12; dist=log(a); if vil=17 then a=6.5; dist=log(a); if vil=18 then a=7.5; dist=log(a); if vil=19 then a=9; dist=log(a); if terrel = 1 or mlocat = 1 then rev_dist=dist; else rev_dist=0; age=age/100;; age2=age*age; taux=taux/1000; put #1 (sex paille tuile autreh terre bambou autrem bicycle mobyle)(6.1) #2 (voiture pirog agri pech chass ventpra venprt venagr salaire artisan maisonp)(6.1) #3 (mlocat champp terrel salarie zone2 zone3 y)(6.1) (dist rev_dist taux age age2 )(8.3); run;