Lampiran R Studio
Lampiran R Studio
Lampiran R Studio
> summary(penelitian)
Y Perbandingan Laki2 Total Komorbid Kepadatan Penduduk
Min. : 4.00 Min. :0.9899 Min. : 213.0 Min. : 30.0
1st Qu.: 17.00 1st Qu.:1.0028 1st Qu.: 397.0 1st Qu.: 118.0
Median : 43.00 Median :1.0263 Median : 598.0 Median : 278.0
Mean : 70.21 Mean :1.0237 Mean : 696.6 Mean : 487.1
3rd Qu.: 71.00 3rd Qu.:1.0372 3rd Qu.: 864.5 3rd Qu.: 401.0
Max. :395.00 Max. :1.0756 Max. :1890.0 Max. :2823.0
Frekuensi Data
> Hmisc::describe(penelitian$Y)
penelitian$Y
n missing distinct Info Mean Gmd .05 .10 .25
19 0 18 0.999 70.21 82.56 11.2 12.8 17.0
.50 .75 .90 .95
43.0 71.0 145.8 227.6
Value 4 12 13 14 17 20 24 35 43 46 63 64
Frequency 1 1 1 1 2 1 1 1 1 1 1 1
Proportion 0.053 0.053 0.053 0.053 0.105 0.053 0.053 0.053 0.053 0.053 0.053 0.053
lowest : 213 322 351 365 378, highest: 870 887 930 1546 1890
Value 213 322 351 365 378 416 443 482 524 598 632 689
Frequency 1 1 1 1 1 1 1 1 1 1 1 1
Proportion 0.053 0.053 0.053 0.053 0.053 0.053 0.053 0.053 0.053 0.053 0.053 0.053
Value 30 87 90 103 104 132 188 276 278 281 318 334
Frequency 1 1 1 1 1 2 1 1 1 1 1 1
Proportion 0.053 0.053 0.053 0.053 0.053 0.105 0.053 0.053 0.053 0.053 0.053 0.053
Value 4 7 8 10 12 13 14 19 28 29 38 47
Frequency 1 1 1 1 1 1 1 1 1 1 1 1
Proportion 0.053 0.053 0.053 0.053 0.053 0.053 0.053 0.053 0.053 0.053 0.053 0.053
Histogram
hist(penelitian$Y)
hist(penelitian$`Perbandingan Laki2`)
hist(penelitian$`Total Komorbid`)
hist(penelitian$`Kepadatan Penduduk`)
> library(readxl)
> View(covidgto)
> View(covidgto)
> covidgto=data.frame(covidgto)
> y=covidgto$Y
> x1=covidgto$x1
> regresi=lm (y~x1)
> regresi
Call:
lm(formula = y ~ x1)
Coefficients:
(Intercept) x1
2174 -2055
> summary(regresi)
Call:
lm(formula = y ~ x1)
Residuals:
Min 1Q Median 3Q Max
-77.51 -50.40 -19.55 17.89 255.36
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2174.4 738.1 2.946 0.00903 **
x1 -2055.5 720.8 -2.852 0.01103 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Call:
lm(formula = y ~ x2)
Coefficients:
(Intercept) x2
278.2 -2289.2
Call:
lm(formula = y ~ x2)
Residuals:
Min 1Q Median 3Q Max
-93.654 -41.875 -33.462 2.043 315.847
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 278.2 239.1 1.163 0.261
x2 -2289.2 2621.3 -0.873 0.395
Call:
lm(formula = y ~ x3)
Coefficients:
(Intercept) x3
61.03539 0.01884
Call:
lm(formula = y ~ x3)
Residuals:
Min 1Q Median 3Q Max
-58.99 -47.75 -33.14 -4.29 324.89
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 61.03539 26.56344 2.298 0.0345 *
x3 0.01884 0.03135 0.601 0.5559
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 94.74 on 17 degrees of freedom
Multiple R-squared: 0.02079, Adjusted R-squared: -0.03681
F-statistic: 0.361 on 1 and 17 DF, p-value: 0.5559
> regresi4=lm (y~x4)
> regresi4
Call:
lm(formula = y ~ x4)
Coefficients:
(Intercept) x4
-22.8267 0.1336
> summary (regresi4)
Call:
lm(formula = y ~ x4)
Residuals:
Min 1Q Median 3Q Max
-165.607 -19.429 -7.373 11.685 211.338
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -22.82669 34.08323 -0.670 0.51202
x4 0.13356 0.04207 3.175 0.00554 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Call:
lm(formula = y ~ x5)
Coefficients:
(Intercept) x5
-6.342 1.569
> summary(regresi5)
Call:
lm(formula = y ~ x5)
Residuals:
Min 1Q Median 3Q Max
-41.979 -5.342 3.840 5.220 32.620
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -6.3416 4.5097 -1.406 0.178
x5 1.5690 0.0601 26.108 3.7e-15 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 14.94 on 17 degrees of freedom
Multiple R-squared: 0.9757, Adjusted R-squared: 0.9742
F-statistic: 681.6 on 1 and 17 DF, p-value: 0,03698
Regresi (Simultan)
> x=covidgto$x1+covidgto$x2+covidgto$x3+covidgto$x4+covidgto$x5
> regresi=lm (y~x)
> regresi
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
7.1803 0.0511
> summary(regresi)
Call:
lm(formula = y ~ x)
Residuals:
Min 1Q Median 3Q Max
-109.274 -30.781 -16.961 5.552 272.137
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.18027 33.92827 0.212 0.8349
x 0.05110 0.02264 2.257 0.0375 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
data: regresi
DW = 1.0155, p-value = 0.00635
alternative hypothesis: true autocorrelation is greater than 0
Breusch-Pagan test
data: regresi
BP = 11.873, df = 1, p-value = 0.0005694
Call:
lm(formula = y ~ x1 + x2 + x3 + x4 + x5)
Coefficients:
(Intercept) x1 x2 x3 x4 x5
-2.919e+02 2.628e+02 8.059e+01 2.795e-03 9.549e-03 1.595e+00
Call:
lm(formula = y ~ x1 + x2 + x3 + x4 + x5)
Residuals:
Min 1Q Median 3Q Max
-40.871 -6.663 0.151 6.260 28.930
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.919e+02 2.545e+02 -1.147 0.272
x1 2.628e+02 2.195e+02 1.197 0.253
x2 8.059e+01 5.576e+02 0.145 0.887
x3 2.795e-03 6.673e-03 0.419 0.682
x4 9.549e-03 1.200e-02 0.796 0.441
x5 1.595e+00 9.252e-02 17.236 2.46e-10 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1