Correlations among Hofstede's Cultural Values, Diversity, GINI, and IQ

Similar to the code I posted for ANOVA with Hofstede's Cultural Values and Economic Outcomes, you can perform correlations on the same data, for the same countries and for the similar vectors. The data file is linked via Google Drive at the end of this post.

Countries
 
[1] Australia      Austria        Belgium        Canada         Denmark       
[6] Finland        France         Germany        Greece         Iceland       
[11] Ireland        Italy          Japan          Korea          Luxembourg    
[16] Netherlands    New Zealand    Norway         Portugal       Spain         
[21] Sweden         Switzerland    United Kingdom United States   


Data Columns
 
 [1] "Country"                       "HofstederPowerDx"             
 [3] "HofstederIndividuality"        "HofstederMasculinity"         
 [5] "HofstederUncertaintyAvoidance" "Diversity_Ethnic"             
 [7] "Diversity_Linguistic"          "Diversity_Religious"          
 [9] "ReligionMatters"               "Protestantism"                
[11] "Religiosity"                   "IQ"                           
[13] "Gini"                          "Employment"                   
[15] "Unemployment"                  "EduReading"                   
[17] "EduScience"                    "TertiaryEdu"                  
[19] "LifeExpectancy"                "InfantDeath"                  
[21] "Obesity"                       "HoursWorked"                  
[23] "Prison"                        "Carvandalism"                 
[25] "Cartheft"                      "Theftfromcar"                 
[27] "Motorcycletheft"               "Bicycletheft"                 
[29] "Assaultsandthreats"            "Sexualincidents"              
[31] "Burglaries"                    "Robberies"                    


Example Code

 oecdData <- read.table("OECD - Quality of Life.csv", header = TRUE, sep = ",")  
 print(names(oecdData))

 # Correlations with Hofstede's cultural dimensions
 #, various measures of diversity, and GINI coefficient 
 v1 <- oecdData$Gini  
 v2 <- oecdData$HofstederPowerDx  
 v3 <- oecdData$HofstederMasculinity  
 v4 <- oecdData$HofstederIndividuality  
 v5 <- oecdData$HofstederUncertaintyAvoidance  
 v6 <- oecdData$Diversity_Ethnic  
 v7 <- oecdData$Diversity_Linguistic  
 v8 <- oecdData$Diversity_Religious  
 v9 <- oecdData$IQ  
 cor.test(v1, v2)  
 cor.test(v1, v3)  
 cor.test(v1, v4)  
 cor.test(v1, v5)  
 cor.test(v1, v6)  
 cor.test(v1, v7)  
 cor.test(v1, v8)  
 cor.test(v1, v9)  

 # Correlations with Hofstede's cultural dimensions
 # , various measures of diversity, and IQ  
 v1 <- oecdData$IQ  
 v2 <- oecdData$HofstederPowerDx  
 v3 <- oecdData$HofstederMasculinity  
 v4 <- oecdData$HofstederIndividuality  
 v5 <- oecdData$HofstederUncertaintyAvoidance  
 v6 <- oecdData$Diversity_Ethnic  
 v7 <- oecdData$Diversity_Linguistic  
 v8 <- oecdData$Diversity_Religious  
 v9 <- oecdData$Gini  
 cor.test(v1, v2)  
 cor.test(v1, v3)  
 cor.test(v1, v4)  
 cor.test(v1, v5)  
 cor.test(v1, v6)  
 cor.test(v1, v7)  
 cor.test(v1, v8)  
 cor.test(v1, v9)  

Example Results
 > # Correlations with Gini, Hofstede's cultural dimensions and IQ   
 + cor.test(v1, v3)  
 + cor.test(v1, v8)  
 + cor.test(v1, v9)  
 
 Pearson's product-moment correlation  
 data: v1 and v3  
 t = 0.74784, df = 20, p-value = 0.4633  
 alternative hypothesis: true correlation is not equal to 0  
 95 percent confidence interval:  
  -0.2758586 0.5484062  
 sample estimates:  
    cor   
 0.1649321   
 
 Pearson's product-moment correlation  
 data: v1 and v8  
 t = 2.2127, df = 20, p-value = 0.03871  
 alternative hypothesis: true correlation is not equal to 0  
 95 percent confidence interval:  
  0.02688847 0.72881171  
 sample estimates:  
    cor   
 0.4434696   
 
 Pearson's product-moment correlation  
 data: v1 and v9  
 t = -1.6891, df = 20, p-value = 0.1067  
 alternative hypothesis: true correlation is not equal to 0  
 95 percent confidence interval:  
  -0.67446739 0.08022647  
 sample estimates:  
     cor   
 -0.3533332   
 >   

Example Graph
 

Sample Data

Comments

Popular posts from this blog

Charting Correlation Matrices in R

Attractive Confusion Matrices in R Plotted with fourfoldplot

Calculating Value at Risk (VaR) with Python or R