library(readxl)
Dataexam <- read_excel("D:/COLLEGE 4TH YEAR/1st SEMESTER/STAT 53 REGRESSION ANALYSIS/FINAL/Dataexam.xlsx")
New names:
• `` -> `...1`
• `` -> `...22`
• `` -> `...23`
• `DDP` -> `DDP...75`
• `DDP` -> `DDP...82`
Dataexam
library(dplyr)
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
I1 <- Dataexam%>%
group_by(`Devices primarily used by students for their online classes.`)%>%
summarise(count=n())%>%
mutate(Percentage =round((count/sum(count)*100),2))
I1
Based on the results above, there are 61 respondents who used Desktop or Laptop. While there are 126 and 3 groups of respondents who used Desktop/Laptop and Mobile Phone, and Desktop/Laptop, Mobile Phone and Tablet, respectively. Also, it can be seen that there are 105 of respondents who used mobile phone alone, but only 1 respondent who used mobile phone and tablet. Further, only 2 respondents who used tablet alone.
library(dplyr)
I2 <- Dataexam%>%
group_by(`Students primary means of access to internet connectivity.`)%>%
summarise(count=n())%>%
mutate(Percentage =round((count/sum(count)*100),2))
I2
Here, the results show the number of group of students who have an internet connection with their respective primary means of access to internet connectivity.
library(dplyr)
I3 <- Dataexam%>%
group_by(`Internet connectivity`)%>%
summarise(count=n())%>%
mutate(Percentage =round((count/sum(count)*100),2))
I3
As gleaned above, the results show that there are 298 students all in all have an internet connection regardless of what primary means of access to internet connectivity they are using.
library(dplyr)
I4 <- Dataexam%>%
group_by(`Year Level`)%>%
summarise(count=n())%>%
mutate(Percentage =round((count/sum(count)*100),2))
I4
There are 96 1st Year students, 97 2nd Year students, 61 3rd Year students, and 44 4th Year students.
library(dplyr)
I5 <- Dataexam%>%
group_by(Gender)%>%
summarise(count=n())%>%
mutate(Percentage =round((count/sum(count)*100),2))
I5
The students consist of 224 Females and 74 Males.
#Column J
mean(Dataexam$`Attitude of the learner towards FLS [1. I feel that using the flexible learning system (FLS) is a good idea.]`)
[1] 3.016779
#Column K
mean(Dataexam$`Attitude of the learner towards FLS [2. I feel that it is desirable to use the FLS.]`)
[1] 2.855705
#Column L
mean(Dataexam$`Attitude of the learner towards FLS [3. I feel that the FLS makes learning easier.]`)
[1] 2.483221
#Column M
mean(Dataexam$`Attitude of the learner towards FLS [4. I have a generally favorable attitude toward the FLS.]`)
[1] 2.765101
#Column N
mean(Dataexam$`Attitude of the learner towards FLS [5. I feel that I can learn actively in the FLS setup.]`)
[1] 2.402685
#Column O
mean(Dataexam$LDAttitude)
[1] 2.704698
library(ggplot2)
ggplot(Dataexam, aes(x = LDAttitude, y = GWA)) +
geom_point() +
labs(y = "General Weighted Average", x = "Learners' Dimension Attitude of the learner towards FLS") +
theme_minimal()
model1 <- lm(GWA ~ LDAttitude, data = Dataexam)
model1
Call:
lm(formula = GWA ~ LDAttitude, data = Dataexam)
Coefficients:
(Intercept) LDAttitude
1.66034 -0.02908
summary(model1)
Call:
lm(formula = GWA ~ LDAttitude, data = Dataexam)
Residuals:
Min 1Q Median 3Q Max
-0.41418 -0.16639 -0.03046 0.12689 1.11874
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.66034 0.04386 37.856 <2e-16 ***
LDAttitude -0.02908 0.01548 -1.878 0.0614 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2249 on 296 degrees of freedom
Multiple R-squared: 0.01177, Adjusted R-squared: 0.008435
F-statistic: 3.527 on 1 and 296 DF, p-value: 0.06137
It can be seen that the coefficient of LDAttitude indicates that there is a negative relationship between General Weighted Average and Learners’ Dimension Attitude of the learner towards FLS. Also, -0.02908 means that for an increase of one unit in the Learners’ Dimension Attitude of the learner towards FLS, the number of General Weighted Average decreases, on average, by 0.02908 units. Furthermore, since p-value = 0.06137, that is, greater than 0.05 level of significance, we say that we fail to reject the null hypothesis, and there is no significant relationship between General Weighted Average and Learners’ Dimension Attitude of the learner towards FLS.
library(performance)
check_model(model1)
library(visreg)
visreg(model1)
#Column P
mean(Dataexam$`Mental Health [1. I often feel nervous, anxious, or on edge during the flexible learning system (FLS).]`)
[1] 1.942953
#Column Q
mean(Dataexam$`Mental Health [2. I often feel not being able to stop or control worrying during the FLS.]`)
[1] 1.979866
#Column R
mean(Dataexam$`Mental Health [3. I often feel so restless that it’s hard to sit still during the FLS.]`)
[1] 2.020134
#Column X
mean(Dataexam$`Mental Health [4. I often feel active and in good spirits during the FLS.]`)
[1] 2.828859
#Column Y
mean(Dataexam$`Mental Health [5. My daily life has been filled with things that interest me during the FLS.]`)
[1] 2.805369
library(ggplot2)
ggplot(Dataexam, aes(x = LDMental, y = GWA)) +
geom_point() +
labs(y = "General Weighted Average", x = "Learners' Dimension Mental Health") +
theme_minimal()
model2 <- lm(GWA ~ LDMental, data = Dataexam)
model2
Call:
lm(formula = GWA ~ LDMental, data = Dataexam)
Coefficients:
(Intercept) LDMental
1.51719 0.01823
summary(model2)
Call:
lm(formula = GWA ~ LDMental, data = Dataexam)
Residuals:
Min 1Q Median 3Q Max
-0.39376 -0.16239 -0.03346 0.13131 1.16718
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.51719 0.07384 20.548 <2e-16 ***
LDMental 0.01823 0.02054 0.888 0.375
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2259 on 296 degrees of freedom
Multiple R-squared: 0.002655, Adjusted R-squared: -0.0007148
F-statistic: 0.7879 on 1 and 296 DF, p-value: 0.3755
It can be seen that the coefficient of LDMental indicates that there is a positive relationship between General Weighted Average and Learners’ Dimension Mental Health. Also, 0.01823 means that for an increase of one unit in the Learners’ Dimension Mental Health, the number of General Weighted Average increases, on average, by 0.01823 units. Furthermore, since p-value = 0.3755, that is, greater than 0.05 level of significance, we say that we fail to reject the null hypothesis, and there is no significant relationship between General Weighted Average and Learners’ Dimension Mental Health.
library(performance)
check_model(model2)
library(visreg)
visreg(model2)
Dependent Variable: Column “DV”
Independent Variables: Column “AM”, Column “BB”, Column “BQ”, and Column
“CF”
library(performance)
multiple <- lm(GWA ~ LD + ID + CD + DD, data = Dataexam)
multiple
Call:
lm(formula = GWA ~ LD + ID + CD + DD, data = Dataexam)
Coefficients:
(Intercept) LD ID CD DD
1.708347 -0.032404 -0.007099 0.030347 -0.030337
check_model(multiple)
summary(multiple)
Call:
lm(formula = GWA ~ LD + ID + CD + DD, data = Dataexam)
Residuals:
Min 1Q Median 3Q Max
-0.41212 -0.16709 -0.04072 0.12679 1.14108
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.708347 0.091216 18.729 <2e-16 ***
LD -0.032404 0.033657 -0.963 0.336
ID -0.007099 0.023529 -0.302 0.763
CD 0.030347 0.034165 0.888 0.375
DD -0.030337 0.035991 -0.843 0.400
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2263 on 293 degrees of freedom
Multiple R-squared: 0.009546, Adjusted R-squared: -0.003975
F-statistic: 0.706 on 4 and 293 DF, p-value: 0.5884
As gleaned above, the results show that the independent variable LD
significantly predicts the dependent variable GWA with p-value results
of 0.336 and has the coefficient with the largest absolute value of
0.032404.
Independent Variables:
Column “AM” = LD
Column “BB” = ID
Column “BQ” = CD
Column “CF” = DD
As you can see, the results show that the p-value = 0.5884, that is, greater than 0.05 level of significance. With this, we do not have enough evidence to reject the null hypothesis, and so the model is not better than a model having the intercept alone, since at least one coefficient is not significantly different from 0.