Analysis of the relation between answers to survey questions about the respondent’s self-identification in the political spectrum and as environmentalists. To perform this analysis we use a chi-square test for independence
In this report we examine answers from the survey conducted by Chelsea Batavia and Andrews Forest LTER in August 2017 to explore “Influences on charitable giving for conservation.” In particular we analyze the relation between answers to survey questions about the respondent’s self-identification in the political spectrum and as environmentalists. To perform this analysis we use a \(\chi^2\) test for independence to answer: is there an association between political affiliation (conservative or liberal-leaning) and if a person considers themself an environmentalist?
All analyses are in R version 4.0.2 using RStudio Version 1.3.1093.
# --- DATA WRANGLING ----
# selecting ENV_ID and POL_OR variables and grouping conservatives/liberals
pol_env <- survey %>%
select(ENV_ID, POL_OR) %>%
clean_names() %>%
mutate(pol_bin = case_when( pol_or<=3 ~ "Conservative", # add column with grouped pol_or
5<=pol_or & pol_or<=8 ~ "Liberal")) %>%
filter(is.na(pol_bin) != TRUE) # removes answers with pol_or = 4 or >9
# --- Chi-square test for independence
pol_env_x2 <- tidy(
chisq.test(
column_to_rownames(pol_env_counts, var="pol_or"))) # make pol_orientation be the row names
From table 1 we can see half of the respondents who identify as conservative do not consider themselves environmentalists (50.24%, n=318), while a little more than half of those who identify as liberal do (53.57%, n=285). Conservatives also tend to have a clearer opinion about whether they identify as environmentalists: 16.11% (n=102) of them were unsure in comparison with 21.43% (n=114) of liberals. A \(\chi^2\) test shows that the differences in the answers of liberals and conservatives to whether they self-identify as an environmentalist is significant (\(\chi^2(2)=\) 78.8, p<0.001).
Table 1. Proportions of answers to the statement “I consider myself an environmentalist”, by political affiliation group. Counts are in parenthesis. Data: Batavia et al. (2019)
# Create finalized table including percentages using kable
final_table <- pol_env_counts %>%
adorn_percentages() %>% # include proportions
adorn_pct_formatting(digits=2) %>%
adorn_ns %>%
kable( col.names = c(" ",
"Yes",
"No",
"Unsure")
) %>%
kable_styling(full_width = FALSE)
final_table
Yes | No | Unsure | |
---|---|---|---|
Conservative | 33.65% (213) | 50.24% (318) | 16.11% (102) |
Liberal | 53.57% (285) | 25.00% (133) | 21.43% (114) |
Andrews Forest LTER Site and C. Batavia. 2019. Influences on charitable giving for conservation: Online survey data of 1,331 respondents across the US, August 2017 ver 3. Environmental Data Initiative. https://doi.org/10.6073/pasta/926e6270e324a1322a900da14d38b96c