The terrorist attacks of 9 September 2001 on USA is a major sociological event. It is likely to affect societal attitudes and beliefs. GSS data presents a unique opportunity to study this change in US population.It could have affected confidence of society in Federal government, security forces, legislature. It would also affect an individuals perceived sense of security. # Aim To explore changes in selected societal attitudes as reflected by GSS data after the attacks of 9/11/2001 and to generate a hypothesis based on this exploration for further analysis. # Research Question Is there a statistically significant change in following societal attitudes: 1. Social Problem Spending: Specifically, spending on army and aid to other nations. 2. Confidence in Institutions: Specifically, federal government, congress and army. 3. Threat of violence: Specifically, fear of violence in neighborhood. # Methodology Variables of interest will be compared keeping in mind the year of interview. Data from year 2000 and 2002 will be analysed. This will reflect societal attitudes prior to WTC attacks (2000) and following WTC attacks (2002).
# loading packages
library(devtools)
library(ggplot2)
library(dplyr)##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(statsr)
# loading dataframe
load("~/Documents/R_documents/_5db435f06000e694f6050a2d43fc7be3_gss.Rdata")
# creating a new dataframe for current analysis with no missing values
dfnew1 <- gss[,c(1,2,41,42,52,59,60)]
dfnew1 <- na.omit(dfnew1)
dfnew1 <- dfnew1[dfnew1$year == 2000 | dfnew1$year == 2002,]
# creating a new variable 'period'
dfnew1 <- mutate(dfnew1, period = ifelse(year == 2002 , "POST_WTC_ATTACK", "PRE_WTC_ATTACK"))## Tabulating Social problem spending (arms and aid to other nations) vs Period
prepost_arms <- table(dfnew1$natarms,dfnew1$period)
prepost_arms_prop <- prop.table(prepost_arms,2)
barplot(prepost_arms_prop,beside = T, main='Views about expenditure on arms & defence', xlab = 'Period',ylab = 'Proportion of responses',legend.text = rownames(prepost_arms_prop),col = c("darkblue","red","yellow"), ylim = c(0, 1))prepost_nataid <- table(dfnew1$nataid,dfnew1$period)
prepost_nataid_prop <- prop.table(prepost_nataid,2)
barplot(prepost_nataid_prop,beside = T, main= 'Views about expenditure on aid to other nations', xlab = 'Period',ylab = 'Proportion of responses',legend.text = rownames(prepost_arms_prop),col = c("darkblue","red","yellow"), ylim = c(0, 1)) Interpretation
Visual inspection of the bar-chart shows that proportion of respondents who feel that the current expenditure on army and defense is ‘Too less’ (dark blue) has increased after the attacks. However, the bar-chart about national expenditure on aids to other nations does not show any major trends.
## Tabulating confidence in institutions versus period
prepost_conffed <- table(dfnew1$confed,dfnew1$period)
prepost_conffed_prop <- prop.table(prepost_conffed,2)
barplot(prepost_conffed_prop,beside = T, main='Confidence in Government', xlab = 'Period',ylab = 'Proportion of responses',legend.text = rownames(prepost_conffed_prop),col = c("darkblue","red","yellow"), ylim = c(0, 1))prepost_conflegis <- table(dfnew1$conlegis,dfnew1$period)
prepost_conflegis_prop <- prop.table(prepost_conflegis,2)
barplot(prepost_conflegis_prop,beside = T, main='Confidence in Congress', xlab = 'Period',ylab = 'Proportion of responses',legend.text = rownames(prepost_conflegis_prop),col = c("darkblue","red","yellow"), ylim = c(0, 1))prepost_confarmy <- table(dfnew1$conarmy,dfnew1$period)
prepost_confarmy_prop <- prop.table(prepost_confarmy,2)
barplot(prepost_confarmy_prop,beside = T, main='Confidence in Army', xlab = 'Period',ylab = 'Proportion of responses',legend.text = rownames(prepost_confarmy_prop),col = c("darkblue","red","yellow"), ylim = c(0, 1)) Interpretation: Visual inspection shows that proportion of respondents having ‘a great deal’ of confidence in army is higher in post WTC group. There are no major trends in other two bar plots.
Conditions and hypothesis is similar to the earlier analysis. The following code chunk will cross tabulate a number of variables. Inference will be summarized at the end.
CrossTable(dfnew1$year,dfnew1$conarmy,digits = 2,expected = T,prop.r = T,prop.c = F,prop.t = F,chisq = T,prop.chisq = F)##
##
## Cell Contents
## |-------------------------|
## | N |
## | Expected N |
## | N / Row Total |
## |-------------------------|
##
##
## Total Observations in Table: 1219
##
##
## | dfnew1$conarmy
## dfnew1$year | A Great Deal | Only Some | Hardly Any | Row Total |
## -------------|--------------|--------------|--------------|--------------|
## 2000 | 310 | 406 | 87 | 803 |
## | 359.67 | 366.26 | 77.07 | |
## | 0.39 | 0.51 | 0.11 | 0.66 |
## -------------|--------------|--------------|--------------|--------------|
## 2002 | 236 | 150 | 30 | 416 |
## | 186.33 | 189.74 | 39.93 | |
## | 0.57 | 0.36 | 0.07 | 0.34 |
## -------------|--------------|--------------|--------------|--------------|
## Column Total | 546 | 556 | 117 | 1219 |
## -------------|--------------|--------------|--------------|--------------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 36.48406 d.f. = 2 p = 1.195603e-08
##
##
##
CrossTable(dfnew1$year,dfnew1$confed,digits = 2,expected = T,prop.r = T,prop.c = F,prop.t = F,chisq = T,prop.chisq = F)##
##
## Cell Contents
## |-------------------------|
## | N |
## | Expected N |
## | N / Row Total |
## |-------------------------|
##
##
## Total Observations in Table: 1219
##
##
## | dfnew1$confed
## dfnew1$year | A Great Deal | Only Some | Hardly Any | Row Total |
## -------------|--------------|--------------|--------------|--------------|
## 2000 | 99 | 415 | 289 | 803 |
## | 143.60 | 413.03 | 246.37 | |
## | 0.12 | 0.52 | 0.36 | 0.66 |
## -------------|--------------|--------------|--------------|--------------|
## 2002 | 119 | 212 | 85 | 416 |
## | 74.40 | 213.97 | 127.63 | |
## | 0.29 | 0.51 | 0.20 | 0.34 |
## -------------|--------------|--------------|--------------|--------------|
## Column Total | 218 | 627 | 374 | 1219 |
## -------------|--------------|--------------|--------------|--------------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 62.24291 d.f. = 2 p = 3.048762e-14
##
##
##
CrossTable(dfnew1$year,dfnew1$conlegis,digits = 2,expected = T,prop.r = T,prop.c = F,prop.t = F,chisq = T,prop.chisq = F)##
##
## Cell Contents
## |-------------------------|
## | N |
## | Expected N |
## | N / Row Total |
## |-------------------------|
##
##
## Total Observations in Table: 1219
##
##
## | dfnew1$conlegis
## dfnew1$year | A Great Deal | Only Some | Hardly Any | Row Total |
## -------------|--------------|--------------|--------------|--------------|
## 2000 | 92 | 474 | 237 | 803 |
## | 98.15 | 486.15 | 218.70 | |
## | 0.11 | 0.59 | 0.30 | 0.66 |
## -------------|--------------|--------------|--------------|--------------|
## 2002 | 57 | 264 | 95 | 416 |
## | 50.85 | 251.85 | 113.30 | |
## | 0.14 | 0.63 | 0.23 | 0.34 |
## -------------|--------------|--------------|--------------|--------------|
## Column Total | 149 | 738 | 332 | 1219 |
## -------------|--------------|--------------|--------------|--------------|
##
##
## Statistics for All Table Factors
##
##
## Pearson's Chi-squared test
## ------------------------------------------------------------
## Chi^2 = 6.506075 d.f. = 2 p = 0.03865662
##
##
##
Inference: 1. The first analysis shows that period of interview (2000 or 2002) and proportion of responses regarding confidence in army are dependent at a significance level of 0.04. 2. The second analysis shows that the period of interview (2000 or 2002) and proportion of responses regarding confidence in federal government are dependent at a significance level of p < 0.001. 3. The third analysis shows that period of interview (2000 or 2002) and proportion of responses regarding confidence in congress are independent of each other. ## Summary and Limitations To summaries this analysis, there is evidence that there is a difference in the opinion of adult US population about their confidence in army and federal government. However, there is no evidence of a similar trend in US populations views about their confidence in legislature, or their views about social expenditure on army or aid to other nations. This analysis could not illustrate the direction of change. Also, there are likely to be multiple confounding variables which are not considered.