Dosen Pengampu : Prof. Dr. Suhartono, Mkom

Magister Informatika - UIN Maulana Malik Ibrahim Malang

Kasus POSITIF 19

Melakukan Analisa menggunakan Regresi Linear Berganda Covid 19 di DKI Jakarta pada bulan September 2021 dengan memandingkan data dari Google Mobility Index dan Data Riwayat/Penyebaran Covid 19 DKI Jakarta untuk kasus POSITIF Covid 19

Sumber Data :

2. Riwayat Covid 19 DKI Jakarta https://riwayat-file-covid-19-dki-jakarta-jakartagis.hub.arcgis.com/
library(readxl)
#baca data excel
mobindexjkt <- read_excel("mobindex_jkt.xlsx")
covidjkt <- read_excel("c19data_jkt.xlsx")

retail <- mobindexjkt$retail_and_recreation_percent_change_from_baseline
grocery <- mobindexjkt$grocery_and_pharmacy_percent_change_from_baseline
park <- mobindexjkt$parks_percent_change_from_baseline
station <- mobindexjkt$transit_stations_percent_change_from_baseline
workplace <- mobindexjkt$workplaces_percent_change_from_baseline
residental <- mobindexjkt$residential_percent_change_from_baseline

Positif <- covidjkt$Positif
Dirawat <- covidjkt$Dirawat
Sembuh <- covidjkt$Sembuh
Meninggal <- covidjkt$Meninggal
Isolasi_Mandiri <- covidjkt$SelfIsolation

#dataframe KASUS POSITIF
dataku1 <- data.frame(Positif, retail, grocery, park, station, workplace, residental)

library(ggplot2)
library(reshape2)
## Warning: package 'reshape2' was built under R version 4.1.3
dataku2 <- melt(data = dataku1, id.vars = "Positif")
ggplot(data = dataku2, aes(x = value, y = Positif, colour = variable))+
  geom_point() +
  geom_line() + 
  theme(legend.justification = "top") +
  labs(title = "Google Mobility Index dan Kasus Positif Covid 19", 
       subtitle = "Propinsi DKI Jakarta Indonesia SEPT 2021", 
       y = "Jumlah Kasus", x = "Mobility Index") +
  theme(axis.text.x = element_text(angle = -90))

Dari Gambar diatas terdapat bahwa data sebaran di tempat umum (park) atau Taman adalah faktor dominan penyebaran

library(gridExtra)
## Warning: package 'gridExtra' was built under R version 4.1.3
p1=ggplot(dataku1, aes(x = Positif, y = retail)) +
  geom_point() +
  stat_smooth()
p2=ggplot(data = dataku1, aes(x = Positif, y = grocery)) +
  geom_point() +
  stat_smooth()
p3=ggplot(data = dataku1, aes(x = Positif, y = park)) +
  geom_point() +
  stat_smooth()
p4=ggplot(data = dataku1, aes(x = Positif, y = station)) +
  geom_point() +
  stat_smooth()
p5=ggplot(data = dataku1, aes(x = Positif, y = workplace)) +
  geom_point() +
  stat_smooth()
p6=ggplot(data = dataku1, aes(x = Positif, y = residental)) +
  geom_point() +
  stat_smooth()

gridExtra::grid.arrange(p1,p2,p3,p4, p5, p6, ncol=2)
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

model <- lm(Positif ~ retail+grocery+park+station+workplace+residental)
summary(model)
## 
## Call:
## lm(formula = Positif ~ retail + grocery + park + station + workplace + 
##     residental)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1552.42  -399.60   -33.81   646.02  1192.06 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 879114.81    3089.35 284.563  < 2e-16 ***
## retail         771.83     156.99   4.917 5.74e-05 ***
## grocery       -466.08      74.17  -6.284 2.06e-06 ***
## park          -210.43      85.22  -2.469  0.02139 *  
## station        426.70     138.44   3.082  0.00526 ** 
## workplace      -64.36      71.57  -0.899  0.37781    
## residental    -136.46     289.40  -0.472  0.64169    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 815.3 on 23 degrees of freedom
## Multiple R-squared:  0.8597, Adjusted R-squared:  0.8231 
## F-statistic: 23.49 on 6 and 23 DF,  p-value: 9.935e-09

Digaram PLOT menunjukkan terjadinya angka positif bebentuk curva hampir 45 derajad pada retail, park dan station. Dari Analisa Linear Model R Square 80% Adjusted Squared 80% dan p value diatas 5 %, yang artinya tingkat errornya rendah. Dan untuk park/taman mempunyai nilai yang paling significant yaitu 0.02139

residu <- residuals(model)
qqnorm(residu)

Pada Diagram QQPLOT berbentuk curva naik 45 derajat artinya tingkat error untuk analisa ini rendah

Kasus ISOLASI MANDIRI

Melakukan Analisa menggunakan Regresi Linear Berganda Covid 19 di DKI Jakarta pada bulan September 2021 dengan memandingkan data dari Google Mobility Index dan Data Riwayat/Penyebaran Covid 19 DKI Jakarta untuk kasus ISOLASI MANDIRI Covid 19

dataku3 <- data.frame(Isolasi_Mandiri, retail, grocery, park, station, workplace, residental)

library(ggplot2)
library(reshape2)

dataku4 <- melt(data = dataku3, id.vars = "Isolasi_Mandiri")
ggplot(data = dataku4, aes(x = value, y = Isolasi_Mandiri, colour = variable))+
  geom_point() +
  geom_line() + 
  theme(legend.justification = "top") +
  labs(title = "Google Mobility Index dan Isolasi Mandiri Covid 19", 
       subtitle = "Propinsi DKI Jakarta Indonesia SEPT 2021", 
       y = "Jumlah Kasus", x = "Mobility Index") +
  theme(axis.text.x = element_text(angle = -90))

library(gridExtra)
p1=ggplot(dataku3, aes(x = Isolasi_Mandiri, y = retail)) +
  geom_point() +
  stat_smooth()
p2=ggplot(data = dataku3, aes(x = Isolasi_Mandiri, y = grocery)) +
  geom_point() +
  stat_smooth()
p3=ggplot(data = dataku3, aes(x = Isolasi_Mandiri, y = park)) +
  geom_point() +
  stat_smooth()
p4=ggplot(data = dataku3, aes(x = Isolasi_Mandiri, y = station)) +
  geom_point() +
  stat_smooth()
p5=ggplot(data = dataku3, aes(x = Isolasi_Mandiri, y = workplace)) +
  geom_point() +
  stat_smooth()
p6=ggplot(data = dataku3, aes(x = Isolasi_Mandiri, y = residental)) +
  geom_point() +
  stat_smooth()

gridExtra::grid.arrange(p1,p2,p3,p4, p5, p6, ncol=2)
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'

model2 <- lm(Isolasi_Mandiri ~ retail+grocery+park+station+workplace+residental)
summary(model)
## 
## Call:
## lm(formula = Positif ~ retail + grocery + park + station + workplace + 
##     residental)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1552.42  -399.60   -33.81   646.02  1192.06 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 879114.81    3089.35 284.563  < 2e-16 ***
## retail         771.83     156.99   4.917 5.74e-05 ***
## grocery       -466.08      74.17  -6.284 2.06e-06 ***
## park          -210.43      85.22  -2.469  0.02139 *  
## station        426.70     138.44   3.082  0.00526 ** 
## workplace      -64.36      71.57  -0.899  0.37781    
## residental    -136.46     289.40  -0.472  0.64169    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 815.3 on 23 degrees of freedom
## Multiple R-squared:  0.8597, Adjusted R-squared:  0.8231 
## F-statistic: 23.49 on 6 and 23 DF,  p-value: 9.935e-09
residu <- residuals(model2)
qqnorm(residu)