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 frequency in using Tiktok. It can be seen that there are 62 females and 38 males; 20 of whch are from ABM, 20 from GAS, 20 from STEM, and 40 from HUMSS. Moreover, 29 students who always use Tiktok, 62 said they sometimes use Tiktok, four said seldom, five said never.
Call:
lm(formula = `Social Skills` ~ `Emotional Stability` + `Mental Health`,
data = Data)
Coefficients:
(Intercept) `Emotional Stability` `Mental Health`
0.6631 0.3723 0.3545
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.479 and 2.655, 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 no significant difference between the behavior of the student in terms of social skills 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. This indicates that residuals have a normal distribution. However, these results does not give the exact interpretation when it come to the distribution of data. Thus, we have the following bases.
Shapiro-Wilk normality test
data: res_aov$residuals
W = 0.96976, p-value = 0.02117
The Shapiro-Wilk p-value = 0.02117 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 4.7416 0.03184 *
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.
Wilcoxon rank sum test
data: a and b
W = 1048, p-value = 0.3501
alternative hypothesis: true location shift is not equal to 0
Since the p-value is larger than 0.05, we fail to reject the null hypothesis, that is, there is no significant difference between the behavior in terms of social skills when grouped according to sex.
`summarise()` has grouped output by 'Sex'. You can override using the `.groups`
argument.
# A tibble: 18 × 3
# Groups: Sex [2]
Sex `Emotional Stability` count
<fct> <dbl> <int>
1 Female 2 2
2 Female 2.2 3
3 Female 2.4 6
4 Female 2.6 11
5 Female 2.8 15
6 Female 3 16
7 Female 3.2 6
8 Female 3.6 3
9 Male 1 1
10 Male 1.8 2
11 Male 2 2
12 Male 2.2 3
13 Male 2.4 6
14 Male 2.6 8
15 Male 2.8 8
16 Male 3 5
17 Male 3.4 1
18 Male 3.6 2
The mean for male and female is 2.589 and 2.800, 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.94796, p-value = 0.0006106
The Shapiro-Wilk p-value = 0.0006106 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 2.421 0.1229
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 = 833.5, p-value = 0.0131
alternative hypothesis: true location shift is not equal to 0
Since the p-value= 0.0131 is less than 0.05, we reject the null hypothesis. Hence, there is significant difference between the behavior of the students in terms of emotional stability 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 `Mental Health` count
<fct> <dbl> <int>
1 Female 1.8 2
2 Female 2 1
3 Female 2.2 10
4 Female 2.4 9
5 Female 2.6 9
6 Female 2.8 12
7 Female 3 10
8 Female 3.2 5
9 Female 3.4 1
10 Female 3.6 2
11 Female 3.8 1
12 Male 1 1
13 Male 1.4 2
14 Male 1.6 1
15 Male 1.8 2
16 Male 2 3
17 Male 2.4 11
18 Male 2.6 9
19 Male 2.8 5
20 Male 3 4
The mean for male and female is 2.389 and 2.687, respectively.
The above graph shows the plotting of data by sex, which contains two sexes – male and female.
The histogram resembles a bell curve as seen above, means that the residuals 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. This also indicates that residuals have great chances that they follow a normal distribution.
Shapiro-Wilk normality test
data: res_aov$residuals
W = 0.97991, p-value = 0.1308
The Shapiro-Wilk p-value = 0.1308 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.0205 0.8865
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 = -3.3317, df = 66.776, p-value = 0.00141
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.5124086 -0.1284516
sample estimates:
mean of x mean of y
2.366667 2.687097
Since the p-value= 0.00141 is less than 0.05, we reject the null hypothesis. Hence, there is a significant difference between the behavior of the students in terms of mental health when grouped according to their sex.
`summarise()` has grouped output by 'Frequency in using Tiktok'. You can
override using the `.groups` argument.
# A tibble: 28 × 3
# Groups: Frequency in using Tiktok [4]
`Frequency in using Tiktok` `Social Skills` count
<fct> <dbl> <int>
1 Always 1.8 1
2 Always 2 2
3 Always 2.4 5
4 Always 2.6 4
5 Always 2.8 6
6 Always 3 7
7 Always 3.2 1
8 Always 3.4 1
9 Always 3.6 1
10 Always 3.8 1
# ℹ 18 more rows
The mean for always, never, seldom, and sometimes is 2.759, 2.080, 2.550, and 2.552, respectively.
The above graph shows the plotting of data by Frequency in using Tiktok: Always, Sometimes, Seldom, and Never.
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 behavior of the student in terms of social skills when grouped according to their frequency in using Tiktok. However, this does not assure anyone that the difference is significant.
The histogram does not resemble a bell curve as seen above. Moreover, the points in the QQ-plots roughly follow the straight line, with the majority of them falling within the confidence bands. This indicates that residuals have normal distribution. However, these diagrams does not give us the exact answer to how data was distributed. Thus, we have the following results.
Shapiro-Wilk normality test
data: res_aov$residuals
W = 0.96079, p-value = 0.004582
The Shapiro-Wilk p-value = 0.004582 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 3 0.4991 0.6838
96
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
# A tibble: 4 × 11
Frequency in using Tikto…¹ variable n min max median iqr mean sd
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Always Social … 29 1.8 3.8 2.8 0.6 2.76 0.448
2 Sometimes Social … 62 1.4 3.4 2.6 0.7 2.55 0.446
3 Seldom Social … 4 2.2 3 2.5 0.35 2.55 0.342
4 Never Social … 5 1 3 2 0.4 2.08 0.729
# ℹ abbreviated name: ¹`Frequency in using Tiktok`
# ℹ 2 more variables: se <dbl>, ci <dbl>
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Social Skills 100 6.66 3 0.0837 Kruskal-Wallis
Based on the p-value, no significant difference was observed between the group pairs.
`summarise()` has grouped output by 'Frequency in using Tiktok'. You can
override using the `.groups` argument.
# A tibble: 25 × 3
# Groups: Frequency in using Tiktok [4]
`Frequency in using Tiktok` `Emotional Stability` count
<fct> <dbl> <int>
1 Always 2 1
2 Always 2.2 2
3 Always 2.6 4
4 Always 2.8 8
5 Always 3 10
6 Always 3.2 1
7 Always 3.4 1
8 Always 3.6 2
9 Never 1 1
10 Never 2 1
# ℹ 15 more rows
The mean for always, never, seldom, sometimes is 2.862, 2.000, 3.000, and 2.694, respectively.
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 behavior of the student in terms of emotional stability when grouped according to their frequency in using Tiktok. However, illustrations does only give overviews of the data. It does not guarantee the exact result.
The histogram does not resemble a bell curve as seen above. Moreover, the points in the QQ-plots roughly follow the straight line, with the majority of them falling within the confidence bands. However, we are assured that the data follows a normal distribution when both diagrams have the same output.
Shapiro-Wilk normality test
data: res_aov$residuals
W = 0.9679, p-value = 0.0153
The Shapiro-Wilk p-value = 0.0153 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 3 0.5636 0.6403
96
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
# A tibble: 4 × 11
Frequency in using Tikto…¹ variable n min max median iqr mean sd
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Always Emotion… 29 2 3.6 2.8 0.2 2.86 0.359
2 Sometimes Emotion… 62 1.8 3.6 2.7 0.55 2.69 0.363
3 Seldom Emotion… 4 2.4 3.6 3 0.6 3 0.516
4 Never Emotion… 5 1 2.4 2.2 0.4 2 0.583
# ℹ abbreviated name: ¹`Frequency in using Tiktok`
# ℹ 2 more variables: se <dbl>, ci <dbl>
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Emotional Stability 100 15.4 3 0.00148 Kruskal-Wallis
Based on the p-value, there is a significant difference between the group pairs.
`summarise()` has grouped output by 'Frequency in using Tiktok'. You can
override using the `.groups` argument.
# A tibble: 27 × 3
# Groups: Frequency in using Tiktok [4]
`Frequency in using Tiktok` `Mental Health` count
<fct> <dbl> <int>
1 Always 1.8 2
2 Always 2 1
3 Always 2.2 2
4 Always 2.4 4
5 Always 2.6 7
6 Always 2.8 6
7 Always 3 5
8 Always 3.2 1
9 Always 3.8 1
10 Never 1 1
# ℹ 17 more rows
The mean for always, never, seldom, sometimes is 2.641, 2.040, 2.800, 2.571, respectively.
The histogram does resemble a bell curve as seen above, means that the residuals 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.
Shapiro-Wilk normality test
data: res_aov$residuals
W = 0.97696, p-value = 0.07685
The Shapiro-Wilk p-value = 0.07685 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 3 0.655 0.5818
96
The p-value is greater than the 0.05 level of significance. Thus, the homogeneity assumption of the variance is met.
Df Sum Sq Mean Sq F value Pr(>F)
`Frequency in using Tiktok` 3 1.762 0.5874 2.847 0.0416 *
Residuals 96 19.810 0.2064
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Since p-value = 0.0416 < 0.05, we reject the null hypothesis, that is, the behavior of the students in terms of mental health differ when grouped according to frequency in using Tiktok.
Shapiro-Wilk normality test
data: Data1$`Scores in terms of the impact of watching Tiktok to the Students' Behavior`
W = 0.954, p-value = 4.211e-08
Since p-value = 4.211e-08 < 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.018 0.3626
297
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
Variables variable n min max median iqr mean sd se ci
<fct> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 Mental Health Scores … 100 1 3.8 2.6 0.4 2.57 0.467 0.047 0.093
2 Emotional Sta… Scores … 100 1 3.6 2.8 0.45 2.72 0.419 0.042 0.083
3 Social Skills Scores … 100 1 3.8 2.6 0.6 2.59 0.476 0.048 0.095
The mean of mental health, emotional stability, and social skills is 2.574, 2.720, and 2.588, respectively.
# A tibble: 1 × 6
.y. n statistic df p method
* <chr> <int> <dbl> <int> <dbl> <chr>
1 Scores in terms of the impact of watching… 300 6.58 2 0.0372 Krusk…
Based on the p-value, there is a significant difference 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 term… Menta… Emoti… 100 100 2.42 0.0155 0.0465 *
2 Scores in term… Menta… Socia… 100 100 0.473 0.636 1 ns
3 Scores in term… Emoti… Socia… 100 100 -1.95 0.0514 0.154 ns
There is a significant difference between mental health and emotional stability.
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
Based on the provided output above, it can be seen that watching Tiktok have the most significant impact to the students’ behavior in terms of emotional stability.