diff --git a/.RData b/.RData index 07b203d..e90e4e1 100644 Binary files a/.RData and b/.RData differ diff --git a/.Rhistory b/.Rhistory index 16b713b..1f75692 100644 --- a/.Rhistory +++ b/.Rhistory @@ -1,458 +1,8 @@ -age_pie <- pie(table(TSR_data$Age), col=coul3) -TSR_data$MOST.RECENT.year.of.study <- factor(TSR_data$MOST.RECENT.year.of.study, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9), labels = c("Year 11/S4/Year 12(NI)", "Year 12/S5/Year 13(NI)", "Year 13/S6/Year 14(NI)", "I am currently on a gap year", "I am currently on an undergraduate/HE college course", "I am in full-time employment", "I am unemployed", "Other", "Prefer not to say")) -TSR_data$Age <- age_pie <- pie(table(factor(TSR_data$Age, levels = c(1, 2, 3, 4, 5, 6, 7, 8), labels = c("15 or under", "16", "17", "18", "19", "20", "21 or over", "Prefer not to say"))), col=coul3) -TSR_data$Age <- age_pie <- pie(table(factor(TSR_data$Age, levels = c(1, 2, 3, 4, 5, 6, 7, 8), labels = c("15 or under", "16", "17", "18", "19", "20", "21 or over", "Prefer not to say")), col=coul3) -pie(table(factor(TSR_data$Age, levels = c(1, 2, 3, 4, 5, 6, 7, 8), labels = c("15 or under", "16", "17", "18", "19", "20", "21 or over", "Prefer not to say"))), col=coul3) -pie(table(factor(TSR_data$Age, levels = c(1, 2, 3, 4, 5, 6, 7, 8), labels = c("15 or under", "16", "17", "18", "19", "20", "21 or over", "Prefer not to say"))), col=coul3)) -age_pie <- pie(table(TSR_data$Age, levels = c(1, 2, 3, 4, 5, 6, 7, 8), labels = c("15 or under", "16", "17", "18", "19", "20", "21 or over", "Prefer not to say")), col=coul3) -age_pie <- pie(table(TSR_data$Age, levels = c(1, 2, 3, 4, 5, 6, 7, 8), labels = c("15 or under", "16", "17", "18", "19", "20", "21 or over", "Prefer not to say")), col=coul3)) -TSR_data <- read.csv("./data/TSR data complete.csv") -TSR_data_summaries$Age <- factor(TSR_data$Age, levels = c(1, 2, 3, 4, 5, 6, 7, 8), labels = c("15 or under", "16", "17", "18", "19", "20", "21 or over", "Prefer not to say")) -TSR_data_summaries <- factor(TSR_data$Age, levels = c(1, 2, 3, 4, 5, 6, 7, 8), labels = c("15 or under", "16", "17", "18", "19", "20", "21 or over", "Prefer not to say")) -age_pie <- pie(table(TSR_data_summaries$Age), col=coul3) -age_pie <- pie(table(TSR_data_summaries), col=coul3) -# JK note: To keep things tidy, I've shifted the code here so that this isn't overwriting the dataset, but is instead operating off a separate df (same below) -TSR_data_summaries_age <- factor(TSR_data$Age, levels = c(1, 2, 3, 4, 5, 6, 7, 8), labels = c("15 or under", "16", "17", "18", "19", "20", "21 or over", "Prefer not to say")) -age_pie <- pie(table(TSR_data_summaries_age), col=coul3) -age_pie <- pie(table(TSR_data_summaries_age), col=coul3, cex = 0.8) -Ethnicity_bar <- ggplot(TSR_data, aes(Ethnicity)) + geom_bar() + coord_flip() -Ethnicity_bar -ggplot(TSR_data, aes(TSR_data_summaries_age)) + geom_bar() -# JK note: adding in a bar chart here, as according to the interwebs it's (apparently?) more accurate to visualise than bar charts -ggplot(TSR_data, aes(TSR_data_summaries_age)) + geom_bar() +coord_flip() -# JK note: adding in a bar chart here, as according to the interwebs it's (apparently?) more accurate to visualise than bar charts -ggplot(TSR_data, aes(TSR_data_summaries_age, fill=match)) + geom_bar() +coord_flip() -# JK note: adding in a bar chart here, as according to the interwebs it's (apparently?) more accurate to visualise than bar charts -ggplot(TSR_data, aes(TSR_data_summaries_age, fill=coul3)) + geom_bar() +coord_flip() -# JK note: adding in a bar chart here, as according to the interwebs it's (apparently?) more accurate to visualise than bar charts -ggplot(TSR_data, aes(TSR_data_summaries_age)) + geom_bar() -# JK note: adding in a bar chart here, as according to the interwebs it's (apparently?) more accurate to visualise than bar charts -ggplot(TSR_data, aes(TSR_data_summaries_age)) + geom_bar() -# save to png file for reports -ggsave("TSR_data_summaries_age.png") -# save to png file for reports -ggsave("figures/TSR_data_summaries_age.png") -# JK note: adding in a bar chart here, as according to the interwebs it's (apparently?) more accurate to visualise than bar charts -ggplot(TSR_data, aes(TSR_data_summaries_age)) + geom_bar() + title("Age of respondents") -# JK note: To keep things tidy, I've shifted the code here so that this isn't overwriting the dataset, but is instead operating off a separate df (same below) -TSR_data_summaries_age <- factor(TSR_data$Age, levels = c(1, 2, 3, 4, 5, 6, 7, 8), labels = c("15 or under", "16", "17", "18", "19", "20", "21 or over", "Prefer not to say")) -data_summaries_age labs(colour = "TSR_data_summaries_age") -data_summaries_age labs(title = "Respondent Age") -# JK note: adding in a bar chart here, as according to the interwebs it's (apparently?) more accurate to visualise than bar charts -data_summaries_age <- ggplot(TSR_data, aes(TSR_data_summaries_age)) + geom_bar() + title("Age of respondents") -# JK note: adding in a bar chart here, as according to the interwebs it's (apparently?) more accurate to visualise than bar charts -data_summaries_age <- ggplot(TSR_data, aes(TSR_data_summaries_age)) + geom_bar() -data_summaries_age labs(title = "Respondent Age") -data_summaries_age + labs(title = "Respondent Age") -data_summaries_age + labs(title = "Respondent Age Distribution", x = "Age") -data_summaries_age + labs(title = "Respondent Age Distribution", x = "Age", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_age.png") -TSR_data_summaries_most_recent_year_of_study <- factor(TSR_data$MOST.RECENT.year.of.study, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9), labels = c("Year 11/S4/Year 12(NI)", "Year 12/S5/Year 13(NI)", "Year 13/S6/Year 14(NI)", "I am currently on a gap year", "I am currently on an undergraduate/HE college course", "I am in full-time employment", "I am unemployed", "Other", "Prefer not to say")) -Year_study_pie <- pie(table(TSR_data_summaries_most_recent_year_of_study)) -Year_study_pie <- pie(table(TSR_data_summaries_most_recent_year_of_study$MOST.RECENT.year.of.study)) -TSR_data_summaries_most_recent_year_of_study <- factor(TSR_data$MOST.RECENT.year.of.study, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9), labels = c("Year 11/S4/Year 12(NI)", "Year 12/S5/Year 13(NI)", "Year 13/S6/Year 14(NI)", "I am currently on a gap year", "I am currently on an undergraduate/HE college course", "I am in full-time employment", "I am unemployed", "Other", "Prefer not to say")) -data_summaries_yos <- factor(TSR_data$MOST.RECENT.year.of.study, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9), labels = c("Year 11/S4/Year 12(NI)", "Year 12/S5/Year 13(NI)", "Year 13/S6/Year 14(NI)", "I am currently on a gap year", "I am currently on an undergraduate/HE college course", "I am in full-time employment", "I am unemployed", "Other", "Prefer not to say")) -Year_study_pie <- pie(table(data_summaries_yos$MOST.RECENT.year.of.study)) -Year_study_pie <- pie(table(data_summaries_yos)) -TSR_data <- read.csv("./data/TSR data complete.csv") -data_summaries_yos <- factor(TSR_data$MOST.RECENT.year.of.study, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9), labels = c("Year 11/S4/Year 12(NI)", "Year 12/S5/Year 13(NI)", "Year 13/S6/Year 14(NI)", "I am currently on a gap year", "I am currently on an undergraduate/HE college course", "I am in full-time employment", "I am unemployed", "Other", "Prefer not to say")) -Year_study_pie <- pie(table(data_summaries_yos)) -pie(table(data_summaries_yos)) -TSR_data_summaries_yos <- factor(TSR_data$MOST.RECENT.year.of.study, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9), labels = c("Year 11/S4/Year 12(NI)", "Year 12/S5/Year 13(NI)", "Year 13/S6/Year 14(NI)", "I am currently on a gap year", "I am currently on an undergraduate/HE college course", "I am in full-time employment", "I am unemployed", "Other", "Prefer not to say")) -data_summaries_yos <- ggplot(TSR_data, aes(TSR_data_summaries_yos)) + geom_bar() -data_summaries_yos + labs(title = "Respondent Most Recent Year of Study", x = "Age", y = "") -data_summaries_yos <- ggplot(TSR_data_summaries_yos, aes(TSR_data_summaries_yos)) + geom_bar() -TSR_data$MOST.RECENT.year.of.study <- factor(TSR_data$MOST.RECENT.year.of.study, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9), labels = c("Year 11/S4/Year 12(NI)", "Year 12/S5/Year 13(NI)", "Year 13/S6/Year 14(NI)", "I am currently on a gap year", "I am currently on an undergraduate/HE college course", "I am in full-time employment", "I am unemployed", "Other", "Prefer not to say")) -TSR_data <- read.csv("./data/TSR data complete.csv") -View(TSR_data) -View(TSR_data) -TSR_data_summaries_yos <- factor(TSR_data$MOSTRECENTyearofstudy, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9), labels = c("Year 11/S4/Year 12(NI)", "Year 12/S5/Year 13(NI)", "Year 13/S6/Year 14(NI)", "I am currently on a gap year", "I am currently on an undergraduate/HE college course", "I am in full-time employment", "I am unemployed", "Other", "Prefer not to say")) -data_summaries_yos <- ggplot(TSR_data_summaries_yos, aes(TSR_data_summaries_yos)) + geom_bar() -data_summaries_yos <- ggplot(TSR_data, aes(TSR_data_summaries_yos)) + geom_bar() -data_summaries_yos + labs(title = "Respondent Most Recent Year of Study", x = "Age", y = "") -data_summaries_yos + labs(title = "Respondent Most Recent Year of Study", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_age.png") -# save to png file for reports -ggsave("figures/TSR_data_summaries_yos.png") -# JK note: adding in a bar chart here, as according to the interwebs it's (apparently?) more accurate to visualise than bar charts -data_summaries_age <- ggplot(TSR_data, aes(TSR_data_summaries_age)) + geom_bar() -data_summaries_age + labs(title = "Respondent Age Distribution", x = "Age", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_age.png") -TSR_data_summaries_gender <- factor(TSR_data$Gender, levels = c(1, 2, 3, 4), labels = c("Male", "Female", "I identify my gender in another way", "Prefer not to say")) -data_summaries_gender + labs(title = "Respondent gender self-identification", x = "", y = "") -TSR_data_summaries_gender <- factor(TSR_data$Gender, levels = c(1, 2, 3, 4), labels = c("Male", "Female", "I identify my gender in another way", "Prefer not to say")) -data_summaries_gender <- ggplot(TSR_data, aes(TSR_data_summaries_gender)) + geom_bar() -data_summaries_gender + labs(title = "Respondent gender self-identification", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_gender.png") -install.packages("stringr") # Install stringr package, used for wrapping label text in plots -install.packages("stringr") -library("stringr") # Load stringr -data_summaries_gender + labs(title = "Respondent gender self-identification", x = "", y = "") + str_wrap(x, width = 10)) -data_summaries_gender + labs(title = "Respondent gender self-identification", x = "", y = "") str_wrap(x, width = 10)) -data_summaries_gender + labs(title = "Respondent gender self-identification", x = "", y = "") + str_wrap(x, width = 10) -data_summaries_gender <- ggplot(TSR_data, aes(TSR_data_summaries_gender)) + geom_bar() -library(ggplot2) -library(devtools) -library(devtools) -library(usethis) -library(devtools) -library(likert) -# Load RColorBrewer -# install.packages("RColorBrewer") -library(RColorBrewer) -install.packages("stringr") # Install stringr package, used for wrapping label text in plots -library("stringr") # Load stringr package, used for wrapping label text in plots -# Define colour palettes for plots below -coul3 <- brewer.pal(3, "RdYlBu") # Using RdYlBu range to generate 3 colour palette: https://colorbrewer2.org/#type=diverging&scheme=RdYlBu&n=5 -TSR_data <- read.csv("./data/TSR data complete.csv") -subject_data <- read.csv("./data/Subject data.csv") -knitr::opts_chunk$set(echo = TRUE) -library(ggplot2) -library(devtools) -library(usethis) -library(devtools) -library(likert) -# Load RColorBrewer -# install.packages("RColorBrewer") -library(RColorBrewer) -library("stringr") # Load stringr package, used for wrapping label text in plots -# Define colour palettes for plots below -coul3 <- brewer.pal(3, "RdYlBu") # Using RdYlBu range to generate 3 colour palette: https://colorbrewer2.org/#type=diverging&scheme=RdYlBu&n=5 -TSR_data <- read.csv("./data/TSR data complete.csv") -subject_data <- read.csv("./data/Subject data.csv") -# JK note: To keep things tidy, I've shifted the code here so that this isn't overwriting the dataset, but is instead operating off a separate df (same below) -TSR_data_summaries_age <- factor(TSR_data$Age, levels = c(1, 2, 3, 4, 5, 6, 7, 8), labels = c("15 or under", "16", "17", "18", "19", "20", "21 or over", "Prefer not to say")) -# JK note: adding in a bar chart here, as according to the interwebs it's (apparently?) more accurate to visualise than bar charts -data_summaries_age <- ggplot(TSR_data, aes(TSR_data_summaries_age)) + geom_bar() -data_summaries_age + labs(title = "Respondent Age Distribution", x = "Age", y = "") -TSR_data_summaries_yos <- factor(TSR_data$MOSTRECENTyearofstudy, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9), labels = c("Year 11/S4/Year 12(NI)", "Year 12/S5/Year 13(NI)", "Year 13/S6/Year 14(NI)", "I am currently on a gap year", "I am currently on an undergraduate/HE college course", "I am in full-time employment", "I am unemployed", "Other", "Prefer not to say")) -data_summaries_yos <- ggplot(TSR_data, aes(TSR_data_summaries_yos)) + geom_bar() -data_summaries_yos + labs(title = "Respondent Most Recent Year of Study", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_yos.png") -TSR_data_summaries_gender <- factor(TSR_data$Gender, levels = c(1, 2, 3, 4), labels = c("Male", "Female", "I identify my gender in another way", "Prefer not to say")) -data_summaries_gender <- ggplot(TSR_data, aes(TSR_data_summaries_gender)) + geom_bar() -data_summaries_gender + labs(title = "Respondent gender self-identification", x = "", y = "") + str_wrap(x, width = 10) -TSR_data_summaries_gender <- str_wrap(TSR_data_summaries_gender, width = 10) -data_summaries_gender <- ggplot(TSR_data, aes(TSR_data_summaries_gender)) + geom_bar() -data_summaries_gender + labs(title = "Respondent gender self-identification", x = "", y = "") + str_wrap(x, width = 10) -data_summaries_gender + labs(title = "Respondent gender self-identification", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_gender.png") -TSR_data_summaries_ethnicity$ethnicity <- factor(TSR_data$Ethnicity, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ,18, 19), labels = c("Arab", "Asian/Asian British - Indian", "Asian/Asian British - Pakistani", "Asian/Asian British - Bangladeshi", "Asian/Asian British - Chinese", "Asian/Asian British - Any other Asian background", "Black/Black British - African", "Black/Black British - Caribbean", "Black/Black British - Any other Black background", "Mixed/Multiple Ethnic Groups - White and Black Caribbean", "Mixed/Multiple Ethnic Groups - White and Black African", "Mixed/Multiple Ethnic Groups - White and Black Asian", "Mixed/Multiple Ethnic Groups - Any other Mixed/Multiple Ethnic background", "White - English/Welsh/Scottish/Northern Irish/British", "White - Irish", "White - Gypsy or Irish Traveller", "White - Any other White background", "Other Ethnic group, please describe", "Prefer not to say")) -TSR_data_summaries_ethnicity <- factor(TSR_data$Ethnicity, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ,18, 19), labels = c("Arab", "Asian/Asian British - Indian", "Asian/Asian British - Pakistani", "Asian/Asian British - Bangladeshi", "Asian/Asian British - Chinese", "Asian/Asian British - Any other Asian background", "Black/Black British - African", "Black/Black British - Caribbean", "Black/Black British - Any other Black background", "Mixed/Multiple Ethnic Groups - White and Black Caribbean", "Mixed/Multiple Ethnic Groups - White and Black African", "Mixed/Multiple Ethnic Groups - White and Black Asian", "Mixed/Multiple Ethnic Groups - Any other Mixed/Multiple Ethnic background", "White - English/Welsh/Scottish/Northern Irish/British", "White - Irish", "White - Gypsy or Irish Traveller", "White - Any other White background", "Other Ethnic group, please describe", "Prefer not to say")) -Ethnicity_bar <- ggplot(TSR_data, aes(Ethnicity)) + geom_bar() + coord_flip() -Ethnicity_bar <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_bar() + coord_flip() -Ethnicity_bar -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_bar() + coord_flip() -data_summaries_ethnicity -TSR_data_summaries_ethnicity <- str_wrap(TSR_data_summaries_ethnicity, width = 20) -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_bar() + coord_flip() -data_summaries_ethnicity -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_bar() + coord_flip() + xlab(NULL) + ylab(yaxis_label) -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_bar() + coord_flip() + xlab(NULL) -data_summaries_ethnicity -# save to png file for reports -ggsave("figures/TSR_data_summaries_ethnicity.png") -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_col()) + coord_flip() + xlab(NULL) -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_col() + coord_flip() + xlab(NULL) -data_summaries_ethnicity -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_bar() + scale_x_discrete(labels = wrap) + xlab(NULL) + coord_flip() -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_bar() + xlab(NULL) + coord_flip() -data_summaries_ethnicity -TSR_data_summaries_ethnicity <- str_wrap(TSR_data_summaries_ethnicity, width = 30) -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_bar() + xlab(NULL) + coord_flip() -data_summaries_ethnicity -TSR_data_summaries_ethnicity <- factor(TSR_data$Ethnicity, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ,18, 19), labels = c("Arab", "Indian", "Pakistani", "Bangladeshi", "Chinese", "Any other Asian background", "African", "Caribbean", "Any other Black background", "White and Black Caribbean", "White and Black African", "White and Black Asian", "Any other Mixed/Multiple Ethnic background", "White - British", "White - Irish", "Gypsy or Irish Traveller", "Any other White background", "Other Ethnic group", "Prefer not to say")) -TSR_data_summaries_ethnicity <- str_wrap(TSR_data_summaries_ethnicity, width = 30) -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_bar() + xlab(NULL) + coord_flip() -data_summaries_ethnicity -TSR_data_summaries_ethnicity <- factor(TSR_data$Ethnicity, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ,18, 19), labels = c("Arab", "Indian", "Pakistani", "Bangladeshi", "Chinese", "Any other Asian background", "Black - African", "Black - Caribbean", "Any other Black background", "Mixed - White and Black Caribbean", "Mixed - White and Black African", "Mixed - White and Black Asian", "Any other Mixed/Multiple Ethnic background", "White - British", "White - Irish", "Gypsy or Irish Traveller", "Any other White background", "Other Ethnic group", "Prefer not to say")) -TSR_data_summaries_ethnicity <- str_wrap(TSR_data_summaries_ethnicity, width = 30) -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_bar() + xlab(NULL) + coord_flip() -data_summaries_ethnicity -# save to png file for reports -ggsave("figures/TSR_data_summaries_ethnicity.png") -TSR_data_summaries_religion <- factor(TSR_data$Religious.Affliation, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), labels = c("Agnostic", "Atheist", "Baha'i", "Buddhist", "Christian", "Confucian", "Jain", "Jewish", "Hindu", "Indigenous Traditional Religious", "Muslim", "Pagan", "Shinto", "Sikh", "Spiritual but not religious", "Zoroastrian", "No religion", "Prefer not to say", "Other")) -Religious_affiliation_bar <- ggplot(TSR_data, aes(Religious.Affliation)) + geom_bar() + coord_flip() -Religious_affiliation_bar -Religious_affiliation_bar <- ggplot(TSR_data, aes(TSR_data_summaries_religion)) + geom_bar() + coord_flip() -Religious_affiliation_bar -TSR_data_summaries_religion <- factor(TSR_data$Religious.Affliation, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), labels = c("Agnostic", "Atheist", "Baha'i", "Buddhist", "Christian", "Confucian", "Jain", "Jewish", "Hindu", "Indigenous Traditional Religious", "Muslim", "Pagan", "Shinto", "Sikh", "Spiritual but not religious", "Zoroastrian", "No religion", "Prefer not to say", "Other")) -Religious_affiliation_bar <- ggplot(TSR_data, aes(TSR_data_summaries_religion)) + geom_bar() + coord_flip() -Religious_affiliation_bar -Religious_affiliation_bar <- ggplot(TSR_data_summaries_religion, aes(TSR_data_summaries_religion)) + geom_bar() + coord_flip() -Religious_affiliation_bar -View(Religious_affiliation_bar) -TSR_data_summaries_religion <- factor(TSR_data$ReligiousAffliation, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), labels = c("Agnostic", "Atheist", "Baha'i", "Buddhist", "Christian", "Confucian", "Jain", "Jewish", "Hindu", "Indigenous Traditional Religious", "Muslim", "Pagan", "Shinto", "Sikh", "Spiritual but not religious", "Zoroastrian", "No religion", "Prefer not to say", "Other")) -Religious_affiliation_bar <- ggplot(TSR_data, aes(Religious.Affliation)) + geom_bar() + coord_flip() -Religious_affiliation_bar -Religious_affiliation_bar <- ggplot(TSR_data, aes(TSR_data_summaries_religion)) + geom_bar() + coord_flip() -Religious_affiliation_bar -data_summaries_ethnicity + labs(title = "Respondent ethnic self-identification", x = "", y = "") -data_summaries_ethnicity -# save to png file for reports -ggsave("figures/TSR_data_summaries_ethnicity.png") -TSR_data_summaries_ethnicity <- str_wrap(TSR_data_summaries_ethnicity, width = 30) -data_summaries_ethnicity <- ggplot(TSR_data, aes(TSR_data_summaries_ethnicity)) + geom_bar() + xlab(NULL) + coord_flip() -data_summaries_ethnicity + labs(title = "Respondent ethnic self-identification", x = "", y = "") -data_summaries_ethnicity -# save to png file for reports -ggsave("figures/TSR_data_summaries_ethnicity.png") -data_summaries_ethnicity + labs(title = "Respondent ethnic self-identification", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_ethnicity.png") -Religious_affiliation_bar <- ggplot(TSR_data, aes(TSR_data_summaries_religion)) + geom_bar() + coord_flip() -Religious_affiliation_bar + labs(title = "Respondent religious self-identification", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_religion.png") -#Q5 Subject Knowledge/Understanding -subject_data$Subject <- factor(subject_data$Subject, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), labels = c("Philosophy", "Sociology", "Psychology", "History", "Ethics", "Theology", "Religious Studies", "Politics", "English", "Math", "Computer Science", "Business")) -understanding_mean <- aggregate(Understanding ~ Subject, data = subject_data, mean) -understanding_bar <- ggplot(understanding_mean, aes(x = Subject, y = Understanding)) + stat_summary(fun = "mean", geom = "bar") + coord_flip() -understanding_bar -understanding_bar + labs(title = "I have a good understanding of what this subject involves?", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_subject_understanding.png") -understanding_mean <- aggregate(Understanding ~ Subject, data = subject_data, mean) -understanding_bar <- ggplot(understanding_mean, aes(x = Subject, y = Understanding)) + stat_summary(fun = "mean", geom = "bar") + coord_flip() -understanding_bar + labs(title = "I have a good understanding of what this subject involves?", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_subject_understanding.png") -#Q6 Subject Interest -interest_mean <- aggregate(Interest ~ Subject, data = subject_data, mean) -interest_bar <- ggplot(interest_mean, aes(x = Subject, y = Interest)) + stat_summary(fun = "mean", geom = "bar") + coord_flip() -interest_bar + labs(title = "I would be interested in studying this subject at University?", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_subject_interest.png") -employability_mean <- aggregate(Employability ~ Subject, data = subject_data, mean) -employability_bar <- ggplot(employability_mean, aes(x = Subject, y = Employability)) + stat_summary(fun = "mean", geom = "bar") + coord_flip() -employability_bar + labs(title = "please rate from 1 to 5 where 1 represents 'Good employability prospects’ and 5 represents ‘Poor employability prospects'", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_subject_employability.png") -employability_bar + labs(title = "please rate ... employability prospects", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_subject_employability.png") -#likert_test <- likert(subject_data) -Understanding_data <- TSR_data[, 6:17] -likert_test_understand <- likert(Understanding_data) -#likert_test <- likert(subject_data) -likert(TSR_data[, 6:17]) -#likert_test <- likert(subject_data) -likert(TSR_data[, 6]) -#likert_test <- likert(subject_data) -likert(items=TSR_data[, 6], drop=FALSE) -#likert_test <- likert(subject_data) -likert(items=TSR_data[, 6]) -#likert_test <- likert(subject_data) -Understanding_data <- TSR_data[, 6:17] -View(Understanding_data) -likert_test_understand <- likert(Understanding_data$GoodunderstandingofTheology) -likert_test_understand <- likert(Understanding_data) -understanding_data <- TSR_data[, 6] -understanding_data <- TSR_data[, 6] -l24g <- likert(understanding_data) -TSR_data <- read.csv("./data/TSR data complete.csv") -understanding_data <- TSR_data[, 6] -likert_test_understand <- likert(understanding_data) -as.data.frame(TSR_data) -#likert_test <- likert(subject_data) -understanding_data <- as.data.frame(TSR_data) -View(understanding_mean) -View(understanding_mean) -View(understanding_data) -View(understanding_data) -likert_test_understand <- likert(understanding_data) -keysubjects_data <- subject_data[subject_data$Subject == "Philosophy" | subject_data$Subject == "Ethics" | subject_data$Subject == "Theology" | subject_data$Subject == "Religious Studies", ] -recode_interest <- ifelse(3 <= keysubjects_data$Interest & keysubjects_data$Interest >=5, "Positive", "Negative") -keysubjects_data <- cbind(keysubjects_data, recode_interest) -keysubjects_data$recode_interest <- factor(keysubjects_data$recode_interest) -table(keysubjects_data$recode_interest, keysubjects_data$Subject) -View(keysubjects_data) -recode_interest <- ifelse(2 <= keysubjects_data$Interest & keysubjects_data$Interest >=4, "Positive", "Negative") -keysubjects_data <- cbind(keysubjects_data, recode_interest) -keysubjects_data$recode_interest <- factor(keysubjects_data$recode_interest) -table(keysubjects_data$recode_interest, keysubjects_data$Subject) -View(keysubjects_data) -keysubjects_data <- subject_data[subject_data$Subject == "Philosophy" | subject_data$Subject == "Ethics" | subject_data$Subject == "Theology" | subject_data$Subject == "Religious Studies", ] -recode_interest <- ifelse(2 <= keysubjects_data$Interest & keysubjects_data$Interest >=4, "Positive", "Negative") -keysubjects_data <- cbind(keysubjects_data, recode_interest) -keysubjects_data$recode_interest <- factor(keysubjects_data$recode_interest) -table(keysubjects_data$recode_interest, keysubjects_data$Subject) -write.csv(table(keysubjects_data$recode_interest, keysubjects_data$Subject), "derivedData/interest_table.csv", row.names=TRUE) -interest_table <- table(keysubjects_data$recode_interest, keysubjects_data$Subject) -write.csv(interest_table, "derivedData/interest_table.csv", row.names=TRUE) -derivedData -write.csv(interest_table, "derivedData/interest_table.csv", row.names=TRUE) -# Set up local workspace: -if (dir.exists("data") == FALSE) { -dir.create("data") -} -if (dir.exists("figures") == FALSE) { -dir.create("figures") -} -if (dir.exists("derivedData") == FALSE) { -dir.create("derivedData") -} -# export table to csv -write.csv(interest_table, "derivedData/interest_table.csv", row.names=TRUE) -### Philosophy ### -Philos_subset_Low <- TSR_data[TSR_data$GoodunderstandingofPhilosophy < 3 & TSR_data$GoodunderstandingofPhilosophy != 0, ] -Philos_subset_High <- TSR_data[TSR_data$GoodunderstandingofPhilosophy > 3, ] -# Low interest cohort -Philos_subset_Low <- TSR_data[TSR_data$GoodunderstandingofPhilosophy < 3 & TSR_data$GoodunderstandingofPhilosophy != 0, ] -# High interest cohort -Philos_subset_High <- TSR_data[TSR_data$GoodunderstandingofPhilosophy > 3, ] -# Low understanding of philosophy cohort -Philos_subset_Low <- TSR_data[TSR_data$GoodunderstandingofPhilosophy < 3 & TSR_data$GoodunderstandingofPhilosophy != 0, ] -# High understanding of philosophy cohort -Philos_subset_High <- TSR_data[TSR_data$GoodunderstandingofPhilosophy > 3, ] -subject_data$Subject -keysubjects_data <- subject_data[subject_data$Subject == "Philosophy" | subject_data$Subject == "Ethics" | subject_data$Subject == "Theology" | subject_data$Subject == "Religious Studies" | subject_data$Subject == "Sociology", ] -recode_interest <- ifelse(2 <= keysubjects_data$Interest & keysubjects_data$Interest >=4, "Positive", "Negative") -keysubjects_data <- cbind(keysubjects_data, recode_interest) -keysubjects_data$recode_interest <- factor(keysubjects_data$recode_interest) -interest_table <- table(keysubjects_data$recode_interest, keysubjects_data$Subject) -# export table to csv -write.csv(interest_table, "derivedData/interest_table.csv", row.names=TRUE) -keysubjects_data <- subject_data[subject_data$Subject == "Philosophy" | subject_data$Subject == "Ethics" | subject_data$Subject == "Theology" | subject_data$Subject == "Religious Studies" | subject_data$Subject == "Sociology" | subject_data$Subject == "Psychology" | subject_data$Subject == "History" | subject_data$Subject == "Politics" | subject_data$Subject == "English" | subject_data$Subject == "Math" | subject_data$Subject == "Computer Science" | subject_data$Subject == "Business", ] -recode_interest <- ifelse(2 <= keysubjects_data$Interest & keysubjects_data$Interest >=4, "Positive", "Negative") -keysubjects_data <- cbind(keysubjects_data, recode_interest) -keysubjects_data$recode_interest <- factor(keysubjects_data$recode_interest) -interest_table <- table(keysubjects_data$recode_interest, keysubjects_data$Subject) -# export table to csv -write.csv(interest_table, "derivedData/interest_table.csv", row.names=TRUE) -keysubjects_data$Interest -prop.table(keysubjects_data$Interest) -keysubjects_data -View(subject_data) -TSR_data_theology_positive <- TSR_data$InterestedinstudyingTheology >=4 -TSR_data_theology_positive -TSR_data_theology_positive <- TSR_data$InterestedinstudyingTheology[] >=4 -library(dplyr) -TSR_data_theology_positive %>% filter(TSR_data, InterestedinstudyingTheology >= 4) -TSR_data$InterestedinstudyingTheology -TSR_data$InterestedinstudyingTheology >4 -TSR_data$InterestedinstudyingTheology >3 -count(TSR_data$InterestedinstudyingTheology >3) -length(TSR_data$InterestedinstudyingTheology >3) -# TSR_data_theology_positive %>% -filter(TSR_data, InterestedinstudyingTheology >= 4) -length(TSR_data$InterestedinstudyingTheology >3) -# TSR_data_theology_positive %>% -filter(TSR_data, InterestedinstudyingTheology >= 4) -filter(TSR_data, InterestedinstudyingTheology == 4) -filter(TSR_data, InterestedinstudyingTheology >= 4) -TSR_data_theology_positive %>% filter(TSR_data, InterestedinstudyingTheology >= 4) -TSR_data_theology_positive <- filter(TSR_data, InterestedinstudyingTheology >= 4) -View(TSR_data_theology_positive) -TSR_data_theology_positive <- filter(TSR_data, InterestedinstudyingTheology < 3) -TSR_data_theology_positive <- filter(TSR_data, InterestedinstudyingTheology < 3) -TSR_data_theology_positive <- filter(TSR_data, InterestedinstudyingTheology > 3) -TSR_data_theology_positive <- filter(TSR_data, InterestedinstudyingTheology > 2) -TSR_data_theology_positive <- filter(TSR_data, InterestedinstudyingTheology > 2) -TSR_data_theology_positive <- filter(TSR_data, InterestedinstudyingTheology < 3) -TSR_data_theology_positive <- filter(TSR_data, InterestedinstudyingTheology < 2) -TSR_data_theology_positive <- filter(TSR_data, InterestedinstudyingTheology < 1) -TSR_data_theology_positive <- filter(TSR_data, InterestedinstudyingTheology >= 4) -TSR_data_theology_negative <- filter(TSR_data, InterestedinstudyingTheology <= 2) -TSR_data_theology_positive <- filter(TSR_data, InterestedinstudyingTheology >= 4 & InterestedinstudyingTheology != 0) -TSR_data_theology_negative <- filter(TSR_data, InterestedinstudyingTheology <= 2 & InterestedinstudyingTheology != 0) -TSR_data_rs_positive <- filter(TSR_data, InterestedinstudyingReligion >= 4 & InterestedinstudyingReligion != 0) -TSR_data_rs_positive <- filter(TSR_data, InterestedinstudyingReligiousStudies >= 4 & InterestedinstudyingReligiousStudies != 0) -TSR_data_rs_negative <- filter(TSR_data, InterestedinstudyingReligiousStudies <= 2 & InterestedinstudyingReligiousStudies != 0) -knitr::opts_chunk$set(echo = TRUE) -library(ggplot2) -library(devtools) -library(usethis) -library(devtools) -library(likert) -# Load RColorBrewer -# install.packages("RColorBrewer") -library(RColorBrewer) -library("stringr") # Load stringr package, used for wrapping label text in plots -library(dplyr) # Used for filtering below -# Define colour palettes for plots below -coul3 <- brewer.pal(3, "RdYlBu") # Using RdYlBu range to generate 3 colour palette: https://colorbrewer2.org/#type=diverging&scheme=RdYlBu&n=5 -TSR_data <- read.csv("./data/TSR data complete.csv") -subject_data <- read.csv("./data/Subject data.csv") -# Set up local workspace: -if (dir.exists("data") == FALSE) { -dir.create("data") -} -if (dir.exists("figures") == FALSE) { -dir.create("figures") -} -if (dir.exists("derivedData") == FALSE) { -dir.create("derivedData") -} -TSR_data_theology_positive_summaries_religion <- factor(TSR_data_theology_positive$ReligiousAffliation, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), labels = c("Agnostic", "Atheist", "Baha'i", "Buddhist", "Christian", "Confucian", "Jain", "Jewish", "Hindu", "Indigenous Traditional Religious", "Muslim", "Pagan", "Shinto", "Sikh", "Spiritual but not religious", "Zoroastrian", "No religion", "Prefer not to say", "Other")) -TSR_data_theology_positive_summaries_religion <- factor(TSR_data_theology_positive$ReligiousAffliation, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), labels = c("Agnostic", "Atheist", "Baha'i", "Buddhist", "Christian", "Confucian", "Jain", "Jewish", "Hindu", "Indigenous Traditional Religious", "Muslim", "Pagan", "Shinto", "Sikh", "Spiritual but not religious", "Zoroastrian", "No religion", "Prefer not to say", "Other")) -TSR_data_theology_negative_summaries_religion <- factor(TSR_data_theology_negative$ReligiousAffliation, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), labels = c("Agnostic", "Atheist", "Baha'i", "Buddhist", "Christian", "Confucian", "Jain", "Jewish", "Hindu", "Indigenous Traditional Religious", "Muslim", "Pagan", "Shinto", "Sikh", "Spiritual but not religious", "Zoroastrian", "No religion", "Prefer not to say", "Other")) -TSR_data_rs_positive_summaries_religion <- factor(TSR_data_rs_positive$ReligiousAffliation, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), labels = c("Agnostic", "Atheist", "Baha'i", "Buddhist", "Christian", "Confucian", "Jain", "Jewish", "Hindu", "Indigenous Traditional Religious", "Muslim", "Pagan", "Shinto", "Sikh", "Spiritual but not religious", "Zoroastrian", "No religion", "Prefer not to say", "Other")) -TSR_data_rs_positive_summaries_religion <- factor(TSR_data_rs_negative$ReligiousAffliation, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), labels = c("Agnostic", "Atheist", "Baha'i", "Buddhist", "Christian", "Confucian", "Jain", "Jewish", "Hindu", "Indigenous Traditional Religious", "Muslim", "Pagan", "Shinto", "Sikh", "Spiritual but not religious", "Zoroastrian", "No religion", "Prefer not to say", "Other")) -Religious_affiliation_bar2 <- ggplot(TSR_data, aes(TSR_data_theology_positive_summaries_religion)) + geom_bar() + coord_flip() -Religious_affiliation_bar2 + labs(title = "Respondent religious self-identification", x = "", y = "") -Religious_affiliation_bar2 <- ggplot(TSR_data_theology_positive, aes(TSR_data_theology_positive_summaries_religion)) + geom_bar() + coord_flip() -Religious_affiliation_bar2 + labs(title = "Respondent religious self-identification", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_religion_theologypositive.png") -TSR_data_rs_positive_summaries_religion <- factor(TSR_data_rs_positive$ReligiousAffliation, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), labels = c("Agnostic", "Atheist", "Baha'i", "Buddhist", "Christian", "Confucian", "Jain", "Jewish", "Hindu", "Indigenous Traditional Religious", "Muslim", "Pagan", "Shinto", "Sikh", "Spiritual but not religious", "Zoroastrian", "No religion", "Prefer not to say", "Other")) -TSR_data_rs_negative_summaries_religion <- factor(TSR_data_rs_negative$ReligiousAffliation, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), labels = c("Agnostic", "Atheist", "Baha'i", "Buddhist", "Christian", "Confucian", "Jain", "Jewish", "Hindu", "Indigenous Traditional Religious", "Muslim", "Pagan", "Shinto", "Sikh", "Spiritual but not religious", "Zoroastrian", "No religion", "Prefer not to say", "Other")) -Religious_affiliation_bar3 <- ggplot(TSR_data_rs_positive, aes(TSR_data_rs_positive_summaries_religion)) + geom_bar() + coord_flip() -Religious_affiliation_bar3 + labs(title = "Respondent religious self-identification", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_religion_theologypositive.png") -Religious_affiliation_bar2 <- ggplot(TSR_data_theology_positive, aes(TSR_data_theology_positive_summaries_religion)) + geom_bar() + coord_flip() -Religious_affiliation_bar2 + labs(title = "Respondent religious self-identification (positive sentiment towards "theology")", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_religion_theologypositive.png") -Religious_affiliation_bar2 + labs(title = "Respondent religious self-identification - positive sentiment towards theology"), x = "", y = "") -" -Religious_affiliation_bar2 + labs(title = "Respondent religious self-identification - positive sentiment towards theology", x = "", y = "") -Religious_affiliation_bar2 + labs(title = "Respondent religious self-identification, positive sentiment towards theology", x = "", y = "") -Religious_affiliation_bar2 <- ggplot(TSR_data_theology_positive, aes(TSR_data_theology_positive_summaries_religion)) + geom_bar() + coord_flip() -Religious_affiliation_bar2 + labs(title = "Respondent religious self-identification, positive sentiment towards theology", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_religion_theologypositive.png") -Religious_affiliation_bar3 <- ggplot(TSR_data_rs_positive, aes(TSR_data_rs_positive_summaries_religion)) + geom_bar() + coord_flip() -Religious_affiliation_bar3 + labs(title = "Respondent religious self-identification, positive sentiment towards rs", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_religion_rspositive.png") -library(scales) # Used for adding percentages to bar charts -Religious_affiliation_bar3 <- ggplot(TSR_data_rs_positive, aes(TSR_data_rs_positive_summaries_religion, label=scales::percent(pct))) + geom_bar() + coord_flip() -Religious_affiliation_bar3 + labs(title = "Respondent religious self-identification, positive sentiment towards rs", x = "", y = "") -Religious_affiliation_bar3 <- ggplot(TSR_data_rs_positive, aes(TSR_data_rs_positive_summaries_religion) + geom_bar() + geom_text(label=scales::percent(pct))) + coord_flip() -knitr::opts_chunk$set(echo = TRUE) -library(ggplot2) -library(devtools) -library(usethis) -library(devtools) -library(likert) -# Load RColorBrewer -# install.packages("RColorBrewer") -library(RColorBrewer) -library("stringr") # Load stringr package, used for wrapping label text in plots -library(dplyr) # Used for filtering below library(scales) # Used for adding percentages to bar charts # Define colour palettes for plots below coul3 <- brewer.pal(3, "RdYlBu") # Using RdYlBu range to generate 3 colour palette: https://colorbrewer2.org/#type=diverging&scheme=RdYlBu&n=5 TSR_data <- read.csv("./data/TSR data complete.csv") subject_data <- read.csv("./data/Subject data.csv") -# Set up local workspace (as needed): -if (dir.exists("data") == FALSE) { -dir.create("data") -} -if (dir.exists("figures") == FALSE) { -dir.create("figures") -} -if (dir.exists("derivedData") == FALSE) { -dir.create("derivedData") -} # Set up local workspace, as needed: if (dir.exists("data") == FALSE) { dir.create("data") @@ -463,50 +13,500 @@ dir.create("figures") if (dir.exists("derivedData") == FALSE) { dir.create("derivedData") } -TSR_data_theology_positive_summaries_ethnicity <- factor(TSR_data_theology_positive$Ethnicity, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ,18, 19), labels = c("Arab", "Indian", "Pakistani", "Bangladeshi", "Chinese", "Any other Asian background", "Black - African", "Black - Caribbean", "Any other Black background", "Mixed - White and Black Caribbean", "Mixed - White and Black African", "Mixed - White and Black Asian", "Any other Mixed/Multiple Ethnic background", "White - British", "White - Irish", "Gypsy or Irish Traveller", "Any other White background", "Other Ethnic group", "Prefer not to say")) -TSR_data_theology_positive_summaries_ethnicity <- str_wrap(TSR_data_summaries_ethnicity, width = 30) -TSR_data_rs_positive_summaries_ethnicity <- factor(TSR_data_rs_positive$Ethnicity, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ,18, 19), labels = c("Arab", "Indian", "Pakistani", "Bangladeshi", "Chinese", "Any other Asian background", "Black - African", "Black - Caribbean", "Any other Black background", "Mixed - White and Black Caribbean", "Mixed - White and Black African", "Mixed - White and Black Asian", "Any other Mixed/Multiple Ethnic background", "White - British", "White - Irish", "Gypsy or Irish Traveller", "Any other White background", "Other Ethnic group", "Prefer not to say")) -TSR_data_rs_positive_summaries_ethnicity <- str_wrap(TSR_data_summaries_ethnicity, width = 30) -TSR_data__theology_positive_summaries_gender <- factor(TSR_data_theology_positive$Gender, levels = c(1, 2, 3, 4), labels = c("Male", "Female", "I identify my gender in another way", "Prefer not to say")) -# JK note: using stringr here to wrap axis titles -TSR_data__theology_positive_summaries_gender <- str_wrap(TSR_data__theology_positive_summaries_gender, width = 10) -TSR_data_rs_positive_summaries_gender <- factor(TSR_data_rs_positive$Gender, levels = c(1, 2, 3, 4), labels = c("Male", "Female", "I identify my gender in another way", "Prefer not to say")) -# JK note: using stringr here to wrap axis titles -TSR_data_rs_positive_summaries_gender <- str_wrap(TSR_data_rs_positive_summaries_gender, width = 10) -gender_bar2 <- ggplot(TSR_data_theology_positive, aes(TSR_data__theology_positive_summaries_gender)) + geom_bar() -gender_bar2 + labs(title = "Respondent gender self-identification, theology positive", x = "", y = "") -gender_bar2 + labs(title = "Respondent gender self-identification, theology positive", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_gender2.png") -gender_bar3 <- ggplot(TSR_data_rs_positive, aes(TSR_data_rs_positive_summaries_gender)) + geom_bar() -gender_bar3 + labs(title = "Respondent gender self-identification, rs positive", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_gender3.png") -data_summaries_theology_positive_ethnicity <- ggplot(TSR_data_theology_positive, aes(TSR_data_theology_positive_summaries_ethnicity)) + geom_bar() + xlab(NULL) + coord_flip() -data_summaries_theology_positive_ethnicity + labs(title = "Respondent ethnic self-identification, theology positive", x = "", y = "") -data_summaries_theology_positive_ethnicity + labs(title = "Respondent ethnic self-identification, theology positive", x = "", y = "") -data_summaries_theology_positive_ethnicity <- ggplot(TSR_data_theology_positive, aes(TSR_data_theology_positive_summaries_ethnicity)) + geom_bar() + xlab(NULL) + coord_flip() -data_summaries_theology_positive_ethnicity + labs(title = "Respondent ethnic self-identification, theology positive", x = "", y = "") -data_summaries_theology_positive_ethnicity + labs(title = "Respondent ethnic self-identification", x = "", y = "") -TSR_data_rs_negative_summaries_religion <- factor(TSR_data_rs_negative$ReligiousAffliation, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), labels = c("Agnostic", "Atheist", "Baha'i", "Buddhist", "Christian", "Confucian", "Jain", "Jewish", "Hindu", "Indigenous Traditional Religious", "Muslim", "Pagan", "Shinto", "Sikh", "Spiritual but not religious", "Zoroastrian", "No religion", "Prefer not to say", "Other")) -TSR_data_theology_positive_summaries_ethnicity <- factor(TSR_data_theology_positive$Ethnicity, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ,18, 19), labels = c("Arab", "Indian", "Pakistani", "Bangladeshi", "Chinese", "Any other Asian background", "Black - African", "Black - Caribbean", "Any other Black background", "Mixed - White and Black Caribbean", "Mixed - White and Black African", "Mixed - White and Black Asian", "Any other Mixed/Multiple Ethnic background", "White - British", "White - Irish", "Gypsy or Irish Traveller", "Any other White background", "Other Ethnic group", "Prefer not to say")) -TSR_data_theology_positive_summaries_ethnicity <- str_wrap(TSR_data_theology_positive_summaries_ethnicity, width = 30) -TSR_data_rs_positive_summaries_ethnicity <- factor(TSR_data_rs_positive$Ethnicity, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 ,18, 19), labels = c("Arab", "Indian", "Pakistani", "Bangladeshi", "Chinese", "Any other Asian background", "Black - African", "Black - Caribbean", "Any other Black background", "Mixed - White and Black Caribbean", "Mixed - White and Black African", "Mixed - White and Black Asian", "Any other Mixed/Multiple Ethnic background", "White - British", "White - Irish", "Gypsy or Irish Traveller", "Any other White background", "Other Ethnic group", "Prefer not to say")) -TSR_data_rs_positive_summaries_ethnicity <- str_wrap(TSR_data_rs_positive_summaries_ethnicity, width = 30) -TSR_data_rs_positive_summaries_ethnicity <- str_wrap(TSR_data_rs_positive_summaries_ethnicity, width = 30) -data_summaries_rs_positive_ethnicity <- ggplot(TSR_data_rs_positive, aes(TSR_data_rs_positive_summaries_ethnicity)) + geom_bar() + xlab(NULL) + coord_flip() -data_summaries_ethnicity + labs(title = "Respondent ethnic self-identification", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_ethnicity3.png") -data_summaries_theology_positive_ethnicity <- ggplot(TSR_data_theology_positive, aes(TSR_data_theology_positive_summaries_ethnicity)) + geom_bar() + xlab(NULL) + coord_flip() -data_summaries_theology_positive_ethnicity + labs(title = "Respondent ethnic self-identification", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_ethnicity2.png") -data_summaries_theology_positive_ethnicity <- ggplot(TSR_data_theology_positive, aes(TSR_data_theology_positive_summaries_ethnicity)) + geom_bar() + xlab(NULL) + coord_flip() -data_summaries_theology_positive_ethnicity + labs(title = "Respondent ethnic self-identification - theology positive", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_ethnicity2.png") -data_summaries_rs_positive_ethnicity <- ggplot(TSR_data_rs_positive, aes(TSR_data_rs_positive_summaries_ethnicity)) + geom_bar() + xlab(NULL) + coord_flip() -data_summaries_ethnicity + labs(title = "Respondent ethnic self-identification - religion positive", x = "", y = "") -# save to png file for reports -ggsave("figures/TSR_data_summaries_ethnicity3.png") +Philos_subset_High <- TSR_data[TSR_data$InterestinstudyingPhilosophy > 3, ] +### Philosophy ### +Philos_subset_Low <- TSR_data[TSR_data$InterestinstudyingPhilosophy < 3 & TSR_data$InterestinstudyingPhilosophy != 0, ] +## Theology Interest +#Low interest in Philosophy +mean(as.numeric(Philos_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Philosophy +mean(as.numeric(Philos_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(TSR_data$InterestedinstudyingTheology)) +mean(as.numeric(TSR_data$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(TSR_data$InterestedinstudyingReligiousStudies), na.rm = TRUE) +library(kable) # Used for generating markdown tables +install.packages("kable") +## Theology Interest +#Low interest in Philosophy +overall_mean_theology_interest <- mean(as.numeric(Philos_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Philosophy +overall_mean_rs_interest <- mean(as.numeric(Philos_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +overall_mean_theology_interest <- mean(as.numeric(TSR_data$InterestedinstudyingTheology), na.rm = TRUE) +overall_mean_rs_interest <- mean(as.numeric(TSR_data$InterestedinstudyingReligiousStudies), na.rm = TRUE) +### Philosophy ### +Philos_subset_Low <- TSR_data[TSR_data$InterestinstudyingPhilosophy < 3 & TSR_data$InterestinstudyingPhilosophy != 0, ] +Philos_subset_High <- TSR_data[TSR_data$InterestinstudyingPhilosophy > 3, ] +mean(as.numeric(TSR_data$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(TSR_data$InterestedinstudyingReligiousStudies), na.rm = TRUE) +mean(as.numeric(TSR_data$InterestinstudyingPhilosophy), na.rm = TRUE) +mean(as.numeric(TSR_data$InterestedinStudyingPsychology), na.rm = TRUE) +### Philosophy ### +Philos_subset_Low <- TSR_data[TSR_data$InterestinstudyingPhilosophy < 3 & TSR_data$InterestinstudyingPhilosophy != 0, ] +Philos_subset_High <- TSR_data[TSR_data$InterestinstudyingPhilosophy > 3, ] +## Theology Interest +#Low interest in Philosophy +philosophy_interest_low_theology_interest_mean <- (as.numeric(Philos_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +## Theology Interest +#Low interest in Philosophy +mean(as.numeric(Philos_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Philosophy +mean(as.numeric(Philos_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Philosophy +mean(as.numeric(Philos_subset_High$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in Philosophy +mean(as.numeric(Philos_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in Philosophy +mean(as.numeric(Philos_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +### Sociology ### +Soc_subset_Low <- TSR_data[TSR_data$InterestinstudyingSociaology < 3 & TSR_data$InterestinstudyingSociaology != 0, ] +Soc_subset_High <- TSR_data[TSR_data$InterestinstudyingSociaology > 3, ] +## Theology Interest +#Low interest in Sociology +lSocTheo <- mean(as.numeric(Soc_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Sociology +hSocTheo <- mean(as.numeric(Soc_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in Sociology +mean(as.numeric(Soc_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in Sociology +mean(as.numeric(Soc_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +## Theology Interest +#Low interest in Sociology +lSocTheo <- mean(as.numeric(Soc_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +## Theology Interest +#Low interest in Sociology +mean(as.numeric(Soc_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Sociology +mean(as.numeric(Soc_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +## Theology Interest +#Low interest in Sociology +mean(as.numeric(Soc_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Sociology +mean(as.numeric(Soc_subset_High$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in Sociology +mean(as.numeric(Soc_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in Sociology +mean(as.numeric(Soc_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +### Psychology ### +Psych_subset_Low <- TSR_data[TSR_data$InterestedinStudyingPsychology < 3 & TSR_data$InterestedinStudyingPsychology != 0, ] +Psych_subset_High <- TSR_data[TSR_data$InterestedinStudyingPsychology > 3, ] +## Theology Interest +#Low interest in Psychology +mean(as.numeric(Psych_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Psychology +mean(as.numeric(Psych_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Psychology +mean(as.numeric(Psych_subset_High$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in Psychology +mean(as.numeric(Psych_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in Psychology +mean(as.numeric(Psych_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +### History ### +Hist_subset_Low <- TSR_data[TSR_data$InterestedinstudyingHistory < 3 & TSR_data$InterestedinstudyingHistory != 0, ] +Hist_subset_High <- TSR_data[TSR_data$InterestedinstudyingHistory > 3, ] +## Theology Interest +#Low interest in History +mean(as.numeric(Hist_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in History +mean(as.numeric(Hist_subset_High$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in History +mean(as.numeric(Hist_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in History +mean(as.numeric(Hist_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +### Ethics ### +Ethics_subset_Low <- TSR_data[TSR_data$InterestedinstudyingEthics < 3 & TSR_data$InterestedinstudyingEthics != 0, ] +Ethics_subset_High <- TSR_data[TSR_data$InterestedinstudyingEthics > 3, ] +## Theology Interest +#Low interest in Ethics +mean(as.numeric(Ethics_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Ethics +mean(as.numeric(Ethics_subset_High$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in Ethics +mean(as.numeric(Ethics_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in Ethics +mean(as.numeric(Ethics_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +### Politics ### +Polit_subset_Low <- TSR_data[TSR_data$InterestedinstudyingPolitics < 3 & TSR_data$InterestedinstudyingPolitics != 0, ] +Polit_subset_High <- TSR_data[TSR_data$InterestedinstudyingPolitics > 3, ] +## Theology Interest +#Low interest in Politics +mean(as.numeric(Polit_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Politics +mean(as.numeric(Polit_subset_High$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in Politics +mean(as.numeric(Polit_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in Politics +mean(as.numeric(Polit_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +### English ### +Eng_subset_Low <- TSR_data[TSR_data$InterestedinstudyingEnglish < 3 & TSR_data$InterestedinstudyingEnglish != 0, ] +Eng_subset_High <- TSR_data[TSR_data$InterestedinstudyingEnglish > 3, ] +## Theology Interest +#Low interest in English +mean(as.numeric(Eng_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in English +mean(as.numeric(Eng_subset_High$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in English +mean(as.numeric(Eng_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in English +mean(as.numeric(Eng_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +### Math ### +Math_subset_Low <- TSR_data[TSR_data$InterestedinstudyingMath < 3 & TSR_data$InterestedinstudyingMathy != 0, ] +Math_subset_High <- TSR_data[TSR_data$InterestedinstudyingMath > 3, ] +## Theology Interest +#Low interest in Math +mean(as.numeric(Math_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Math +mean(as.numeric(Math_subset_High$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in Math +mean(as.numeric(Math_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in Math +mean(as.numeric(Math_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +## Theology Interest +#Low interest in Math +mean(as.numeric(Math_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +### Math ### +Math_subset_Low <- TSR_data[TSR_data$InterestedinstudyingMath < 3 & TSR_data$InterestedinstudyingMath != 0, ] +Math_subset_High <- TSR_data[TSR_data$InterestedinstudyingMath > 3, ] +## Theology Interest +#Low interest in Math +mean(as.numeric(Math_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Math +mean(as.numeric(Math_subset_High$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in Math +mean(as.numeric(Math_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in Math +mean(as.numeric(Math_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +### Computer Science ### +CompSci_subset_Low <- TSR_data[TSR_data$InterestedinstudyingComputerScience < 3 & TSR_data$InterestedinstudyingComputerScience != 0, ] +CompSci_subset_High <- TSR_data[TSR_data$InterestedinstudyingComputerScience > 3, ] +## Theology Interest +#Low interest in Computer Science +mean(as.numeric(CompSci_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Computer Science +mean(as.numeric(CompSci_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Computer Science +mean(as.numeric(CompSci_subset_High$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in Computer Science +mean(as.numeric(CompSci_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in Computer Science +mean(as.numeric(CompSci_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +### Business ### +Busi_subset_Low <- TSR_data[TSR_data$InterestedinstudyingBusiness < 3 & TSR_data$InterestedinstudyingBusiness != 0, ] +Busi_subset_High <- TSR_data[TSR_data$InterestedinstudyingBusiness > 3, ] +## Theology Interest +#Low interest in Business +mean(as.numeric(Busi_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +#High interest in Business +mean(as.numeric(Busi_subset_High$InterestedinstudyingTheology), na.rm = TRUE) +## Religious Studies Interest +#Low interest in Business +mean(as.numeric(Busi_subset_Low$InterestedinstudyingReligiousStudies), na.rm = TRUE) +#High interest in Business +mean(as.numeric(Busi_subset_High$InterestedinstudyingReligiousStudies), na.rm = TRUE) +mean(as.numeric(TSR_data$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(TSR_data$GoodunderstandingofReligiousStudies), na.rm = TRUE) +mean(as.numeric(TSR_data$GoodunderstandingofPhilosophy), na.rm = TRUE) +mean(as.numeric(TSR_data$GoodunderstandingofPsychology), na.rm = TRUE) +mean(as.numeric(TSR_data$GoodunderstandingofEnglish), na.rm = TRUE) +mean(as.numeric(TSR_data$GoodunderstandingofMath), na.rm = TRUE) +# Low understanding of philosophy cohort +Philos_subset_Low <- TSR_data[TSR_data$GoodunderstandingofPhilosophy < 3 & TSR_data$GoodunderstandingofPhilosophy != 0, ] +# High understanding of philosophy cohort +Philos_subset_High <- TSR_data[TSR_data$GoodunderstandingofPhilosophy > 3, ] +## Theology Knowledge +#Low knowledge in Philosophy +mean(as.numeric(Philos_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +#High knowledge in Philosophy +mean(as.numeric(Philos_subset_High$GoodunderstandingofTheology), na.rm = TRUE) +## Religious Studies Knowledge +#Low knowledge in Philosophy +mean(as.numeric(Philos_subset_Low$GoodunderstandingofReligiousStudies), na.rm = TRUE) +#High knowledge in Philosophy +mean(as.numeric(Philos_subset_High$GoodunderstandingofReligiousStudies), na.rm = TRUE) +### Sociology ### +Soc_subset_Low <- TSR_data[TSR_data$GoodunderstandingofSociology < 3 & TSR_data$GoodunderstandingofSociology != 0, ] +Soc_subset_High <- TSR_data[TSR_data$GoodunderstandingofSociology > 3, ] +## Theology knowledge +#Low knowledge in Sociology +mean(as.numeric(Soc_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +#High knowledge in Sociology +mean(as.numeric(Soc_subset_High$GoodunderstandingofTheology), na.rm = TRUE) +## Religious Studies knowledge +#Low knowledge in Sociology +mean(as.numeric(Soc_subset_Low$GoodunderstandingofReligiousStudies), na.rm = TRUE) +#High knowledge in Sociology +mean(as.numeric(Soc_subset_High$GoodunderstandingofReligiousStudies), na.rm = TRUE) +### Psychology ### +Psych_subset_Low <- TSR_data[TSR_data$GoodunderstandingofPsychology < 3 & TSR_data$GoodunderstandingofPsychology != 0, ] +Psych_subset_High <- TSR_data[TSR_data$GoodunderstandingofPsychology > 3, ] +## Theology knowledge +#Low knowledge in Psychology +mean(as.numeric(Psych_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +#High knowledge in Psychology +mean(as.numeric(Psych_subset_High$GoodunderstandingofTheology), na.rm = TRUE) +## Religious Studies knowledge +#Low knowledge in Psychology +mean(as.numeric(Psych_subset_Low$GoodunderstandingofReligiousStudies), na.rm = TRUE) +#High knowledge in Psychology +mean(as.numeric(Psych_subset_High$GoodunderstandingofReligiousStudies), na.rm = TRUE) +### History ### +Hist_subset_Low <- TSR_data[TSR_data$GoodunderstandingofHistory < 3 & TSR_data$GoodunderstandingofHistory != 0, ] +Hist_subset_High <- TSR_data[TSR_data$GoodunderstandingofHistory > 3, ] +## Theology knowledge +#Low knowledge in History +mean(as.numeric(Hist_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +#High knowledge in History +mean(as.numeric(Hist_subset_High$GoodunderstandingofTheology), na.rm = TRUE) +## Religious Studies knowledge +#Low knowledge in History +mean(as.numeric(Hist_subset_Low$GoodunderstandingofReligiousStudies), na.rm = TRUE) +#High knowledge in History +mean(as.numeric(Hist_subset_High$GoodunderstandingofReligiousStudies), na.rm = TRUE) +### Ethics ### +Ethics_subset_Low <- TSR_data[TSR_data$GoodunderstandingofEthics < 3 & TSR_data$GoodunderstandingofEthics != 0, ] +Ethics_subset_High <- TSR_data[TSR_data$GoodunderstandingofEthics > 3, ] +## Theology knowledge +#Low knowledge in Ethics +mean(as.numeric(Ethics_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +#High knowledge in Ethics +mean(as.numeric(Ethics_subset_High$GoodunderstandingofTheology), na.rm = TRUE) +## Religious Studies knowledge +#Low knowledge in Ethics +mean(as.numeric(Ethics_subset_Low$GoodunderstandingofReligiousStudies), na.rm = TRUE) +#High knowledge in Ethics +mean(as.numeric(Ethics_subset_High$GoodunderstandingofReligiousStudies), na.rm = TRUE) +### Politics ### +Polit_subset_Low <- TSR_data[TSR_data$GoodunderstandingofPolitics < 3 & TSR_data$GoodunderstandingofPolitics != 0, ] +Polit_subset_High <- TSR_data[TSR_data$GoodunderstandingofPolitics > 3, ] +## Theology knowledge +#Low knowledge in Politics +mean(as.numeric(Polit_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +#High knowledge in Politics +mean(as.numeric(Polit_subset_High$GoodunderstandingofTheology), na.rm = TRUE) +## Religious Studies knowledge +#Low knowledge in Politics +mean(as.numeric(Polit_subset_Low$GoodunderstandingofReligiousStudies), na.rm = TRUE) +#High knowledge in Politics +mean(as.numeric(Polit_subset_High$GoodunderstandingofReligiousStudies), na.rm = TRUE) +### English ### +Eng_subset_Low <- TSR_data[TSR_data$GoodunderstandingofEnglish < 3 & TSR_data$GoodunderstandingofEnglish != 0, ] +Eng_subset_High <- TSR_data[TSR_data$GoodunderstandingofEnglish > 3, ] +## Theology knowledge +#Low knowledge in English +mean(as.numeric(Eng_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +#High knowledge in English +mean(as.numeric(Eng_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +#High knowledge in English +mean(as.numeric(Eng_subset_High$GoodunderstandingofTheology), na.rm = TRUE) +## Religious Studies knowledge +#Low knowledge in English +mean(as.numeric(Eng_subset_Low$GoodunderstandingofReligiousStudies), na.rm = TRUE) +#High knowledge in English +mean(as.numeric(Eng_subset_High$GoodunderstandingofReligiousStudies), na.rm = TRUE) +### Math ### +Math_subset_Low <- TSR_data[TSR_data$GoodunderstandingofMath < 3 & TSR_data$GoodunderstandingofMath != 0, ] +Math_subset_High <- TSR_data[TSR_data$GoodunderstandingofMath > 3, ] +## Theology knowledge +#Low knowledge in Math +mean(as.numeric(Math_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +#High knowledge in Math +mean(as.numeric(Math_subset_High$GoodunderstandingofTheology), na.rm = TRUE) +## Religious Studies knowledge +#Low knowledge in Math +mean(as.numeric(Math_subset_Low$GoodunderstandingofReligiousStudies), na.rm = TRUE) +#High knowledge in Math +mean(as.numeric(Math_subset_High$GoodunderstandingofReligiousStudies), na.rm = TRUE) +### Computer Science ### +CompSci_subset_Low <- TSR_data[TSR_data$GoodunderstandingofComputerScience < 3 & TSR_data$GoodunderstandingofComputerScience != 0, ] +CompSci_subset_High <- TSR_data[TSR_data$GoodunderstandingofComputerScience > 3, ] +## Theology knowledge +#Low knowledge in Computer Science +mean(as.numeric(CompSci_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +#High knowledge in Computer Science +mean(as.numeric(CompSci_subset_High$GoodunderstandingofTheology), na.rm = TRUE) +## Religious Studies knowledge +#Low knowledge in Computer Science +mean(as.numeric(CompSci_subset_Low$GoodunderstandingofReligiousStudies), na.rm = TRUE) +#High knowledge in Computer Science +mean(as.numeric(CompSci_subset_High$GoodunderstandingofReligiousStudies), na.rm = TRUE) +### Business ### +Busi_subset_Low <- TSR_data[TSR_data$GoodunderstandingofBusiness < 3 & TSR_data$GoodunderstandingofBusiness != 0, ] +Busi_subset_High <- TSR_data[TSR_data$GoodunderstandingofBusiness > 3, ] +## Theology knowledge +#Low knowledge in Business +mean(as.numeric(Busi_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +#High knowledge in Business +mean(as.numeric(Busi_subset_High$GoodunderstandingofTheology), na.rm = TRUE) +## Religious Studies knowledge +#Low knowledge in Business +mean(as.numeric(Busi_subset_Low$GoodunderstandingofReligiousStudies), na.rm = TRUE) +#High knowledge in Business +mean(as.numeric(Busi_subset_High$GoodunderstandingofReligiousStudies), na.rm = TRUE) +### Philosophy ### +Philos_subset_Low <- TSR_data[TSR_data$Philosophyemployability < 3 & TSR_data$Philosophyemployability != 0, ] +Philos_subset_High <- TSR_data[TSR_data$Philosophyemployability > 3, ] +## Theology employability +#Low employability in Philosophy +mean(as.numeric(Philos_subset_Low$Theologyemployability), na.rm = TRUE) +#High employability in Philosophy +mean(as.numeric(Philos_subset_High$Theologyemployability), na.rm = TRUE) +## Religious Studies employability +#Low employability in Philosophy +mean(as.numeric(Philos_subset_Low$ReligiousStudiesemployability), na.rm = TRUE) +#High employability in Philosophy +mean(as.numeric(Philos_subset_High$ReligiousStudiesemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Theologyemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$ReligiousStudiesemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Philosophyemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$PsychologyEmployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Englishemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Mathemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Businessemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Theologyemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$ReligiousStudiesemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Philosophyemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$PsychologyEmployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Englishemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Mathemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Businessemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$ComputerScienceemployability), na.rm = TRUE) +### Philosophy ### +Philos_subset_Low <- TSR_data[TSR_data$Philosophyemployability < 3 & TSR_data$Philosophyemployability != 0, ] +Philos_subset_High <- TSR_data[TSR_data$Philosophyemployability > 3, ] +## Theology employability +#Low employability in Philosophy +mean(as.numeric(Philos_subset_Low$Theologyemployability), na.rm = TRUE) +#High employability in Philosophy +mean(as.numeric(Philos_subset_High$Theologyemployability), na.rm = TRUE) +## Religious Studies employability +#Low employability in Philosophy +mean(as.numeric(Philos_subset_Low$ReligiousStudiesemployability), na.rm = TRUE) +#High employability in Philosophy +mean(as.numeric(Philos_subset_High$ReligiousStudiesemployability), na.rm = TRUE) +### Sociology ### +Soc_subset_Low <- TSR_data[TSR_data$Sociologyemployability < 3 & TSR_data$Sociologyemployability != 0, ] +Soc_subset_High <- TSR_data[TSR_data$Sociologyemployability > 3, ] +## Theology employability +#Low employability in Sociology +mean(as.numeric(Soc_subset_Low$Theologyemployability), na.rm = TRUE) +#High employability in Sociology +mean(as.numeric(Soc_subset_High$Theologyemployability), na.rm = TRUE) +## Religious Studies employability +#Low employability in Sociology +mean(as.numeric(Soc_subset_Low$ReligiousStudiesemployability), na.rm = TRUE) +#High employability in Sociology +mean(as.numeric(Soc_subset_High$ReligiousStudiesemployability), na.rm = TRUE) +### Psychology ### +Psych_subset_Low <- TSR_data[TSR_data$PsychologyEmployability < 3 & TSR_data$PsychologyEmployability != 0, ] +Psych_subset_High <- TSR_data[TSR_data$PsychologyEmployability > 3, ] +## Theology employability +#Low employability in Psychology +mean(as.numeric(Psych_subset_Low$Theologyemployability), na.rm = TRUE) +#High employability in Psychology +mean(as.numeric(Psych_subset_High$Theologyemployability), na.rm = TRUE) +## Religious Studies employability +#Low employability in Psychology +mean(as.numeric(Psych_subset_Low$ReligiousStudiesemployability), na.rm = TRUE) +#High employability in Psychology +mean(as.numeric(Psych_subset_High$ReligiousStudiesemployability), na.rm = TRUE) +### History ### +Hist_subset_Low <- TSR_data[TSR_data$Historyemployability < 3 & TSR_data$Historyemployability != 0, ] +Hist_subset_High <- TSR_data[TSR_data$Historyemployability > 3, ] +## Theology employability +#Low employability in History +mean(as.numeric(Hist_subset_Low$Theologyemployability), na.rm = TRUE) +#High employability in History +mean(as.numeric(Hist_subset_High$Theologyemployability), na.rm = TRUE) +## Religious Studies employability +#Low employability in History +mean(as.numeric(Hist_subset_Low$ReligiousStudiesemployability), na.rm = TRUE) +#High employability in History +mean(as.numeric(Hist_subset_High$ReligiousStudiesemployability), na.rm = TRUE) +### Ethics ### +Ethics_subset_Low <- TSR_data[TSR_data$Ethicsemployability < 3 & TSR_data$Ethicsemployability != 0, ] +Ethics_subset_High <- TSR_data[TSR_data$Ethicsemployability > 3, ] +## Theology employability +#Low employability in Ethics +mean(as.numeric(Ethics_subset_Low$Theologyemployability), na.rm = TRUE) +#High employability in Ethics +mean(as.numeric(Ethics_subset_High$Theologyemployability), na.rm = TRUE) +## Religious Studies employability +#Low employability in Ethics +mean(as.numeric(Ethics_subset_Low$ReligiousStudiesemployability), na.rm = TRUE) +#High employability in Ethics +mean(as.numeric(Ethics_subset_High$ReligiousStudiesemployability), na.rm = TRUE) +### Politics ### +Polit_subset_Low <- TSR_data[TSR_data$Politicsemployability < 3 & TSR_data$Politicsemployability != 0, ] +Polit_subset_High <- TSR_data[TSR_data$Politicsemployability > 3, ] +## Theology employability +#Low employability in Politics +mean(as.numeric(Polit_subset_Low$Theologyemployability), na.rm = TRUE) +#High employability in Politics +mean(as.numeric(Polit_subset_High$Theologyemployability), na.rm = TRUE) +## Religious Studies employability +#Low employability in Politics +mean(as.numeric(Polit_subset_Low$ReligiousStudiesemployability), na.rm = TRUE) +#High employability in Politics +mean(as.numeric(Polit_subset_High$ReligiousStudiesemployability), na.rm = TRUE) +### English ### +Eng_subset_Low <- TSR_data[TSR_data$Englishemployability < 3 & TSR_data$Englishemployability != 0, ] +Eng_subset_High <- TSR_data[TSR_data$Englishemployability > 3, ] +## Theology employability +#Low employability in English +mean(as.numeric(Eng_subset_Low$Theologyemployability), na.rm = TRUE) +#High employability in English +mean(as.numeric(Eng_subset_High$Theologyemployability), na.rm = TRUE) +## Religious Studies employability +#Low employability in English +mean(as.numeric(Eng_subset_Low$ReligiousStudiesemployability), na.rm = TRUE) +#High employability in English +mean(as.numeric(Eng_subset_High$ReligiousStudiesemployability), na.rm = TRUE) +### Math ### +Math_subset_Low <- TSR_data[TSR_data$Mathemployability < 3 & TSR_data$Mathemployability != 0, ] +Math_subset_High <- TSR_data[TSR_data$Mathemployability > 3, ] +## Theology employability +#Low employability in Math +mean(as.numeric(Math_subset_Low$Theologyemployability), na.rm = TRUE) +#High employability in Math +mean(as.numeric(Math_subset_High$Theologyemployability), na.rm = TRUE) +## Religious Studies employability +#Low employability in Math +mean(as.numeric(Math_subset_Low$ReligiousStudiesemployability), na.rm = TRUE) +#High employability in Math +mean(as.numeric(Math_subset_High$ReligiousStudiesemployability), na.rm = TRUE) +### Computer Science ### +CompSci_subset_Low <- TSR_data[TSR_data$ComputerScienceemployability < 3 & TSR_data$ComputerScienceemployability != 0, ] +CompSci_subset_High <- TSR_data[TSR_data$ComputerScienceemployability > 3, ] +## Theology employability +#Low employability in Computer Science +mean(as.numeric(CompSci_subset_Low$Theologyemployability), na.rm = TRUE) +#High employability in Computer Science +mean(as.numeric(CompSci_subset_High$Theologyemployability), na.rm = TRUE) +## Religious Studies employability +#Low employability in Computer Science +mean(as.numeric(CompSci_subset_Low$ReligiousStudiesemployability), na.rm = TRUE) +#High employability in Computer Science +mean(as.numeric(CompSci_subset_High$ReligiousStudiesemployability), na.rm = TRUE) +### Business ### +Busi_subset_Low <- TSR_data[TSR_data$Businessemployability < 3 & TSR_data$Businessemployability != 0, ] +Busi_subset_High <- TSR_data[TSR_data$Businessemployability > 3, ] +## Theology employability +#Low employability in Business +mean(as.numeric(Busi_subset_Low$Theologyemployability), na.rm = TRUE) +#High employability in Business +mean(as.numeric(Busi_subset_High$Theologyemployability), na.rm = TRUE) +## Religious Studies employability +#Low employability in Business +mean(as.numeric(Busi_subset_Low$ReligiousStudiesemployability), na.rm = TRUE) +#High employability in Business +mean(as.numeric(Busi_subset_High$ReligiousStudiesemployability), na.rm = TRUE) diff --git a/tsr_survey_analysis.Rmd b/tsr_survey_analysis.Rmd index 2d17f0f..820f1fb 100644 --- a/tsr_survey_analysis.Rmd +++ b/tsr_survey_analysis.Rmd @@ -16,6 +16,7 @@ library(RColorBrewer) library("stringr") # Load stringr package, used for wrapping label text in plots library(dplyr) # Used for filtering below library(scales) # Used for adding percentages to bar charts +library(kable) # Used for generating markdown tables # Define colour palettes for plots below coul3 <- brewer.pal(3, "RdYlBu") # Using RdYlBu range to generate 3 colour palette: https://colorbrewer2.org/#type=diverging&scheme=RdYlBu&n=5 @@ -234,6 +235,8 @@ Employability_data <- TSR_data[, 30:41] ```{r Visualization for 4 Key Subjects} ## Subset by "Positive" / "Negative" +# jk note: I've filled in the other fields just for fun + keysubjects_data <- subject_data[subject_data$Subject == "Philosophy" | subject_data$Subject == "Ethics" | subject_data$Subject == "Theology" | subject_data$Subject == "Religious Studies" | subject_data$Subject == "Sociology" | subject_data$Subject == "Psychology" | subject_data$Subject == "History" | subject_data$Subject == "Politics" | subject_data$Subject == "English" | subject_data$Subject == "Math" | subject_data$Subject == "Computer Science" | subject_data$Subject == "Business", ] recode_interest <- ifelse(2 <= keysubjects_data$Interest & keysubjects_data$Interest >=4, "Positive", "Negative") @@ -320,6 +323,13 @@ write.csv(interest_table, "derivedData/interest_table.csv", row.names=TRUE) ## Mean Interest in Theology and Religious Studies by High/Low Subject Interest ```{r Philosophy} +# Base mean: + +mean(as.numeric(TSR_data$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(TSR_data$InterestedinstudyingReligiousStudies), na.rm = TRUE) +mean(as.numeric(TSR_data$InterestinstudyingPhilosophy), na.rm = TRUE) +mean(as.numeric(TSR_data$InterestedinStudyingPsychology), na.rm = TRUE) + ### Philosophy ### Philos_subset_Low <- TSR_data[TSR_data$InterestinstudyingPhilosophy < 3 & TSR_data$InterestinstudyingPhilosophy != 0, ] @@ -329,7 +339,7 @@ Philos_subset_High <- TSR_data[TSR_data$InterestinstudyingPhilosophy > 3, ] #Low interest in Philosophy mean(as.numeric(Philos_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) #High interest in Philosophy -mean(as.numeric(Philos_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(Philos_subset_High$InterestedinstudyingTheology), na.rm = TRUE) ## Religious Studies Interest #Low interest in Philosophy @@ -346,9 +356,9 @@ Soc_subset_High <- TSR_data[TSR_data$InterestinstudyingSociaology > 3, ] ## Theology Interest #Low interest in Sociology -lSocTheo <- mean(as.numeric(Soc_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(Soc_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) #High interest in Sociology -hSocTheo <- mean(as.numeric(Soc_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(Soc_subset_High$InterestedinstudyingTheology), na.rm = TRUE) ## Religious Studies Interest #Low interest in Sociology @@ -367,7 +377,7 @@ Psych_subset_High <- TSR_data[TSR_data$InterestedinStudyingPsychology > 3, ] #Low interest in Psychology mean(as.numeric(Psych_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) #High interest in Psychology -mean(as.numeric(Psych_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(Psych_subset_High$InterestedinstudyingTheology), na.rm = TRUE) ## Religious Studies Interest #Low interest in Psychology @@ -386,7 +396,7 @@ Hist_subset_High <- TSR_data[TSR_data$InterestedinstudyingHistory > 3, ] #Low interest in History mean(as.numeric(Hist_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) #High interest in History -mean(as.numeric(Hist_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(Hist_subset_High$InterestedinstudyingTheology), na.rm = TRUE) ## Religious Studies Interest #Low interest in History @@ -405,7 +415,7 @@ Ethics_subset_High <- TSR_data[TSR_data$InterestedinstudyingEthics > 3, ] #Low interest in Ethics mean(as.numeric(Ethics_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) #High interest in Ethics -mean(as.numeric(Ethics_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(Ethics_subset_High$InterestedinstudyingTheology), na.rm = TRUE) ## Religious Studies Interest #Low interest in Ethics @@ -424,7 +434,7 @@ Polit_subset_High <- TSR_data[TSR_data$InterestedinstudyingPolitics > 3, ] #Low interest in Politics mean(as.numeric(Polit_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) #High interest in Politics -mean(as.numeric(Polit_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(Polit_subset_High$InterestedinstudyingTheology), na.rm = TRUE) ## Religious Studies Interest #Low interest in Politics @@ -443,7 +453,7 @@ Eng_subset_High <- TSR_data[TSR_data$InterestedinstudyingEnglish > 3, ] #Low interest in English mean(as.numeric(Eng_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) #High interest in English -mean(as.numeric(Eng_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(Eng_subset_High$InterestedinstudyingTheology), na.rm = TRUE) ## Religious Studies Interest #Low interest in English @@ -454,7 +464,7 @@ mean(as.numeric(Eng_subset_High$InterestedinstudyingReligiousStudies), na.rm = T ```{r Math} ### Math ### -Math_subset_Low <- TSR_data[TSR_data$InterestedinstudyingMath < 3 & TSR_data$InterestedinstudyingMathy != 0, ] +Math_subset_Low <- TSR_data[TSR_data$InterestedinstudyingMath < 3 & TSR_data$InterestedinstudyingMath != 0, ] Math_subset_High <- TSR_data[TSR_data$InterestedinstudyingMath > 3, ] @@ -462,7 +472,7 @@ Math_subset_High <- TSR_data[TSR_data$InterestedinstudyingMath > 3, ] #Low interest in Math mean(as.numeric(Math_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) #High interest in Math -mean(as.numeric(Math_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(Math_subset_High$InterestedinstudyingTheology), na.rm = TRUE) ## Religious Studies Interest #Low interest in Math @@ -481,7 +491,7 @@ CompSci_subset_High <- TSR_data[TSR_data$InterestedinstudyingComputerScience > 3 #Low interest in Computer Science mean(as.numeric(CompSci_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) #High interest in Computer Science -mean(as.numeric(CompSci_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(CompSci_subset_High$InterestedinstudyingTheology), na.rm = TRUE) ## Religious Studies Interest #Low interest in Computer Science @@ -500,7 +510,7 @@ Busi_subset_High <- TSR_data[TSR_data$InterestedinstudyingBusiness > 3, ] #Low interest in Business mean(as.numeric(Busi_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) #High interest in Business -mean(as.numeric(Busi_subset_Low$InterestedinstudyingTheology), na.rm = TRUE) +mean(as.numeric(Busi_subset_High$InterestedinstudyingTheology), na.rm = TRUE) ## Religious Studies Interest #Low interest in Business @@ -514,6 +524,15 @@ mean(as.numeric(Busi_subset_High$InterestedinstudyingReligiousStudies), na.rm = ## Mean Knowledge in Theology and Religious Studies by High/Low Subject Knowledge ```{r Philosophy} +# Base calculations + +mean(as.numeric(TSR_data$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(TSR_data$GoodunderstandingofReligiousStudies), na.rm = TRUE) +mean(as.numeric(TSR_data$GoodunderstandingofPhilosophy), na.rm = TRUE) +mean(as.numeric(TSR_data$GoodunderstandingofPsychology), na.rm = TRUE) +mean(as.numeric(TSR_data$GoodunderstandingofEnglish), na.rm = TRUE) +mean(as.numeric(TSR_data$GoodunderstandingofMath), na.rm = TRUE) + ### Philosophy ### # Low understanding of philosophy cohort @@ -526,7 +545,7 @@ Philos_subset_High <- TSR_data[TSR_data$GoodunderstandingofPhilosophy > 3, ] #Low knowledge in Philosophy mean(as.numeric(Philos_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) #High knowledge in Philosophy -mean(as.numeric(Philos_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(Philos_subset_High$GoodunderstandingofTheology), na.rm = TRUE) ## Religious Studies Knowledge #Low knowledge in Philosophy @@ -545,7 +564,7 @@ Soc_subset_High <- TSR_data[TSR_data$GoodunderstandingofSociology > 3, ] #Low knowledge in Sociology mean(as.numeric(Soc_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) #High knowledge in Sociology -mean(as.numeric(Soc_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(Soc_subset_High$GoodunderstandingofTheology), na.rm = TRUE) ## Religious Studies knowledge #Low knowledge in Sociology @@ -564,7 +583,7 @@ Psych_subset_High <- TSR_data[TSR_data$GoodunderstandingofPsychology > 3, ] #Low knowledge in Psychology mean(as.numeric(Psych_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) #High knowledge in Psychology -mean(as.numeric(Psych_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(Psych_subset_High$GoodunderstandingofTheology), na.rm = TRUE) ## Religious Studies knowledge #Low knowledge in Psychology @@ -583,7 +602,7 @@ Hist_subset_High <- TSR_data[TSR_data$GoodunderstandingofHistory > 3, ] #Low knowledge in History mean(as.numeric(Hist_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) #High knowledge in History -mean(as.numeric(Hist_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(Hist_subset_High$GoodunderstandingofTheology), na.rm = TRUE) ## Religious Studies knowledge #Low knowledge in History @@ -602,7 +621,7 @@ Ethics_subset_High <- TSR_data[TSR_data$GoodunderstandingofEthics > 3, ] #Low knowledge in Ethics mean(as.numeric(Ethics_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) #High knowledge in Ethics -mean(as.numeric(Ethics_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(Ethics_subset_High$GoodunderstandingofTheology), na.rm = TRUE) ## Religious Studies knowledge #Low knowledge in Ethics @@ -621,7 +640,7 @@ Polit_subset_High <- TSR_data[TSR_data$GoodunderstandingofPolitics > 3, ] #Low knowledge in Politics mean(as.numeric(Polit_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) #High knowledge in Politics -mean(as.numeric(Polit_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(Polit_subset_High$GoodunderstandingofTheology), na.rm = TRUE) ## Religious Studies knowledge #Low knowledge in Politics @@ -640,7 +659,7 @@ Eng_subset_High <- TSR_data[TSR_data$GoodunderstandingofEnglish > 3, ] #Low knowledge in English mean(as.numeric(Eng_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) #High knowledge in English -mean(as.numeric(Eng_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(Eng_subset_High$GoodunderstandingofTheology), na.rm = TRUE) ## Religious Studies knowledge #Low knowledge in English @@ -659,7 +678,7 @@ Math_subset_High <- TSR_data[TSR_data$GoodunderstandingofMath > 3, ] #Low knowledge in Math mean(as.numeric(Math_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) #High knowledge in Math -mean(as.numeric(Math_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(Math_subset_High$GoodunderstandingofTheology), na.rm = TRUE) ## Religious Studies knowledge #Low knowledge in Math @@ -678,7 +697,7 @@ CompSci_subset_High <- TSR_data[TSR_data$GoodunderstandingofComputerScience > 3, #Low knowledge in Computer Science mean(as.numeric(CompSci_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) #High knowledge in Computer Science -mean(as.numeric(CompSci_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(CompSci_subset_High$GoodunderstandingofTheology), na.rm = TRUE) ## Religious Studies knowledge #Low knowledge in Computer Science @@ -697,7 +716,7 @@ Busi_subset_High <- TSR_data[TSR_data$GoodunderstandingofBusiness > 3, ] #Low knowledge in Business mean(as.numeric(Busi_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) #High knowledge in Business -mean(as.numeric(Busi_subset_Low$GoodunderstandingofTheology), na.rm = TRUE) +mean(as.numeric(Busi_subset_High$GoodunderstandingofTheology), na.rm = TRUE) ## Religious Studies knowledge #Low knowledge in Business @@ -711,6 +730,17 @@ mean(as.numeric(Busi_subset_High$GoodunderstandingofReligiousStudies), na.rm = T ## Mean Employability in Theology and Religious Studies by High/Low Subject Employability ```{r Philosophy} +# Base Calculations + +mean(as.numeric(TSR_data$Theologyemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$ReligiousStudiesemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Philosophyemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$PsychologyEmployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Englishemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Mathemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$Businessemployability), na.rm = TRUE) +mean(as.numeric(TSR_data$ComputerScienceemployability), na.rm = TRUE) + ### Philosophy ### Philos_subset_Low <- TSR_data[TSR_data$Philosophyemployability < 3 & TSR_data$Philosophyemployability != 0, ] @@ -720,7 +750,7 @@ Philos_subset_High <- TSR_data[TSR_data$Philosophyemployability > 3, ] #Low employability in Philosophy mean(as.numeric(Philos_subset_Low$Theologyemployability), na.rm = TRUE) #High employability in Philosophy -mean(as.numeric(Philos_subset_Low$Theologyemployability), na.rm = TRUE) +mean(as.numeric(Philos_subset_High$Theologyemployability), na.rm = TRUE) ## Religious Studies employability #Low employability in Philosophy @@ -739,7 +769,7 @@ Soc_subset_High <- TSR_data[TSR_data$Sociologyemployability > 3, ] #Low employability in Sociology mean(as.numeric(Soc_subset_Low$Theologyemployability), na.rm = TRUE) #High employability in Sociology -mean(as.numeric(Soc_subset_Low$Theologyemployability), na.rm = TRUE) +mean(as.numeric(Soc_subset_High$Theologyemployability), na.rm = TRUE) ## Religious Studies employability #Low employability in Sociology @@ -758,7 +788,7 @@ Psych_subset_High <- TSR_data[TSR_data$PsychologyEmployability > 3, ] #Low employability in Psychology mean(as.numeric(Psych_subset_Low$Theologyemployability), na.rm = TRUE) #High employability in Psychology -mean(as.numeric(Psych_subset_Low$Theologyemployability), na.rm = TRUE) +mean(as.numeric(Psych_subset_High$Theologyemployability), na.rm = TRUE) ## Religious Studies employability #Low employability in Psychology @@ -777,7 +807,7 @@ Hist_subset_High <- TSR_data[TSR_data$Historyemployability > 3, ] #Low employability in History mean(as.numeric(Hist_subset_Low$Theologyemployability), na.rm = TRUE) #High employability in History -mean(as.numeric(Hist_subset_Low$Theologyemployability), na.rm = TRUE) +mean(as.numeric(Hist_subset_High$Theologyemployability), na.rm = TRUE) ## Religious Studies employability #Low employability in History @@ -796,7 +826,7 @@ Ethics_subset_High <- TSR_data[TSR_data$Ethicsemployability > 3, ] #Low employability in Ethics mean(as.numeric(Ethics_subset_Low$Theologyemployability), na.rm = TRUE) #High employability in Ethics -mean(as.numeric(Ethics_subset_Low$Theologyemployability), na.rm = TRUE) +mean(as.numeric(Ethics_subset_High$Theologyemployability), na.rm = TRUE) ## Religious Studies employability #Low employability in Ethics @@ -815,7 +845,7 @@ Polit_subset_High <- TSR_data[TSR_data$Politicsemployability > 3, ] #Low employability in Politics mean(as.numeric(Polit_subset_Low$Theologyemployability), na.rm = TRUE) #High employability in Politics -mean(as.numeric(Polit_subset_Low$Theologyemployability), na.rm = TRUE) +mean(as.numeric(Polit_subset_High$Theologyemployability), na.rm = TRUE) ## Religious Studies employability #Low employability in Politics @@ -834,7 +864,7 @@ Eng_subset_High <- TSR_data[TSR_data$Englishemployability > 3, ] #Low employability in English mean(as.numeric(Eng_subset_Low$Theologyemployability), na.rm = TRUE) #High employability in English -mean(as.numeric(Eng_subset_Low$Theologyemployability), na.rm = TRUE) +mean(as.numeric(Eng_subset_High$Theologyemployability), na.rm = TRUE) ## Religious Studies employability #Low employability in English @@ -853,7 +883,7 @@ Math_subset_High <- TSR_data[TSR_data$Mathemployability > 3, ] #Low employability in Math mean(as.numeric(Math_subset_Low$Theologyemployability), na.rm = TRUE) #High employability in Math -mean(as.numeric(Math_subset_Low$Theologyemployability), na.rm = TRUE) +mean(as.numeric(Math_subset_High$Theologyemployability), na.rm = TRUE) ## Religious Studies employability #Low employability in Math @@ -872,7 +902,7 @@ CompSci_subset_High <- TSR_data[TSR_data$ComputerScienceemployability > 3, ] #Low employability in Computer Science mean(as.numeric(CompSci_subset_Low$Theologyemployability), na.rm = TRUE) #High employability in Computer Science -mean(as.numeric(CompSci_subset_Low$Theologyemployability), na.rm = TRUE) +mean(as.numeric(CompSci_subset_High$Theologyemployability), na.rm = TRUE) ## Religious Studies employability #Low employability in Computer Science @@ -891,7 +921,7 @@ Busi_subset_High <- TSR_data[TSR_data$Businessemployability > 3, ] #Low employability in Business mean(as.numeric(Busi_subset_Low$Theologyemployability), na.rm = TRUE) #High employability in Business -mean(as.numeric(Busi_subset_Low$Theologyemployability), na.rm = TRUE) +mean(as.numeric(Busi_subset_High$Theologyemployability), na.rm = TRUE) ## Religious Studies employability #Low employability in Business