Hypothesis testing
# ns difference in familiarity with common mental health conditions
aggregate(fam_mh_conds ~ time, data = data, FUN = function(x) c(mean = mean(x), sd = sd(x), n = length(x))) # more familiarity at post
## time fam_mh_conds.mean fam_mh_conds.sd fam_mh_conds.n
## 1 0 1.2647059 0.5110194 34.0000000
## 2 1 1.3636364 0.4885042 33.0000000
t.test(fam_mh_conds ~ time, data = data) # ns
##
## Welch Two Sample t-test
##
## data: fam_mh_conds by time
## t = -0.81014, df = 64.986, p-value = 0.4208
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.3428115 0.1449506
## sample estimates:
## mean in group 0 mean in group 1
## 1.264706 1.363636
wilcox.test(fam_mh_conds ~ time, data = data) # W = 511.5, p-value = 0.4566
## Warning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot
## compute exact p-value with ties
##
## Wilcoxon rank sum test with continuity correction
##
## data: fam_mh_conds by time
## W = 511.5, p-value = 0.4566
## alternative hypothesis: true location shift is not equal to 0
# attendees are significantly more confident in their ability to identify someone in distress after the training
aggregate(conf_id_distress ~ time, data = data, FUN = function(x) c(mean = mean(x), sd = sd(x), n = length(x))) # more confident at post
## time conf_id_distress.mean conf_id_distress.sd conf_id_distress.n
## 1 0 1.2058824 0.4785972 34.0000000
## 2 1 1.4848485 0.5075192 33.0000000
t.test(conf_id_distress ~ time, data = data) # sig
##
## Welch Two Sample t-test
##
## data: conf_id_distress by time
## t = -2.3133, df = 64.491, p-value = 0.0239
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.51983951 -0.03809275
## sample estimates:
## mean in group 0 mean in group 1
## 1.205882 1.484848
wilcox.test(conf_id_distress ~ time, data = data) # W = 412.5, p-value = 0.02738
## Warning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot
## compute exact p-value with ties
##
## Wilcoxon rank sum test with continuity correction
##
## data: conf_id_distress by time
## W = 412.5, p-value = 0.02738
## alternative hypothesis: true location shift is not equal to 0
# attendees are significantly more comfortable in their ability to respond to someone with mental health issues after the training
aggregate(comf_resp_mh_issues ~ time, data = data, FUN = function(x) c(mean = mean(x), sd = sd(x), n = length(x))) # more comfort at post
## time comf_resp_mh_issues.mean comf_resp_mh_issues.sd comf_resp_mh_issues.n
## 1 0 1.0000000 0.5504819 34.0000000
## 2 1 1.2727273 0.4522670 33.0000000
t.test(comf_resp_mh_issues ~ time, data = data) # sig
##
## Welch Two Sample t-test
##
## data: comf_resp_mh_issues by time
## t = -2.2186, df = 63.292, p-value = 0.03011
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.51835472 -0.02709982
## sample estimates:
## mean in group 0 mean in group 1
## 1.000000 1.272727
wilcox.test(comf_resp_mh_issues ~ time, data = data) # W = 430.5, p-value = 0.03885
## Warning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot
## compute exact p-value with ties
##
## Wilcoxon rank sum test with continuity correction
##
## data: comf_resp_mh_issues by time
## W = 430.5, p-value = 0.03885
## alternative hypothesis: true location shift is not equal to 0
# ns difference in comfort talking about mental health issues with students
aggregate(comf_talk_mh_students ~ time, data = data, FUN = function(x) c(mean = mean(x), sd = sd(x), n = length(x))) # more comfort at post
## time comf_talk_mh_students.mean comf_talk_mh_students.sd
## 1 0 1.2000000 0.5773503
## 2 1 1.4583333 0.5089774
## comf_talk_mh_students.n
## 1 25.0000000
## 2 24.0000000
t.test(comf_talk_mh_students ~ time, data = data) # ns
##
## Welch Two Sample t-test
##
## data: comf_talk_mh_students by time
## t = -1.6631, df = 46.671, p-value = 0.103
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.57087522 0.05420856
## sample estimates:
## mean in group 0 mean in group 1
## 1.200000 1.458333
wilcox.test(comf_talk_mh_students ~ time, data = data) # W = 233.5, p-value = 0.1258
## Warning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot
## compute exact p-value with ties
##
## Wilcoxon rank sum test with continuity correction
##
## data: comf_talk_mh_students by time
## W = 233.5, p-value = 0.1258
## alternative hypothesis: true location shift is not equal to 0
# ns difference in comfort talking about mental health issues with coworkers
aggregate(comf_talk_mh_coworkers ~ time, data = data, FUN = function(x) c(mean = mean(x), sd = sd(x), n = length(x))) # more comfort at post
## time comf_talk_mh_coworkers.mean comf_talk_mh_coworkers.sd
## 1 0 1.3529412 0.5970814
## 2 1 1.5757576 0.5607084
## comf_talk_mh_coworkers.n
## 1 34.0000000
## 2 33.0000000
t.test(comf_talk_mh_coworkers ~ time, data = data) # ns
##
## Welch Two Sample t-test
##
## data: comf_talk_mh_coworkers by time
## t = -1.5751, df = 64.931, p-value = 0.1201
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.50534873 0.05971593
## sample estimates:
## mean in group 0 mean in group 1
## 1.352941 1.575758
wilcox.test(comf_talk_mh_coworkers ~ time, data = data) # W = 449, p-value = 0.1133
## Warning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot
## compute exact p-value with ties
##
## Wilcoxon rank sum test with continuity correction
##
## data: comf_talk_mh_coworkers by time
## W = 449, p-value = 0.1133
## alternative hypothesis: true location shift is not equal to 0
# attendees were significantly more confident in their ability to help a student access mental health resources after the training
aggregate(conf_student_mh_resource ~ time, data = data, FUN = function(x) c(mean = mean(x), sd = sd(x), n = length(x))) # more confidence at post
## time conf_student_mh_resource.mean conf_student_mh_resource.sd
## 1 0 1.0800000 0.5715476
## 2 1 1.6250000 0.4945354
## conf_student_mh_resource.n
## 1 25.0000000
## 2 24.0000000
t.test(conf_student_mh_resource ~ time, data = data) # sig
##
## Welch Two Sample t-test
##
## data: conf_student_mh_resource by time
## t = -3.5737, df = 46.512, p-value = 0.0008328
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.8518796 -0.2381204
## sample estimates:
## mean in group 0 mean in group 1
## 1.080 1.625
wilcox.test(conf_student_mh_resource ~ time, data = data) # W = 159, p-value = 0.001492
## Warning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot
## compute exact p-value with ties
##
## Wilcoxon rank sum test with continuity correction
##
## data: conf_student_mh_resource by time
## W = 159, p-value = 0.001492
## alternative hypothesis: true location shift is not equal to 0
# attendees were significantly more confident in their ability to help a coworker access mental health resources after the training
aggregate(conf_coworker_mh_resource ~ time, data = data, FUN = function(x) c(mean = mean(x), sd = sd(x), n = length(x))) # more confidence at post
## time conf_coworker_mh_resource.mean conf_coworker_mh_resource.sd
## 1 0 1.3235294 0.5888143
## 2 1 1.7272727 0.4522670
## conf_coworker_mh_resource.n
## 1 34.0000000
## 2 33.0000000
t.test(conf_coworker_mh_resource ~ time, data = data) # sig
##
## Welch Two Sample t-test
##
## data: conf_coworker_mh_resource by time
## t = -3.1531, df = 61.774, p-value = 0.002493
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.6597199 -0.1477667
## sample estimates:
## mean in group 0 mean in group 1
## 1.323529 1.727273
wilcox.test(conf_coworker_mh_resource ~ time, data = data) # W = 358.5, p-value = 0.003634
## Warning in wilcox.test.default(x = DATA[[1L]], y = DATA[[2L]], ...): cannot
## compute exact p-value with ties
##
## Wilcoxon rank sum test with continuity correction
##
## data: conf_coworker_mh_resource by time
## W = 358.5, p-value = 0.003634
## alternative hypothesis: true location shift is not equal to 0