thesis %>%
drop_na(Age, GPA1) %>%
ggplot(aes(Age, GPA1)) +
geom_point() +
theme_minimal() +
geom_smooth(formula = y~x, method = lm, se = FALSE) +
labs(title = "Relationship between GPA(1) and Age",
x = "Age",
y = "GPA")
cor.test(thesis$Age, thesis$GPA1)
Pearson's product-moment correlation
data: thesis$Age and thesis$GPA1
t = 0.25668, df = 39, p-value = 0.7988
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.2699939 0.3443673
sample estimates:
cor
0.04106779
The correlation between Age and GPA was not statistically significant, r(39) = .04, ns.
thesis %>%
filter(College == "BU" | College == "AS") -> BUASCollege
t.test(BUASCollege$GPA1 ~ BUASCollege$College)
Welch Two Sample t-test
data: BUASCollege$GPA1 by BUASCollege$College
t = -1.2753, df = 38.772, p-value = 0.2098
alternative hypothesis: true difference in means between group AS and group BU is not equal to 0
95 percent confidence interval:
-0.7143396 0.1619586
sample estimates:
mean in group AS mean in group BU
3.02381 3.30000
The GPAs of those attending Business College (M = 3.02) and Arts & Sciences College (M = 3.30) were not statistically significantly different, t(38.78) = -1.28, ns
thesis %>%
drop_na(GPA1,College) %>%
ggplot(aes(x = College, y = GPA1)) +
geom_boxplot() +
geom_jitter(width = .1) +
theme_minimal() +
labs(title = "GPA1 by College", x = "College", y = "GPA1")
thesis %>%
filter(Major == "Account" | Major == "Comm") -> AccountCommMajor
t.test(AccountCommMajor$GPA1 ~ AccountCommMajor$Major)
Welch Two Sample t-test
data: AccountCommMajor$GPA1 by AccountCommMajor$Major
t = 0.95153, df = 5.297, p-value = 0.3827
alternative hypothesis: true difference in means between group Account and group Comm is not equal to 0
95 percent confidence interval:
-0.7868789 1.7368789
sample estimates:
mean in group Account mean in group Comm
3.675 3.200
The GPAs of Accounting Majors (M = 3.68) and Communications Majors (M = 3.20) were statistically significantly different, t(5.30) = .95, p > .05
thesis %>%
filter(Major == "Account" | Major == "Comm") %>%
ggplot(aes(x = Major, y = GPA1)) +
geom_boxplot() +
geom_jitter(width = .1) +
theme_minimal() +
labs(title = "GPA(1) in Acconting vs. Communications", x = "Major", y = "GPA")
t.test(thesis$Mood1, thesis$Mood2, paired = T)
Paired t-test
data: thesis$Mood1 and thesis$Mood2
t = -2.1686, df = 40, p-value = 0.03611
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.80105415 -0.02821414
sample estimates:
mean of the differences
-0.4146341
summary(thesis)
Age Sex SelfEsteem Mood1 Mood2 Major College
Min. :19.00 Length:43 Min. :14.00 Min. :-4.0000 Min. :-4.0000 Length:43 Length:43
1st Qu.:20.25 Class :character 1st Qu.:23.50 1st Qu.:-1.0000 1st Qu.: 0.0000 Class :character Class :character
Median :23.50 Mode :character Median :25.00 Median : 0.0000 Median : 0.0000 Mode :character Mode :character
Mean :24.07 Mean :24.44 Mean :-0.2381 Mean : 0.2381
3rd Qu.:26.00 3rd Qu.:26.00 3rd Qu.: 1.0000 3rd Qu.: 1.0000
Max. :41.00 Max. :29.00 Max. : 3.0000 Max. : 3.0000
NA's :1 NA's :1 NA's :1
GPA1 GPA2 Home
Min. :1.400 Min. :2.20 Length:43
1st Qu.:2.725 1st Qu.:3.00 Class :character
Median :3.200 Median :3.45 Mode :character
Mean :3.117 Mean :3.40
3rd Qu.:3.675 3rd Qu.:4.00
Max. :4.000 Max. :4.00
NA's :1 NA's :1
Moods 1 and 2 were both highest around 0, (M = -.23) than at time 1 (M = .23), t(40) = -2.17, p < .05.
thesis %>%
pivot_longer(cols = c(Mood1, Mood2), names_to = "Time", values_to = "Mood") %>%
ggplot(aes(x = Time, y = Mood)) +
geom_boxplot() +
geom_jitter(width = .1) +
theme_minimal() +
labs(title = "Comparison of Mood1 and Mood2 over Time", x = "Mood1", y = "Mood2")
Warning: Removed 2 rows containing non-finite values (stat_boxplot).
Warning: Removed 2 rows containing missing values (geom_point).
thesis %>%
mutate(Home = as_factor(Home)) %>%
mutate(College = as_factor(College)) %>%
drop_na(Home, College) %>%
ggplot(aes(x = Home,fill = College)) +
geom_bar(position = "fill") +
theme_minimal() +
coord_flip() +
labs(title = "Relationship between Home and College",
x = "Home",
y = "College")
table(thesis$College, thesis$Home)
chisq.test(thesis$College, thesis$Home)
There was no marginally statistically significant relationship between College and Home, chi-square(2) = .76, p = .68 ns.
thesis %>%
drop_na(Home, SelfEsteem) %>%
group_by(Home) %>%
summarize(Mean = mean(SelfEsteem),
"Std Dev" = sd(SelfEsteem),
N = n())
NA
SelfEsteem_ANOVA <- aov(thesis$SelfEsteem~ thesis$Home)
summary(SelfEsteem_ANOVA)
Df Sum Sq Mean Sq F value Pr(>F)
thesis$Home 2 15.76 7.879 1.043 0.362
Residuals 39 294.53 7.552
1 observation deleted due to missingness
There were no statistically significant differences in Self Esteem by Home F(2, 39) = 1.043, ns.
thesis %>%
drop_na(Home,SelfEsteem) %>%
ggplot(aes(x = Home, y = SelfEsteem)) +
geom_boxplot() +
geom_jitter(width = .1) +
theme_minimal() +
labs(title = "Difference in SelfEsteem", x = "Home", y = "SelfEsteem")