setwd("~/dev/TRAUMA")
file_path <- "data/psych_mothers_ACTION BOSNIA_(ENGLISH).xlsx"
data_mothers <- read_excel(file_path)
## New names:
## • `In case you selected YES in previous question for other unlisted
##   conditions/diseases, write them here` -> `In case you selected YES in
##   previous question for other unlisted conditions/diseases, write them
##   here...22`
## • `In case you selected YES in previous question for other unlisted
##   conditions/diseases, write them here` -> `In case you selected YES in
##   previous question for other unlisted conditions/diseases, write them
##   here...31`
## • `How old were you?` -> `How old were you?...50`
## • `How traumatic it was?` -> `How traumatic it was?...51`
## • `How much did you confide in the others during that time?` -> `How much did
##   you confide in the others during that time?...52`
## • `How old were you?` -> `How old were you?...54`
## • `How traumatic it was?` -> `How traumatic it was?...55`
## • `How much did you confide in the others during that time?` -> `How much did
##   you confide in the others during that time?...56`
## • `How old were you?` -> `How old were you?...58`
## • `How traumatic it was?` -> `How traumatic it was?...59`
## • `How much did you confide in the others during that time?` -> `How much did
##   you confide in the others during that time?...60`
## • `How old were you?` -> `How old were you?...62`
## • `How traumatic it was?` -> `How traumatic it was?...63`
## • `How much did you confide in the others during that time?` -> `How much did
##   you confide in the others during that time?...64`
## • `How old were you?` -> `How old were you?...66`
## • `How traumatic it was?` -> `How traumatic it was?...67`
## • `How much did you confide in the others during that time?` -> `How much did
##   you confide in the others during that time?...68`
## • `How old were you?` -> `How old were you?...70`
## • `How traumatic it was?` -> `How traumatic it was?...71`
## • `How much did you confide in the others during that time?` -> `How much did
##   you confide in the others during that time?...72`
data_mothers <- data_mothers[1:42, ]


# Srebrenica Survey
srebrenica <- data_mothers %>% select(
  `CODE of respondent`,
  `Did you directly witness the Genocide in Srebrenica?`,
  `If not, were you indirectly affected by Genocide in Srebrenica?`,
  `If yes, please list the ways in which you were affected by the genocide: [My family witnessed the genocide]`,
  `If yes, please list the ways in which you were affected by the genocide: [My family member/s were killed or injured during the genocide]`,
  `If yes, please list the ways in which you were affected by the genocide: [My family was separated during the genocide (close or close to the first knee)]`,
  `How old were you during the Genocide in Srebrenica?`,
  `Would and how could you compare the stressful situation due to the Covid-19 pandemic with the stress you experienced and felt during the genocide?`,
  `Were you able to share the pain and grief with the family (did you talk to someone about it)`,
  `Were you immediately provided with professional psychological help during the first three months after the genocide?`,
  `Were you subsequently provided with psychological help by a professional between three months and two years after the genocide?`,
  `How would you rate the quality of your life in the years after the genocide in Srebrenica as a child and adolescent?`
)


srebrenica <- srebrenica[1:22, ] #only participants from trauma group answered this questionnaire
write.xlsx(srebrenica, file = "data/srebrenica_mothers.xlsx")

srebrenica
## # A tibble: 22 × 12
##    `CODE of respondent` Did you directly witness the Ge…¹ If not, were you ind…²
##    <chr>                <chr>                                              <dbl>
##  1 S1M1                 0                                                      1
##  2 S2M2                 1                                                      1
##  3 S3M3                 1                                                      1
##  4 S4M4                 0                                                      0
##  5 S5M5                 1                                                      1
##  6 S6M6                 0                                                      0
##  7 S7M7                 1                                                      1
##  8 S8M8                 0                                                      1
##  9 S9M9                 0                                                      1
## 10 S10M10               0                                                      1
## # ℹ 12 more rows
## # ℹ abbreviated names: ¹​`Did you directly witness the Genocide in Srebrenica?`,
## #   ²​`If not, were you indirectly affected by Genocide in Srebrenica?`
## # ℹ 9 more variables:
## #   `If yes, please list the ways in which you were affected by the genocide: [My family witnessed the genocide]` <dbl>,
## #   `If yes, please list the ways in which you were affected by the genocide: [My family member/s were killed or injured during the genocide]` <dbl>,
## #   `If yes, please list the ways in which you were affected by the genocide: [My family was separated during the genocide (close or close to the first knee)]` <dbl>, …
srebrenica_age <- srebrenica %>%
  filter(`How old were you during the Genocide in Srebrenica?` >= 1 & `How old were you during the Genocide in Srebrenica?` <= 99)

age_plot <- ggplot(srebrenica_age, aes(x = `How old were you during the Genocide in Srebrenica?`)) +
  geom_bar(fill = "steelblue", color = "white") +
  labs(x = "Age during Genocide [MOTHERS]", y = "Count") +
  scale_x_continuous(breaks = seq(1, 15, by = 1)) +
  theme_minimal()

age_plot

missing_age <- sum(is.na(srebrenica$`How old were you during the Genocide in Srebrenica?`))
cat("Number of participants with missing age values:", missing_age, "\n")
## Number of participants with missing age values: 4
srebrenica$`Did you directly witness the Genocide in Srebrenica?` <- factor(srebrenica$`Did you directly witness the Genocide in Srebrenica?`, levels = c(0, 1), labels = c("No", "Yes"))

srebrenica$`If not, were you indirectly affected by Genocide in Srebrenica?` <- factor(srebrenica$`If not, were you indirectly affected by Genocide in Srebrenica?`, levels = c(0, 1), labels = c("No", "Yes"))

srebrenica$`Were you immediately provided with professional psychological help during the first three months after the genocide?` <- factor(trimws(srebrenica$`Were you immediately provided with professional psychological help during the first three months after the genocide?`), levels = c(0, 1), labels = c("No", "Yes"))

srebrenica$`Were you subsequently provided with psychological help by a professional between three months and two years after the genocide?` <- factor(trimws(srebrenica$`Were you subsequently provided with psychological help by a professional between three months and two years after the genocide?`), levels = c(0, 1), labels = c("No", "Yes"))

srebrenica$`How would you rate the quality of your life in the years after the genocide in Srebrenica as a child and adolescent?` <- factor(srebrenica$`How would you rate the quality of your life in the years after the genocide in Srebrenica as a child and adolescent?`, levels = c(0, 1, 2, 3, 4), labels = c("VERY POOR QUALITY", "POOR QUALITY", "AVERAGE", "HIGH QUALITY", "VERY HIGH QUALITY"))


srebrenica$stress_comparison <- factor(srebrenica$`Would and how could you compare the stressful situation due to the Covid-19 pandemic with the stress you experienced and felt during the genocide?`,
                                       levels = c(0, 1, 2, 3),
                                       labels = c("Less stressful than COVID", "Just as stressful as COVID",
                                                  "More stressful than COVID", "Much more stressful than COVID"))

srebrenica$share_pain <- factor(srebrenica$`Were you able to share the pain and grief with the family (did you talk to someone about it)`,
                                levels = c(0, 1, 2),
                                labels = c("No", "Yes", "Partially"))
immediate_help_pct <- mean(srebrenica$`Were you immediately provided with professional psychological help during the first three months after the genocide?` == "Yes", na.rm = TRUE) * 100
subsequent_help_pct <- mean(srebrenica$`Were you subsequently provided with psychological help by a professional between three months and two years after the genocide?` == "Yes", na.rm = TRUE) * 100
cat("Percentage of participants who received immediate psychological help:", immediate_help_pct, "%\n")
## Percentage of participants who received immediate psychological help: 0 %
cat("Percentage of participants who received subsequent psychological help:", subsequent_help_pct, "%\n")
## Percentage of participants who received subsequent psychological help: 0 %
stress_freq <- table(srebrenica$stress_comparison)
share_pain_freq <- table(srebrenica$share_pain)

cat("Stress Comparison Frequency:\n")
## Stress Comparison Frequency:
print(stress_freq)
## 
##      Less stressful than COVID     Just as stressful as COVID 
##                              0                              1 
##      More stressful than COVID Much more stressful than COVID 
##                              3                             11
cat("\nShare Pain Frequency:\n")
## 
## Share Pain Frequency:
print(share_pain_freq)
## 
##        No       Yes Partially 
##         2        11         2
witness_freq <- table(srebrenica$`Did you directly witness the Genocide in Srebrenica?`)
affected_freq <- table(srebrenica$`If not, were you indirectly affected by Genocide in Srebrenica?`)
cat("Directly Witnessed Genocide Frequency:\n")
## Directly Witnessed Genocide Frequency:
print(witness_freq)
## 
##  No Yes 
##  13   9
cat("\nIndirectly Affected by Genocide Frequency:\n")
## 
## Indirectly Affected by Genocide Frequency:
print(affected_freq)
## 
##  No Yes 
##   6  16
quality_plot <- ggplot(srebrenica, aes(x = `How would you rate the quality of your life in the years after the genocide in Srebrenica as a child and adolescent?`)) +
  geom_bar(fill = "steelblue") +
  labs(x = "Quality of Life Rating [MOTHERS]", y = "Count") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))


stress_plot <- ggplot(srebrenica, aes(x = stress_comparison)) +
  geom_bar(fill = "steelblue") +
  labs(x = "Stress Comparison [MOTHERS]", y = "Count") +
  theme_minimal() +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

share_pain_plot <- ggplot(srebrenica, aes(x = share_pain)) +
  geom_bar(fill = "steelblue") +
  labs(x = "Share Pain [MOTHERS]", y = "Count") +
  theme_minimal()


quality_plot

stress_plot

share_pain_plot