Show the code
pacman::p_load(
rio,
tidyverse,
janitor,
lubridate,
openxlsx,
psych,
readr,
lubridate,
pander,
car,
lsr,
plotly
)Lexi Soelberg
All the variables we are looking at in this dataset.
| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -3.442 | 127 | 0.0007819 * * * | two.sided | -0.1062 |
[1] 0.3042466
long_data <- stack(final_io_data[c("Pre_Human Nature", "Post_Human Nature")])
names(long_data) <- c("Human_Nature", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Human Nature", "Post_Human Nature"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Human_Nature,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("steelblue2", "steelblue4")
) %>%
layout(
title = "Human Nature Changes Across Semester",
yaxis = list(title = "Total Average Human Nature"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -0.3015 | 128 | 0.7636 | two.sided | -0.02093 |
[1] 0.02654157
long_data <- stack(final_io_data[c("Pre_L of C", "Post_L of C")])
names(long_data) <- c("Locus_of_Control", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_L of C", "Post_L of C"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Locus_of_Control,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("palegreen3", "darkgreen")
) %>%
layout(
title = "Locus of Control Changes Across Semester",
yaxis = list(title = "Total Average Locus of Control"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| 0.5825 | 128 | 0.5612 | two.sided | 0.03566 |
[1] 0.05128757
long_data <- stack(final_io_data[c("Pre_Efficacy", "Post_Efficacy")])
names(long_data) <- c("Efficacy", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Efficacy", "Post_Efficacy"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Efficacy,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("coral1", "firebrick3")
) %>%
layout(
title = "Efficacy Changes Across Semester",
yaxis = list(title = "Total Average Efficacy"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -1.199 | 127 | 0.2329 | two.sided | -0.08906 |
[1] 0.1059479
long_data <- stack(final_io_data[c("Pre_Challenge", "Post_Challenge")])
names(long_data) <- c("Challenge", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Challenge", "Post_Challenge"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Challenge,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("mediumpurple2", "purple4")
) %>%
layout(
title = "Challenge Changes Across Semester",
yaxis = list(title = "Total Average Challenge"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -0.428 | 128 | 0.6694 | two.sided | -0.03322 |
[1] 0.03768324
long_data <- stack(final_io_data[c("Pre_Barriers", "Post_Barriers")])
names(long_data) <- c("Barriers", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Barriers", "Post_Barriers"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Barriers,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("goldenrod1", "darkorange2")
) %>%
layout(
title = "Barriers Changes Across Semester",
yaxis = list(title = "Total Average Barriers"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| 1.358 | 128 | 0.1767 | two.sided | 0.09731 |
[1] 0.1196026
long_data <- stack(final_io_data[c("Pre_Social Integration", "Post_Social Integration")])
names(long_data) <- c("Social_Integration", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Social Integration", "Post_Social Integration"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Social_Integration,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("turquoise3", "darkslategrey")
) %>%
layout(
title = "Social Integration Changes Across Semester",
yaxis = list(title = "Total Average Social Integration"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| 0.7279 | 128 | 0.468 | two.sided | 0.06977 |
[1] 0.06408512
long_data <- stack(final_io_data[c("Pre_Tech", "Post_Tech")])
names(long_data) <- c("Tech", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Tech", "Post_Tech"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Tech,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("mediumorchid2", "darkorchid4")
) %>%
layout(
title = "Tech Changes Across Semester",
yaxis = list(title = "Total Average Tech"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -2.255 | 128 | 0.02584 * | two.sided | -21.76 |
[1] 0.1985328
long_data <- stack(final_io_data[c("Pre_Screen", "Post_Screen")])
names(long_data) <- c("Screen", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Screen", "Post_Screen"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Screen,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("skyblue2", "deepskyblue4")
) %>%
layout(
title = "Screen Changes Across Semester",
yaxis = list(title = "Total Average Screen"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| 1.308 | 77 | 0.1947 | two.sided | 0.1795 |
[1] 0.1481349
long_data <- stack(final_io_data[c("Pre_Job Satisfaction", "Post_Job Satisfaction")])
names(long_data) <- c("Job_Satisfaction", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Job Satisfaction", "Post_Job Satisfaction"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Job_Satisfaction,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("chartreuse3", "darkolivegreen")
) %>%
layout(
title = "Job Satisfaction Changes Across Semester",
yaxis = list(title = "Total Average Job Satisfaction"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -2.554 | 77 | 0.01263 * | two.sided | -0.2651 |
[1] 0.2891605
long_data <- stack(final_io_data[c("Pre_Affective", "Post_Affective")])
names(long_data) <- c("Affective_Committment", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Affective", "Post_Affective"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Affective_Committment,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("indianred1", "darkred")
) %>%
layout(
title = "Affective Committment Changes Across Semester",
yaxis = list(title = "Total Average Affective Committment"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| 0.5147 | 77 | 0.6082 | two.sided | 0.07564 |
[1] 0.05828294
long_data <- stack(final_io_data[c("Pre_Normative", "Post_Normative")])
names(long_data) <- c("Normative_Committment", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Normative", "Post_Normative"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Normative_Committment,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("plum2", "violetred4")
) %>%
layout(
title = "Normative Committment Changes Across Semester",
yaxis = list(title = "Total Average Normative Committment"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| 0.8802 | 77 | 0.3815 | two.sided | 0.1092 |
[1] 0.09966727
long_data <- stack(final_io_data[c("Pre_Continuance", "Post_Continuance")])
names(long_data) <- c("Continuance_Committment", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Continuance", "Post_Continuance"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Continuance_Committment,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("sandybrown", "sienna3")
) %>%
layout(
title = "Continuance Committment Changes Across Semester",
yaxis = list(title = "Total Average Continuance Committment"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| 0.07458 | 76 | 0.9407 | two.sided | 0.007937 |
[1] 0.008499205
long_data <- stack(final_io_data[c("Pre_Engagement", "Post_Engagement")])
names(long_data) <- c("Engagement", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Engagement", "Post_Engagement"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Engagement,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("lightseagreen", "darkcyan")
) %>%
layout(
title = "Engagement Changes Across Semester",
yaxis = list(title = "Total Average Engagement"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| 0.2566 | 77 | 0.7981 | two.sided | 0.02137 |
[1] 0.02905968
long_data <- stack(final_io_data[c("Pre_Safety", "Post_Safety")])
names(long_data) <- c("Safety", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Safety", "Post_Safety"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Safety,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("cadetblue2", "cadetblue4")
) %>%
layout(
title = "Safety Changes Across Semester",
yaxis = list(title = "Total Average Safety"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -1.649 | 77 | 0.1032 | two.sided | -0.07051 |
[1] 0.1867107
long_data <- stack(final_io_data[c("Pre_CWB", "Post_CWB")])
names(long_data) <- c("CWB", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_CWB", "Post_CWB"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~CWB,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("rosybrown2", "rosybrown4")
) %>%
layout(
title = "CWB Changes Across Semester",
yaxis = list(title = "Total Average CWB"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -3.656 | 77 | 0.0004662 * * * | two.sided | -0.4712 |
[1] 0.4139586
long_data <- stack(final_io_data[c("Pre_Job Search", "Post_Job Search")])
names(long_data) <- c("Job_Search", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Job Search", "Post_Job Search"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Job_Search,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("khaki3", "darkgoldenrod3")
) %>%
layout(
title = "Job Search Changes Across Semester",
yaxis = list(title = "Total Average Job Search"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -2.731 | 128 | 0.007215 * * | two.sided | -0.1194 |
[1] 0.2404124
long_data <- stack(final_io_data[c("Pre_CESD", "Post_CESD")])
names(long_data) <- c("CESD", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_CESD", "Post_CESD"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~CESD,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("lightslateblue", "midnightblue")
) %>%
layout(
title = "CESD Changes Across Semester",
yaxis = list(title = "Total Average CESD"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| 2.507 | 127 | 0.01344 * | two.sided | 0.1866 |
[1] 0.2215755
long_data <- stack(final_io_data[c("Pre_Happiness", "Post_Happiness")])
names(long_data) <- c("Happiness", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Happiness", "Post_Happiness"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Happiness,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("olivedrab3", "olivedrab4")
) %>%
layout(
title = "Happiness Changes Across Semester",
yaxis = list(title = "Total Average Happiness"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| 0.3957 | 128 | 0.693 | two.sided | 0.01249 |
[1] 0.03483614
long_data <- stack(final_io_data[c("Pre_Differential", "Post_Differential")])
names(long_data) <- c("Differential", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Differential", "Post_Differential"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Differential,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("plum3", "darkmagenta")
) %>%
layout(
title = "Differential Changes Across Semester",
yaxis = list(title = "Total Average Differential"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -0.6717 | 127 | 0.503 | two.sided | -0.05352 |
[1] 0.05936783
long_data <- stack(final_io_data[c("Pre_SWLS", "Post_SWLS")])
names(long_data) <- c("SWLS", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_SWLS", "Post_SWLS"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~SWLS,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("palegreen", "seagreen")
) %>%
layout(
title = "SWLS Changes Across Semester",
yaxis = list(title = "Total Average SWLS"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -0.4162 | 128 | 0.6779 | two.sided | -0.01993 |
[1] 0.03664871
long_data <- stack(final_io_data[c("Pre_Stress", "Post_Stress")])
names(long_data) <- c("Stress", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Stress", "Post_Stress"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Stress,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("lightcoral", "firebrick4")
) %>%
layout(
title = "Stress Changes Across Semester",
yaxis = list(title = "Total Average Stress"),
xaxis = list(title = "Timepoint")
)| Test statistic | df | P value | Alternative hypothesis | mean difference |
|---|---|---|---|---|
| -0.1627 | 128 | 0.871 | two.sided | -0.007752 |
[1] 0.01432335
long_data <- stack(final_io_data[c("Pre_Anxiety", "Post_Anxiety")])
names(long_data) <- c("Anxiety", "Timepoint")
long_data$Timepoint <- factor(
long_data$Timepoint,
levels = c("Pre_Anxiety", "Post_Anxiety"),
labels = c("Pre", "Post")
)
plot_ly(
data = long_data,
y = ~Anxiety,
x = ~Timepoint,
type = "box",
color = ~Timepoint,
colors = c("moccasin", "darkorange3")
) %>%
layout(
title = "Anxiety Changes Across Semester",
yaxis = list(title = "Total Average Anxiety"),
xaxis = list(title = "Timepoint")
)
Social Integration Normality
Show the code