First, this is using a correlation to determine if there is a statistically significant correlation between the age of the students and their GPAs
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 Self Esteem was statistically significant, r(40) = .04, ns.
Next, this is running a t test to determine if there is a difference between the first GPA of students in the Business College and the Arts College.
t.test(thesis$GPA1 ~ thesis$College)
Welch Two Sample t-test
data: thesis$GPA1 by thesis$College
t = -1.2753, df = 38.772, p-value = 0.2098
alternative hypothesis: true difference in means 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
BU (M = 3.30) had slightly higher GPA1 than AS (M = 3.02), t(38.77) = 1.28, p > .05.
Next, this is running another t test to see if there is a difference between the first GPA of communications majors and accounting majors. However, in the sample data there is more than 2 choices for major meaning a new category for the data of just the two majors must be inputed as well.
thesis %>%
filter(Major == "Comm" | Major == "Account") -> ComAccMajor
t.test(ComAccMajor$GPA1 ~ ComAccMajor$Major)
Welch Two Sample t-test
data: ComAccMajor$GPA1 by ComAccMajor$Major
t = 0.95153, df = 5.297, p-value = 0.3827
alternative hypothesis: true difference in means 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
Accounting (M = 3.68) had a higher GPA1 than Communications (M = 3.20), t(5.30) = 0.95, p < .05.
Next, this is running a paired t test to analyze if there is a difference between mood 1 and mood 2.
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
Moods were higher at time 2 (M = .2381) than at time 1 (M = -.2381), t(40) = 2.17, p < .05.
The next test being used is a chi squared test to analyze if there is a relationship between where students are from and which college they are in.
table(thesis$Home, thesis$College)
AS BU
Billings 5 6
OtherMT 11 7
OutofState 6 6
chisq.test(thesis$Home, thesis$College)
Pearson's Chi-squared test
data: thesis$Home and thesis$College
X-squared = 0.76438, df = 2, p-value = 0.6824
There was not a statistically significant relationship between where home is for the students and which college they are in, chi-square(2) = 0.76, p = .68.
Finally, this runs one last t test to determine if there is a relationship between where students are from and their self esteem.
table(thesis$Home, thesis$SelfEsteem)
14 18 21 22 23 24 25 26 27 28 29
Billings 0 0 0 2 0 4 1 3 0 1 1
OtherMT 1 0 1 3 2 3 3 3 1 1 0
OutofState 0 1 0 0 1 3 1 3 2 0 1
chisq.test(thesis$Home, thesis$SelfEsteem)
Chi-squared approximation may be incorrect
Pearson's Chi-squared test
data: thesis$Home and thesis$SelfEsteem
X-squared = 15.089, df = 20, p-value = 0.7713
There was not a statistically significant relationship between where home is for the students and their self esteem, chi-square(20) = 15.09, p = 0.77.