Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
The tables above provides the distributions of respondents in terms of sex, strand and daily screen time. It can be seen that there are 72 females and 28 males; 20 of which are from ABM, 20 from GAS, 40 from HUMSS, and 20 from STEM. Moreover, 26 students have a daily screen time of 1-2 hours, 24 for 3-4 hours, 22 for 5-6 hours, and 28 for more than 6 hours.
Call:
lm(formula = `Academic Proficiency` ~ `Mental Health` + `Physical Health` +
`Social Interactions`, data = Data)
Coefficients:
(Intercept) `Mental Health` `Physical Health`
1.31602 0.24408 0.18613
`Social Interactions`
0.05491
From this, we may deduce that the data fail to satisfy two assumptions – Linearity and Homogeneity of Variance.
Loading required package: carData
Attaching package: 'car'
The following object is masked from 'package:dplyr':
recode
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ forcats 1.0.0 ✔ readr 2.1.5
✔ ggplot2 3.4.4 ✔ stringr 1.5.1
✔ lubridate 1.9.3 ✔ tibble 3.2.1
✔ purrr 1.0.2 ✔ tidyr 1.3.1
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
✖ car::recode() masks dplyr::recode()
✖ purrr::some() masks car::some()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Attaching package: 'rstatix'
The following object is masked from 'package:stats':
filter
Shapiro-Wilk normality test
data: Data$`Physical Health`
W = 0.92897, p-value = 4.352e-05
Since p-value = 4.352e-05 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.
Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 1 0.5427 0.4631
98
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Attaching package: 'gplots'
The following object is masked from 'package:stats':
lowess
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
# A tibble: 2 × 11
Sex variable n min max median iqr mean sd se ci
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Female Physical Health 72 1.6 3.4 2.8 0.4 2.73 0.329 0.039 0.077
2 Male Physical Health 28 1.6 3.4 2.7 0.4 2.69 0.387 0.073 0.15
The mean of female and male is 2.731 and 2.686, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Physical Health 100 0.471 1 0.492 Kruskal-Wallis
Based on the p-value, there is no significant difference on the physical health when grouped according to sex.
Shapiro-Wilk normality test
data: Data$`Mental Health`
W = 0.9454, p-value = 0.000418
Since p-value = 0.000418 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.
Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 1 0.1865 0.6668
98
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
# A tibble: 2 × 11
Sex variable n min max median iqr mean sd se ci
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Female Mental Health 72 2 3.2 2.6 0.4 2.65 0.297 0.035 0.07
2 Male Mental Health 28 2 3.2 2.6 0.45 2.61 0.333 0.063 0.129
The mean of female and male is 2.647 and 2.607, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Mental Health 100 0.212 1 0.645 Kruskal-Wallis
Based on the p-value, there is no significant difference on the mental health when grouped according to sex.
Shapiro-Wilk normality test
data: Data$`Academic Proficiency`
W = 0.94945, p-value = 0.0007636
Since p-value = 0.0007636 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.
Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 1 0.0236 0.8783
98
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
# A tibble: 2 × 11
Sex variable n min max median iqr mean sd se ci
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Female Academic Profic… 72 1.6 3.2 2.6 0.4 2.60 0.305 0.036 0.072
2 Male Academic Profic… 28 1.8 3.2 2.6 0.45 2.63 0.325 0.061 0.126
The mean of female and male is 2.597 and 2.629, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Academic Proficiency 100 0.225 1 0.635 Kruskal-Wallis
Based on the p-value, there is no significant difference on the physical health when grouped according to sex.
Shapiro-Wilk normality test
data: Data$`Social Interactions`
W = 0.9488, p-value = 0.0006918
Since p-value = 0.0006918 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.
Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 1 5.35 0.02281 *
98
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The p-value is less than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is not met.
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
# A tibble: 2 × 11
Sex variable n min max median iqr mean sd se ci
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Female Social Interact… 72 2 3.2 2.6 0.4 2.57 0.323 0.038 0.076
2 Male Social Interact… 28 1.2 3.8 2.6 0.6 2.54 0.547 0.103 0.212
The mean of female and male is 2.572 and 2.536, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Social Interactions 100 0.280 1 0.596 Kruskal-Wallis
Based on the p-value, there is no significant difference on the physical health when grouped according to sex.
Shapiro-Wilk normality test
data: Data$`Physical Health`
W = 0.92897, p-value = 4.352e-05
Since p-value = 4.352e-05 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.
Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 3 1.4341 0.2376
96
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
# A tibble: 4 × 11
`Daily Screen Time` variable n min max median iqr mean sd se
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1-2 hours Physical… 26 1.6 3.4 2.8 0.6 2.71 0.413 0.081
2 3-4 hours Physical… 24 2 3 2.8 0.4 2.78 0.272 0.056
3 5-6 hours Physical… 22 2 3.4 2.8 0.55 2.73 0.363 0.077
4 More Physical… 28 1.6 3.4 2.6 0.2 2.67 0.328 0.062
# ℹ 1 more variable: ci <dbl>
The mean of 1-2 hours, 3-4 hours, 5-6 hours, and more is 2.708, 2.775, 2.727, and 2.671, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Physical Health 100 2.00 3 0.571 Kruskal-Wallis
Based on the p-value, there is no significant difference was observed between the group pairs.
Shapiro-Wilk normality test
data: Data$`Mental Health`
W = 0.9454, p-value = 0.000418
Since p-value = 0.000418 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.
Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 3 0.7506 0.5246
96
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
# A tibble: 4 × 11
`Daily Screen Time` variable n min max median iqr mean sd se
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1-2 hours Mental H… 26 2 3.2 2.6 0.4 2.65 0.318 0.062
2 3-4 hours Mental H… 24 2.2 3 2.8 0.4 2.68 0.256 0.052
3 5-6 hours Mental H… 22 2 3.2 2.6 0.55 2.64 0.324 0.069
4 More Mental H… 28 2 3.2 2.6 0.45 2.59 0.331 0.063
# ℹ 1 more variable: ci <dbl>
The mean of 1-2 hours, 3-4 hours, 5-6 hours, and more is 2.654, 2.675, 2.636, and 2.586, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Mental Health 100 1.15 3 0.765 Kruskal-Wallis
Based on the p-value, there is no significant difference was observed between the group pairs.
Shapiro-Wilk normality test
data: Data$`Academic Proficiency`
W = 0.94945, p-value = 0.0007636
Since p-value = 0.0007636 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.
Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 3 0.5001 0.6831
96
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
# A tibble: 4 × 11
`Daily Screen Time` variable n min max median iqr mean sd se
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1-2 hours Academic… 26 2 3.2 2.6 0.35 2.67 0.315 0.062
2 3-4 hours Academic… 24 2 3.2 2.5 0.4 2.53 0.281 0.057
3 5-6 hours Academic… 22 2.2 3 2.8 0.2 2.7 0.26 0.055
4 More Academic… 28 1.6 3.2 2.6 0.4 2.54 0.344 0.065
# ℹ 1 more variable: ci <dbl>
The mean of 1-2 hours, 3-4 hours, 5-6 hours, and more is 2.669, 2.533, 2.700, and 2.536, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Academic Proficiency 100 6.75 3 0.0804 Kruskal-Wallis
Based on the p-value, there is no significant difference was observed between the group pairs.
Shapiro-Wilk normality test
data: Data$`Social Interactions`
W = 0.9488, p-value = 0.0006918
Since p-value = 0.0006918 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.
Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 3 1.7959 0.1531
96
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
# A tibble: 4 × 11
`Daily Screen Time` variable n min max median iqr mean sd se
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1-2 hours Social I… 26 2 3 2.6 0.6 2.53 0.325 0.064
2 3-4 hours Social I… 24 2.2 3 2.6 0.4 2.57 0.255 0.052
3 5-6 hours Social I… 22 2 3.8 2.4 0.75 2.56 0.46 0.098
4 More Social I… 28 1.2 3.8 2.6 0.4 2.59 0.505 0.095
# ℹ 1 more variable: ci <dbl>
The mean of 1-2 hours, 3-4 hours, 5-6 hours, and more is 2.531, 2.567, 2.564, and 2.586, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Social Interactions 100 0.766 3 0.858 Kruskal-Wallis
Based on the p-value, there is no significant difference was observed between the group pairs.
Shapiro-Wilk normality test
data: Data1$Scores
W = 0.95675, p-value = 1.956e-09
Since p-value = 1.956e-09 < 0.05, it is conclusive that we reject the null hypothesis. That is, we cannot assume normality.
Warning in leveneTest.default(y = y, group = group, ...): group coerced to
factor.
Levene's Test for Homogeneity of Variance (center = median)
Df F value Pr(>F)
group 3 1.2869 0.2785
395
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Warning: Removed 1 rows containing non-finite values (`stat_boxplot()`).
Warning: Removed 1 rows containing non-finite values (`stat_summary()`).
Warning: Removed 1 rows containing missing values (`geom_point()`).
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is not
a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
graphical parameter
# A tibble: 4 × 11
Variables variable n min max median iqr mean sd se ci
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Academic Prof… Scores 100 1.6 3.2 2.6 0.4 2.61 0.309 0.031 0.061
2 Physical Heal… Scores 100 1.6 3.4 2.8 0.4 2.72 0.345 0.034 0.068
3 Mental Health Scores 100 2 3.2 2.6 0.4 2.64 0.307 0.031 0.061
4 Social Intera… Scores 99 1.2 3.8 2.6 0.4 2.56 0.395 0.04 0.079
The mean of Academic Proficiency, Physical Health, Mental Health, and Social Interactions is 2.606, 2.718, 2.636, and 2.558, respectively.
Warning: Removed 1 rows containing non-finite values (`stat_boxplot()`).
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Scores 400 14.2 3 0.00264 Kruskal-Wallis
Based on the p-value, there is significant difference was observed between the group pairs.
# A tibble: 6 × 9
.y. group1 group2 n1 n2 statistic p p.adj p.adj.signif
* <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr>
1 Scores Academic Pro… Physi… 100 100 2.59 9.52e-3 0.0571 ns
2 Scores Academic Pro… Menta… 100 100 0.531 5.96e-1 1 ns
3 Scores Academic Pro… Socia… 100 99 -1.08 2.81e-1 1 ns
4 Scores Physical Hea… Menta… 100 100 -2.06 3.92e-2 0.235 ns
5 Scores Physical Hea… Socia… 100 99 -3.66 2.48e-4 0.00149 **
6 Scores Mental Health Socia… 100 99 -1.61 1.08e-1 0.648 ns
There is significant difference between academic proficiency and physical health, physical and mental health, and physical health and social interactions
Based on the provided output above, we can say that it is the physical health.