Survey Project

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.0     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readxl)
survey <- read_excel("Survey_simplified.xlsx")
survey |>
  filter(Gender == "Male" | Gender == "Female") -> Sex
table(survey$Coping, survey$Frequency)
                                                       
                                                        Daily Rarely Weekly
  Alcohol, cannabis, or other substance                     3      0      0
  Exercise                                                  5      0      3
  Hobbies or creative activities                            1      0      4
  Listening to music                                        5      0      0
  Mindfulness or meditation                                 2      0      1
  Other                                                     2      1      2
  Seeking professional help (therapy, counseling, etc.)     0      0      2
  Socializing with friends/family                           1      1      3
  Time management strategies                                1      0      0
  Watching movies or TV                                     4      0      0

This table shows each primary coping mechanism and how frequently they are used by respondents.

chisq.test(survey$Coping, survey$Frequency)
Warning in chisq.test(survey$Coping, survey$Frequency): Chi-squared
approximation may be incorrect

    Pearson's Chi-squared test

data:  survey$Coping and survey$Frequency
X-squared = 24.381, df = 18, p-value = 0.1429

There was a non-statistically significant relationship between coping mechanism and frequency of use, chi-square(18) = 24.31, p = .14.

t.test(survey$Stress ~ survey$Kids)

    Welch Two Sample t-test

data:  survey$Stress by survey$Kids
t = -1.2242, df = 38.378, p-value = 0.2283
alternative hypothesis: true difference in means between group No and group Yes is not equal to 0
95 percent confidence interval:
 -2.2469252  0.5531453
sample estimates:
 mean in group No mean in group Yes 
         5.363636          6.210526 

There was a non-statistically significant relationship between current stress level for individuals who had children at home (M = 6.21) and individuals who did not have children at home (M = 5.36), t(38.38) = 1.22, p = .228.

survey |>
  ggplot(aes(x = Kids, y = Stress)) +
  geom_boxplot(width = .5) +
  geom_jitter(width = .1) +
  theme_minimal() +
  labs(title = "Stress with and without children",
       x ="Kids",
       y = "Current stress level")

This box plot shows the current stress levels for respondents with and without children.

t.test(survey$Efficacy ~ survey$Kids)

    Welch Two Sample t-test

data:  survey$Efficacy by survey$Kids
t = -0.31291, df = 38.285, p-value = 0.756
alternative hypothesis: true difference in means between group No and group Yes is not equal to 0
95 percent confidence interval:
 -0.6967687  0.5101658
sample estimates:
 mean in group No mean in group Yes 
         3.590909          3.684211 

There was a non-statistically significant relationship between how effective individuals found their primary coping mechanism and if they have kids, t(38.28) = 0.31, p = .76.

t.test(Sex$Stress ~ Sex$Gender)

    Welch Two Sample t-test

data:  Sex$Stress by Sex$Gender
t = 2.006, df = 18.495, p-value = 0.05971
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
 -0.06645364  2.99978697
sample estimates:
mean in group Female   mean in group Male 
            6.066667             4.600000 

There was a non-statistically significant relationship between current stress level for men (M = 4.60) and women (M = 6.07), t(18.50) = 2.01, p = .06.

Sex |>
  ggplot(aes(x = Gender, y = Stress)) +
  geom_boxplot(width = .5) +
  geom_jitter(width = .1) +
  theme_minimal() +
  labs(title = "Stress rates by sex",
       x ="Sex",
       y = "Current stress level")

This box plot shows current stress levels for males and females. Females (M = 6.07) have a higher average stress rate than males (M = 4.60)

t.test(Sex$Efficacy ~ Sex$Gender)

    Welch Two Sample t-test

data:  Sex$Efficacy by Sex$Gender
t = -2.8681, df = 24.096, p-value = 0.008452
alternative hypothesis: true difference in means between group Female and group Male is not equal to 0
95 percent confidence interval:
 -1.3182558 -0.2150776
sample estimates:
mean in group Female   mean in group Male 
            3.433333             4.200000 

A statistically significant relationship was found between belief of primary coping mechanism efficacy for males (M = 4.20) and females (M = 3.43), t(24.10) = 2.87, p = .008.

Sex |>
  ggplot(aes(x = Gender, y = Efficacy)) +
  geom_boxplot(width = .5) +
  geom_jitter(width = .1) +
  theme_minimal() +
  labs(title = "Stress rates by sex",
       x ="Sex",
       y = "Efficacy of coping mechanism")

This box plot shows how effective males and females believe their primary coping mechanism is. Males (M = 4.20) believed their primary coping mechanism was more effective than females (M = 3.43).

table(survey$Age, survey$Stress)
             
              1 2 3 4 5 6 7 8 9 10
  18-24       0 0 0 0 0 0 0 1 0  0
  25-34       1 0 1 2 2 1 1 2 0  2
  35-44       0 0 0 4 3 2 2 1 1  1
  45-54       0 0 0 0 2 2 0 1 0  0
  55-64       1 1 1 0 0 0 1 0 1  0
  65 or older 0 0 0 0 1 0 0 0 0  0
  Under 18    0 0 0 0 2 1 0 0 0  0

This table shows how respondents from each age category rate their current stress level.

Age_ANOVA <- aov(survey$Stress ~ survey$Age)
summary(Age_ANOVA)
            Df Sum Sq Mean Sq F value Pr(>F)
survey$Age   6  16.78   2.796   0.504  0.801
Residuals   34 188.78   5.552               

An analysis of variance showed no statistically significant differences in stress among ages, F(6, 34) = 0.504, p = .801.

table(survey$Employmet, survey$Stress)
            
             1 2 3 4 5 6 7 8 9 10
  Full-time  1 1 2 4 4 4 3 3 1  1
  Part-time  1 0 0 2 3 1 1 1 0  1
  Student    0 0 0 0 2 1 0 0 1  0
  Unemployed 0 0 0 0 1 0 0 1 0  1

This table shows how respondents from each employment category rated their current stress level.

Employ_ANOVA <- aov(survey$Stress ~ survey$Employmet)
summary(Employ_ANOVA)
                 Df Sum Sq Mean Sq F value Pr(>F)
survey$Employmet  3  13.69   4.562    0.88   0.46
Residuals        37 191.87   5.186               

An analysis of variance showed no statistically significant differences in stress among employment status, F(3, 37) = 0.88, p = .46.

table(survey$Relationship, survey$Stress)
          
           1 2 3 4 5 6 7 8 9 10
  Divorced 1 0 0 0 0 0 1 1 0  0
  Married  0 1 1 4 5 3 2 1 2  1
  Single   1 0 1 2 5 3 1 3 0  2

This table shows how respondents from each relationship category rated their current stress level.

Relationship_ANOVA <- aov(survey$Stress ~ survey$Relationship)
summary(Relationship_ANOVA)
                    Df Sum Sq Mean Sq F value Pr(>F)
survey$Relationship  2   0.92   0.458   0.085  0.919
Residuals           38 204.64   5.385               

An analysis of variance showed no statistically significant difference in stress among relationship status, F(2, 38) = 0.09, p = .92.

table(survey$Coping, survey$Stress)
                                                       
                                                        1 2 3 4 5 6 7 8 9 10
  Alcohol, cannabis, or other substance                 0 0 0 1 0 0 2 0 0  0
  Exercise                                              0 0 0 1 2 2 0 2 1  0
  Hobbies or creative activities                        0 0 1 2 2 0 0 0 0  0
  Listening to music                                    0 0 1 1 1 0 1 0 0  1
  Mindfulness or meditation                             0 0 0 1 1 0 0 0 0  1
  Other                                                 2 0 0 0 0 1 0 1 1  0
  Seeking professional help (therapy, counseling, etc.) 0 0 0 0 0 1 0 1 0  0
  Socializing with friends/family                       0 1 0 0 2 1 1 0 0  0
  Time management strategies                            0 0 0 0 1 0 0 0 0  0
  Watching movies or TV                                 0 0 0 0 1 1 0 1 0  1

This table shows how respondents for each coping mechanism rated their current stress level.

Coping_ANOVA <- aov(survey$Stress ~ survey$Coping)
summary(Coping_ANOVA)
              Df Sum Sq Mean Sq F value Pr(>F)
survey$Coping  9  34.67   3.852   0.699  0.705
Residuals     31 170.89   5.513               

An analysis of variance showed no statistically significant difference in stress among primary coping mechanisms, F(9, 31) = 0.70, p = .71.

table(survey$Frequency, survey$Stress)
        
         1 2 3 4 5 6 7 8 9 10
  Daily  1 0 1 4 8 2 3 3 0  2
  Rarely 1 0 0 0 1 0 0 0 0  0
  Weekly 0 1 1 2 1 4 1 2 2  1

This table shows how frequently respondents use their primary coping mechanism and their current stress level.

Frequency_ANOVA <- aov(survey$Stress ~ survey$Frequency)
summary(Frequency_ANOVA)
                 Df Sum Sq Mean Sq F value Pr(>F)
survey$Frequency  2   18.2   9.101   1.846  0.172
Residuals        38  187.4   4.930               

An analysis of variance showed no statistically significant difference in stress and frequency of primary coping mechanism use, F(2, 38) = 1.85, p = .17.

survey |>
  mutate(Frequency = as_factor(Frequency)) |>
  mutate(Stress = as_factor(Stress)) |>
  ggplot(aes(x = Frequency, fill = Stress)) +
  geom_bar(position = "fill") +
  scale_fill_viridis_d() +
  theme_minimal() +
  coord_flip() +
  labs(title = "Stress by Frequency",
      y = "Proportion of stress rate")

This bar graph shows proportion of stress rates based on frequency of primary coping mechanism use.

survey |>
  mutate(Gender = as_factor(Gender)) |>
  mutate(Efficacy = as_factor(Efficacy)) |>
  ggplot(aes(x = Gender, fill = Efficacy)) +
  geom_bar(position = "fill") +
  scale_fill_viridis_d() +
  theme_minimal() +
  coord_flip() +
  labs(title = "Efficacy by Gender",
      y = "Proportion of efficacy rate")

This bar graph rates of how effective individuals believe their primary coping mechanism is based on gender. Males indicated that their primary coping mechanism was more effective than females and non-binary people.