More Data Working and Analyses

Beginning to work on the analyses based on participants' answers to the religious affiliation questions, including cleaning of the data, removal of incomplete data sets (based on visual inspection), and creation of separate .csv files as I have done with previous analyses.

So far no significant differences between the answers to questions and formal religious affiliation of the school.
This commit is contained in:
rehughes07 2021-11-03 17:34:51 +00:00
parent 2a5004e92f
commit d98d1e7c78
5 changed files with 292 additions and 176 deletions

View file

@ -30,17 +30,18 @@ Data summary/visualisation with subsetting:
```{r Frequencies}
#Frequencies#
Q25_frequencies = table(connect_data$Q25)
Q25_frequencies <- table(connect_data$Q25)
Q25_frequencies
Q26_freq = table(connect_data$Q26)
Q26_freq <- table(connect_data$Q26)
Q26_freq
Q3_freq = table(connect_data$Q3)
Q3_freq <- table(connect_data$Q3)
Q3_freq
#test3 = as.factor(connect_data$Q3, levels = c(1, 2, 3, 4, 5), labels = c("Worldviews", "Religion", "Theology", "Ethics", "Philosophy"))
```
```{r Q25 bar/pie}
pie(Q25_frequencies, labels = c("Maybe", "No", "Yes"))
pie(Q25_frequencies, labels = c("Maybe", "No", "Yes"), col = coul3)
```
@ -84,7 +85,7 @@ Q3_data <- read.csv("./data/Q3.csv")
#table(Q3_data [,3:7])
#pie(table(Q3_data [,3:7]))
Q3_data2 <- Q3_data[,3:7]
Q3_data2 <- Q3_data[ ,3:7]
#head(Q3_data2)
#table(Q3_data2)
#table(Q3_data2[,1])
@ -240,3 +241,48 @@ summary(Q_27test)
#No significant difference in responses to Q27 based on what they considered important
```
- RH: test for correlation between responses to religion questions: Q12-14, Q15-16 and Q21 and responses to Q22, Q23, Q27, [Q24, Q25, Q30]
``` {r Analyses based on religious affiliation}
religion_affiliation_data <- read.csv("./data/Religious affiliation data.csv")
head(religion_affiliation_data)
## Q12-14, with Q22, Q23, Q27
# Q12 is binary, 1st test whether difference in answers based on whether the school has formal religious character or not (similar ANOVA/MANOVA as the questions above)
religion_affiliation_data$Q12 <- factor(religion_affiliation_data$Q12, levels = c("No", "Yes"), labels = c("No", "Yes"))
## Q22
formal_affiliation_test_Q22 <- t.test(Q22_average ~ Q12, data = religion_affiliation_data, paired = FALSE)
formal_affiliation_test_Q22
## Q23
formal_affiliation_test_Q23 <- manova(cbind(Q23_1, Q23_2) ~ Q12, data = religion_affiliation_data)
summary(formal_affiliation_test_Q23)
## Q27
formal_affiliation_test_Q27 <- manova(cbind(Q27_1, Q27_2, Q27_3, Q27_4, Q27_5, Q27_6, Q27_7) ~ Q12, data = religion_affiliation_data)
summary(formal_affiliation_test_Q27)
# Then, if there is (or can anyway), explore only the "Yes" data, and see if there is a difference in answers based on the specific religious character -- Q13
# first subset the data
Q13_data <- religion_affiliation_data[religion_affiliation_data$Q12 == "Yes", ]
head(Q13_data)
# then analyze based on specific one
Q13_data$Q13_recode <- factor(Q13_data$Q13_recode, levels = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), labels = c("Church of England", "Roman Catholic", "Methodist", "Other Christian", "Jewish", "Muslim", "Sikh", "Hindu", "Multi-Faith", "None of the above"))
# Q22
hist(Q13_data$Q22_average)
specific_affiliation_test <- aov(Q22_average ~ Q13_recode, data = Q13_data)
summary(specific_affiliation_test)
# Q23
# Q27
## Q15-16 with Q22, Q23, Q27
# Q15 is binary; 1st test whether difference in answers based on whether the school has an informal religious character or not. Q16 provides further detail and can be explored
## Q21 with Q22, Q23, Q27
# Q21 is personal religious affiliation. This may be more tricky as it is a free answer...but can code the type of religious affiliation and test that way? -- would be chi-square or some sort of non-para analysis due to the small number of respondents who answered this
```