── 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).
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.