Testing a Potential Moderator
I analysed the relationship between female employee rate and freedom (democracy score), with income level acting as a moderator variable. It is expected that as the democracy index is higher, the level of female employment shall rise too.
In the SAS output below we can see clearly that for low income categories (1 and 2) correlations are not significant, yet for higher income countries a strong relation is verified between female employee rate and democracy index.
SAS Code used
LIBNAME mydata "/courses/d1406ae5ba27fe300 " access=readonly; Data Analysis2; Set mydata.gapminder;
Label incomeperperson='Income per Capita' HIVrate='Estimated HIV Prevalence %' Internetuserate='Internet users (per 100 people)' breastcancerper100TH='Breast cancer new cases per 100,000 female' lifeexpectancy='Life expectancy at birth (years)' polityscore='Democracy score (Polity)' Income_Level='Income per Capita by Category' suicideper100TH='2005 Suicide, age adjusted, per 100 000' armedforcesrate='Armed forces personnel (% of total labor force)' Income_Level='Income per Capita by Category' breastcancerper100th_G= 'Breast cancer new cases per 100,000 female by Group' lifeexpectancy_G= 'Life expectancy interval' polityscore_G='Polity Score by Group' internetuserate_G='Internet users (per 100 people)by Group'; /*Data Management for incomeperperson*/ If incomeperperson <= 700 then Income_Level =1; else if incomeperperson > 700 and incomeperperson <= 5000 then Income_Level=2; else if incomeperperson > 5000 and incomeperperson<=10000 then Income_Level =3; else if incomeperperson > 10000 then income_level=4; else Income_Level=.; /*Data Management for lifeexpectancy*/ if lifeexpectancy >= 0 and lifeexpectancy <= 68 then lifeexpectancy_G = " 0-68" ; else if lifeexpectancy > 68 and lifeexpectancy <= 74 then lifeexpectancy_G ="68-74" ; else if lifeexpectancy > 74 then lifeexpectancy_G = "> 76" ; else if lifeexpectancy = . then lifeexpectancy_G = "NA" ; /*Data Management for polityscore*/ if polityscore >= -10 and polityscore <= -4 then polityscore_G = "-10 and -4" ; else if polityscore > -4 and polityscore <= 4 then polityscore_G ="-4 and 4" ; else if polityscore > 4 and polityscore <= 7 then polityscore_G ="4 and 7" ; else if polityscore > 7 and polityscore <= 9 then polityscore_G ="7 and 9" ; else if polityscore > 9 then polityscore_G = "> 9" ; else if polityscore = . then polityscore_G = "NA"; /*Data Management for internetuserrate*/ if internetuserate >= 0 and internetuserate <= 7.5 then internetuserate_G = "0 - 7.5" ; else if internetuserate > 7.5 and internetuserate <= 20 then internetuserate_G ="7.5-20"; else if internetuserate > 20 and internetuserate <= 41 then internetuserate_G = "20-41" ; else if internetuserate > 41 and internetuserate <= 66 then internetuserate_G = "41-66" ; else if internetuserate > 66 then internetuserate_G = ">66" ; else if internetuserate = . then internetuserate_G = "NA"; /*Data Management for breastcancerper100th*/ if breastcancerper100th >= 0 and breastcancerper100th <= 19 then breastcancerper100th_G = " 0 and 19" ; else if breastcancerper100th > 19 and breastcancerper100th <= 26 then breastcancerper100th_G = "19 and 26" ; else if breastcancerper100th > 26 and breastcancerper100th <= 34 then breastcancerper100th_G = "26 and 34" ; else if breastcancerper100th > 34 and breastcancerper100th <= 53 then breastcancerper100th_G = "34 and 53" ; else if breastcancerper100th > 53 then breastcancerper100th_G = ">53" ; else if breastcancerper100th = . then breastcancerper100th_G = "NA"; /*Urban Rate Groups*/ If urbanrate >= 50 then urban=1; else if urbanrate <50 then urban=0; else urban=99;
Proc Sort Data=Analysis2; by income_level;Run;
/*proc freq data=analysis2;tables income_level;run;*/
PROC CORR; VAR femaleemployrate polityscore; BY income_level;Run;










