LIBNAME mydata "/courses/d1406ae5ba27fe300 " access=readonly; DATA new; set mydata.gapminder;
Keep country incomeperperson alcconsumption hivrate co2emissions income alccons hivrt ce;
/*data management for incomeperperson*/
if incomeperperson <=60 then income = 3; if incomeperperson <=60 and incomeperson >=20 then income = 2; if incomeperperson >20 then income = 1;
/*data management for alcconsumption*/ if alcconsumption <20 then alccons ="1"; if alcconsumption >=20 and alcconsumption <40 then alccons = "2"; if alcconsumption >=40 and alcconsumption <65 then alccons = "3"; if alcconsumption >=60 and alcconsumption <90 then alccons = "4"; if alcconsumption >90 then alccons = "5";
/*data management for hivrt*/
if hivrate <20 then hivrt ="1"; if hivrate >=20 and hivrate <30 then hivrt = "2"; if hivrate >=30 and hivrate <60 then hivrt = "3"; if hivrate >=60 and hivrate <85 then hivrt = "4"; if hivrate >85 then hivrt = "5";
/*data management for co2emissions*/
if co2emissions <10 then ce ="1"; if co2emissions >=10 and co2emissions <=80 then ce = "2"; if co2emissions >80 then ce = "3"; run;
PROC FREQ; TABLES income alccons hivrt ce; RUN;










