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 number of hours of sleep. It can be seen that there are 66 females and 34 males; 25 of which are from ABM, 20 from GAS, 35 from HUMSS, and 20 from STEM. Moreover, 12 students said that they only have 1-3 hours of sleep daily, 53 said 3-6 hours and 35 said 7-9 hours.
Call:
lm(formula = `Academic Performance` ~ `Cognitive Learning` +
`Physical Health`, data = Data)
Coefficients:
(Intercept) `Cognitive Learning` `Physical Health`
0.8154 0.4330 0.3000
From this, we may deduce that the data fail to satisfy the two assumptions – Linearity and Homogeneity of Variance.
`summarise()` has grouped output by 'Sex'. You can override using the `.groups`
argument.
Attaching package: 'rstatix'
The following object is masked from 'package:stats':
filter
The mean for male and female is 2.929 and 3.000, respectively.
The above graph shows the plotting of data by sex, which contains two sexes – male and female.
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ forcats 1.0.0 ✔ stringr 1.5.1
✔ lubridate 1.9.3 ✔ tibble 3.2.1
✔ purrr 1.0.2 ✔ tidyr 1.3.1
✔ readr 2.1.5
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ rstatix::filter() masks dplyr::filter(), stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Warning: The following aesthetics were dropped during statistical transformation: fill
ℹ This can happen when ggplot fails to infer the correct grouping structure in
the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
variable into a factor?
It clearly shows that there is a difference between the effects of sleep deprivation in terms of cognitive learning when grouped according to their sex.
Loading required package: carData
Attaching package: 'car'
The following object is masked from 'package:purrr':
some
The following object is masked from 'package:dplyr':
recode
The histogram does not resemble a bell curve as seen above, means that the residuals do not have a normal distribution. Moreover, the points in the QQ-plots roughly follow the straight line, with the majority of them falling within the confidence bands. However, this does not guarantee that residuals follow a normal distribution since when based on the diagram on the left, it is the exact opposite of it. Thus, it is more convenient to observe the two.
Shapiro-Wilk normality test
data: res_aov$residuals
W = 0.97535, p-value = 0.05746
The Shapiro-Wilk p-value = 0.05746 on the residuals is greater than the usual significance level of 0.05. Thus, we fail to reject the hypothesis that residuals have a normal distribution.
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.5303 0.4682
98
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Welch Two Sample t-test
data: a and b
t = -0.92487, df = 61.072, p-value = 0.3587
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.27110963 0.09963013
sample estimates:
mean of x mean of y
2.929412 3.015152
Since the p-value is larger than 0.05, we fail to reject the null hypothesis, that is, there is no significant difference on the effects of sleep deprivation to students’ academic performance in terms of cognitive learning when grouped according to sex.
`summarise()` has grouped output by 'Sex'. You can override using the `.groups`
argument.
# A tibble: 20 × 3
# Groups: Sex [2]
Sex `Physical Health` count
<fct> <dbl> <int>
1 Female 2.2 2
2 Female 2.4 1
3 Female 2.6 5
4 Female 2.8 13
5 Female 3 17
6 Female 3.2 10
7 Female 3.4 5
8 Female 3.6 7
9 Female 3.8 1
10 Female 4 5
11 Male 2.2 2
12 Male 2.4 1
13 Male 2.6 3
14 Male 2.8 6
15 Male 3 8
16 Male 3.2 3
17 Male 3.4 3
18 Male 3.6 5
19 Male 3.8 2
20 Male 4 1
The mean for male and female is 3.082 and 3.109, respectively.
The above graph shows the plotting of data by sex, which contains two sexes – male and female.
Warning: The following aesthetics were dropped during statistical transformation: fill
ℹ This can happen when ggplot fails to infer the correct grouping structure in
the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
variable into a factor?
The histogram does not resemble a bell curve as seen above, means that the residuals do not have a normal distribution. Moreover, the points in the QQ-plots roughly follow the straight line, with the majority of them falling within the confidence bands. However, this does not guarantee that residuals follow a normal distribution since when based on the diagram on the left, it is the exact opposite of it. Thus, it is more convenient to observe the two.
Shapiro-Wilk normality test
data: res_aov$residuals
W = 0.96093, p-value = 0.00469
The Shapiro-Wilk p-value = 0.00469 on the residuals is less than the usual significance level of 0.05. Thus, we reject the hypothesis that residuals have a normal distribution.
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.3665 0.5463
98
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Wilcoxon rank sum test with continuity correction
data: c and d
W = 1073, p-value = 0.721
alternative hypothesis: true location shift is not equal to 0
Since the p-value= 0.721 is greater than 0.05, we fail to reject the null hypothesis. Hence, there is no significant difference on the effects of sleep deprivation towards academic performance in terms of physical health when grouped according to their sex.
`summarise()` has grouped output by 'Sex'. You can override using the `.groups`
argument.
# A tibble: 20 × 3
# Groups: Sex [2]
Sex `Academic Performance` count
<fct> <dbl> <int>
1 Female 2 2
2 Female 2.2 2
3 Female 2.4 5
4 Female 2.6 2
5 Female 2.8 8
6 Female 3 20
7 Female 3.2 12
8 Female 3.4 4
9 Female 3.6 3
10 Female 3.8 6
11 Female 4 2
12 Male 2.2 3
13 Male 2.4 2
14 Male 2.6 5
15 Male 2.8 3
16 Male 3 6
17 Male 3.2 7
18 Male 3.4 3
19 Male 3.6 4
20 Male 4 1
The mean for male and female is 2.994 and 3.055, respectively.
The above graph shows the plotting of data by sex, which contains two sexes – male and female.
The histogram does not resemble a bell curve as seen above, means that the residuals do not have a normal distribution. Moreover, the points in the QQ-plots roughly follow the straight line, with the majority of them falling within the confidence bands. However, this does not guarantee that residuals follow a normal distribution since when based on the diagram on the left, it is the exact opposite of it. Thus, it is more convenient to observe the two.
Shapiro-Wilk normality test
data: res_aov$residuals
W = 0.97704, p-value = 0.07792
The Shapiro-Wilk p-value = 0.07792 on the residuals is greater than the usual significance level of 0.05. Thus, we fail to reject the hypothesis that residuals have a normal distribution.
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.2413 0.6244
98
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Welch Two Sample t-test
data: e and f
t = -0.6305, df = 67.317, p-value = 0.5305
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.2517117 0.1308561
sample estimates:
mean of x mean of y
2.994118 3.054545
Since the p-value= 0.5305 is greater than 0.05, we fail to reject the null hypothesis. Hence, there is no significant difference on the effects of sleep deprivation towards students’ academic performance when grouped according to their sex.
Shapiro-Wilk normality test
data: Data$`Cognitive Learning`
W = 0.9601, p-value = 0.004089
Since p-value = 0.004089 < 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 2 1.1729 0.3138
97
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: 3 × 11
`Number of Hours of Sleep` variable n min max median iqr mean sd
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1-3 hours Cogniti… 12 2.2 4 3 0.65 3.08 0.587
2 3-6 hours Cogniti… 53 2.2 4 3 0.6 2.94 0.377
3 7-9 hours Cogniti… 35 2 3.8 3 0.4 2.99 0.414
# ℹ 2 more variables: se <dbl>, ci <dbl>
The mean of 1-3 hours, 3-6 hours, and 7-9 hours is 3.083, 2.943, and 2.989, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Cognitive Learning 100 1.19 2 0.553 Kruskal-Wallis
Based on the p-value, there is no significant difference was observed between the group pairs.
Shapiro-Wilk normality test
data: Data$`Physical Health`
W = 0.95479, p-value = 0.001739
Since p-value = 0.001739 < 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 2 0.408 0.6661
97
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: 3 × 11
`Number of Hours of Sleep` variable n min max median iqr mean sd
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1-3 hours Physica… 12 2.6 3.6 3.2 0.65 3.15 0.383
2 3-6 hours Physica… 53 2.2 4 3 0.4 3.14 0.413
3 7-9 hours Physica… 35 2.2 4 3 0.4 3.03 0.473
# ℹ 2 more variables: se <dbl>, ci <dbl>
The mean of 1-3 hours, 3-6 hours, and 7-9 hours is 3.150, 3.136, and 3.029, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Physical Health 100 2.24 2 0.325 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 Performance`
W = 0.96642, p-value = 0.01185
Since p-value = 0.01185 < 0.05, it is conclusive that we should 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 2 1.6048 0.2062
97
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: 3 × 11
`Number of Hours of Sleep` variable n min max median iqr mean sd
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1-3 hours Academi… 12 2.2 4 3 0.85 3.02 0.606
2 3-6 hours Academi… 53 2 3.8 3 0.4 3.03 0.429
3 7-9 hours Academi… 35 2 4 3 0.4 3.04 0.447
# ℹ 2 more variables: se <dbl>, ci <dbl>
The mean of 1-3 hours, 3-6 hours, and 7-9 hours is 3.017, 3.034, and 3.040, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Academic Performance 100 0.0877 2 0.957 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 in terms of the effects of sleep deprivation`
W = 0.96561, p-value = 1.471e-06
Since p-value = 1.471e-06 < 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 2 0.4436 0.6421
297
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: 3 × 11
Variables variable n min max median iqr mean sd se ci
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Cognitive Lea… Scores … 100 2 4 3 0.45 2.98 0.417 0.042 0.083
2 Physical Heal… Scores … 100 2.2 4 3 0.6 3.1 0.431 0.043 0.085
3 Academic Perf… Scores … 100 2 4 3 0.4 3.03 0.454 0.045 0.09
The mean of cognitive learning, physical health, and academic performance is 2.976, 3.100, and 3.034, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Scores in terms of the effects of sleep de… 300 2.93 2 0.231 Krusk…
Based on the p-value, there is no significant difference was observed between the group pairs.
# A tibble: 3 × 9
.y. group1 group2 n1 n2 statistic p p.adj p.adj.signif
* <chr> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <chr>
1 Scores in terms… Cogni… Physi… 100 100 1.69 0.0903 0.271 ns
2 Scores in terms… Cogni… Acade… 100 100 1.06 0.288 0.864 ns
3 Scores in terms… Physi… Acade… 100 100 -0.631 0.528 1 ns
Pairwise, there is no significant difference.
Based on the provided output above, it can be seen that sleep deprivation have the most significant impact to physical health.