Skip to main content

The IQ ~ Religion Matters Vector

I was reminded this morning by an article, New Study: Religious People Are Less Smart but Atheists Are Psychopaths. but realized that there are many studies showing the religious to be less intelligent, but rarely is this ever published. It would 'bite' most of the population, liberal and conservative alike.

Note: I plan on redoing this with more solid numbers, and possibly different measures of religiosity.

Example Code


 # Correlations on ReligionMatters and Average IQ   
 oecdData <- read.table("OECD - Quality of Life.csv", header = TRUE, sep = ",")  
   
 iqVector <- oecdData$IQ  
 religionMattersVector <- oecdData$ReligionMatters  
   
 cor.test(iqVector, religionMattersVector)  
   
 lm1 <- lm(iqVector ~ religionMattersVector)  
   
 summary(lm1)  
   
 # Plot the chart.  
 plot(iqVector, religionMattersVector, col = "blue", main = "IQ ~ Religion Matters Vector"
     , abline(lm(religionMattersVector ~ iqVector), xlab = "Religion Matters", ylab = "IQ"))  
   

Example Results


 Pearson's product-moment correlation  
   
 data: iqVector and religionMattersVector  
 t = -1.2819, df = 20, p-value = 0.2145  
 alternative hypothesis: true correlation is not equal to 0  
 95 percent confidence interval:  
  -0.6245927 0.1652630  
 sample estimates:  
     cor   
 -0.2755443   
   
 Call:  
 lm(formula = iqVector ~ religionMattersVector)  
   
 Residuals:  
   Min   1Q Median   3Q   Max   
 -5.9762 -2.3543 0.0996 2.5020 7.2956   
   
 Coefficients:  
                        Estimate  Std. Error t value  Pr(>|t|)    
 (Intercept)             101.531   1.902      53.381  <2e-16 ***  
 religionMattersVector  -5.436     4.241     -1.282    0.215    

 Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1  
   
 Residual standard error: 3.36 on 20 degrees of freedom  

  (2 observations deleted due to missingness)  

 Multiple R-squared: 0.07592,     Adjusted R-squared: 0.02972   

 F-statistic: 1.643 on 1 and 20 DF, p-value: 0.2145  


Sample Data

Popular posts from this blog

Decision Tree in R, with Graphs: Predicting State Politics from Big Five Traits

This was a continuation of prior explorations, logistic regression predicting Red/Blue state dichotomy by income or by personality. This uses the same five personality dimensions, but instead builds a decision tree. Of the Big Five traits, only two were found to useful in the decision tree, conscientiousness and openness.

Links to sample data, as well as to source references, are at the end of this entry.

Example Code

# Decision Tree - Big Five and Politics library("rpart") # grow tree input.dat <- read.table("BigFiveScoresByState.csv", header = TRUE, sep = ",") fit <- rpart(Liberal ~ Openness + Conscientiousness + Neuroticism + Extraversion + Agreeableness, data = input.dat, method="poisson") # display the results printcp(fit) # visualize cross-validation results plotcp(fit) # detailed summary of splits summary(fit) # plot tree plot(fit, uniform = TRUE, main = "Classific…

Chi-Square in R on by State Politics (Red/Blue) and Income (Higher/Lower)

This is a significant result, but instead of a logistic regression looking at the income average per state and the likelihood of being a Democratic state, it uses Chi-Square. Interpreting this is pretty straightforward, in that liberal states typically have cities and people that earn more money. When using adjusted incomes, by cost of living, this difference disappears.

Example Code
# R - Chi Square rm(list = ls()) stateData <- read.table("CostByStateAndSalary.csv", header = TRUE, sep = ",") # Create vectors affluence.median <- median(stateData$Y2014, na.rm = TRUE) affluence.v <- ifelse(stateData$Y2014 > affluence.median, 1, 0) liberal.v <- stateData$Liberal # Solve pol.Data = table(liberal.v, affluence.v) result <- chisq.test(pol.Data) print(result) print(pol.Data)
Example Results
Pearson's Chi-squared test with Yates' continuity correction data: pol.Data X-squared = 12.672, df …

Mean Median, and Mode with R, using Country-level IQ Estimates

Reusing the code posted for Correlations within with Hofstede's Cultural Values, Diversity, GINI, and IQ, the same data can be used for mean, median, and mode. Additionally, the summary function will return values in addition to mean and median, Min, Max, and quartile values:

Example Code
oecdData <- read.table("OECD - Quality of Life.csv", header = TRUE, sep = ",") v1 <- oecdData$IQ # Mean with na.rm = TRUE removed NULL avalues mean(v1, na.rm = TRUE) # Median with na.rm = TRUE removed NULL values median(v1, na.rm = TRUE) # Returns the same data as mean and median, but also includes distribution values: # Min, Quartiles, and Max summary(v1) # Mode does not exist in R, so we need to create a function getmode <- function(v) { uniqv <- unique(v) uniqv[which.max(tabulate(match(v, uniqv)))] } #returns the mode getmode(v1)
Example Results
> oecdData <- read.table("OECD - Quality of L…