The report aimed initially to investigate the inter-relationship between mortality rate with ICU and Ventilation cases. The interactions between these variables were explored graphically and numerically through RStudio using Australia’s Covid-19 data. It then investigated differences within the patterns of confirmed cases on a monthly scale, in order to extrapolate upon if their subsequent relationship affected mortality rates. Similarly, the second research question was explored graphically and numerically through RStudio using Australia’s Covid-19 data. The data itself was aggregated from covid19data.com.au, which subsequently has been verified with federal, state and territory health departments. Within the data set there are 13 variables present, consisting of 11 quantitative discrete variables and 2 qualitative ordinal variables. The first research question would be analysed using multiple linear regression models, where concluding statements will be based upon qualitative interpretations of the correlation between the variables within the models. The second research question required the use of histograms and boxplots to compare the number of confirmed cases on a monthly basis. Linear regression models would then be used to detect if the patterns of confirmed cases on mortality rate was statistically significant.
COVID_during_20200125_20210418 <- read.csv("COVID_during_20200125_20210418.csv")
# Quick look at top 6 rows of data1
head(COVID_during_20200125_20210418)
## date confirmed deaths tests positives recovered hosp icu vent vaccines
## 1 2020/1/25 4 0 0 0 0 0 0 0 0
## 2 2020/1/26 4 0 0 0 0 0 0 0 0
## 3 2020/1/27 5 0 0 0 0 0 0 0 0
## 4 2020/1/28 5 0 0 0 0 0 0 0 0
## 5 2020/1/29 9 0 0 0 0 0 0 0 0
## 6 2020/1/30 9 0 0 0 0 0 0 0 0
## Size of data1
dim(COVID_during_20200125_20210418)
## [1] 450 10
## R's classification of data1
class(COVID_during_20200125_20210418)
## [1] "data.frame"
## R's classification of variables for data1
str(COVID_during_20200125_20210418)
## 'data.frame': 450 obs. of 10 variables:
## $ date : chr "2020/1/25" "2020/1/26" "2020/1/27" "2020/1/28" ...
## $ confirmed: int 4 4 5 5 9 9 9 10 12 12 ...
## $ deaths : int 0 0 0 0 0 0 0 0 0 0 ...
## $ tests : int 0 0 0 0 0 0 0 0 0 0 ...
## $ positives: int 0 0 0 0 0 0 0 0 0 0 ...
## $ recovered: int 0 0 0 0 0 0 0 0 0 0 ...
## $ hosp : num 0 0 0 0 0 0 0 0 0 0 ...
## $ icu : int 0 0 0 0 0 0 0 0 0 0 ...
## $ vent : int 0 0 0 0 0 0 0 0 0 0 ...
## $ vaccines : int 0 0 0 0 0 0 0 0 0 0 ...
The data contained 10 variables which all displayed the related data of COVID-19 in Australia. However, the variable of the total population in Australia is less related in this data set. Therefore, we changed to 9 variables to be used in Rstudio. These variables included confirmed cases, deaths, tests, positive cases, hospitalization, people who lived in ICU and used ventilation to breathe. The raw data began from 2020-01-25 to 2020-08-13. The data would be extremely complex if input all the data given in the source. Additionally, it’s accumulated for confirmed cases. The correlation will in ascending order only if the confirmed cases are accumulated. Thus, we clean the data set in to daily. Besides, we changed the variables from qualitative to quantitative. In other words, we changed the data into ordinal vector. This method would clarify graphs shown with these data. The main challenge was to clean the data, to code easier in Rstudio.
9 variables used in this project were divided into two sets of data. One set is classified as cumulative qualitative cases, whereas another set is for daily quantitative cases. Date is an ordinal continuous variable, it could be recorded as both qualitative and quantitative. It reports the order of the day and reveals the period length. However, it is optimal to record it as quantitative data, as one may be willing to give a date category. On the other side, the other 8 variables, such as confirmed cases, tested positives cases, recovered cases, ICU cases, deaths, hospitalized cases, and vaccines are categorised as numerical discrete, quantitative variables. Only whole integers are involved in these data sets , as the number of testings cannot have decimals. To summarize and obtain results, mean and median were used for calculation.
Our data has originated from statistics provided by Australian governments at federal, state and territory levels, aggregated from www.covid19data.com.au, with data from 25/1/20 - 18/4/21 being utilized for this project. The data was voluntarily collated by Bolton (2021) with collaborators to provide statistics of COVID-19 in Australia summarized as a whole. We noticed that the data was not directly retrieved from the official platform, thus we have checked the accuracy by sampling survey on several random days and confirmed the collated data is accurate and authentic. However, there are still some limitations within the data. Firstly, the data was collected by summing the statistics from each state and territories from Australia, so there may be an error value in the final data statistic because of the different statistical criteria in each district. Moreover, after analysing the data of ICU and ventilator, it shows that the ventilator was not adequate for each ICU patient, which will be explored in more detail within research question 2.
Coronavirus disease 19 (Covid-19) was first identified during December 2019 in Wuhan China and was formally declared a global pandemic by the World Health Organisation (WHO) on March 11,2020. Covid-19’s impact has not only effected public health, as its drastic influence has reached many other sectors of the economy, resulting in global turmoil. This is elucidated by its pathology, where it is transmitted through physical contact and airborne mechanisms. Hence, Covid-19 is depicted as highly contagious and hard to detect, augmenting its prevalence in society. Universally, the symptoms of covid-19 included cough, sore throat, fatigue, runny nose, and fever, where most individuals who contracted the virus recovered without severe medical intervention. However, it was estimated that 20% of global cases resulted in severe medical implication, leading to shortness of breath and pneumonia. These cases were most prominent in immunocompromised individuals, requiring the need for hospitalization, ICUs, and ventilators. The increased demand for medical interventions and equipment resulted in a shortage of supplies, adversely influencing its incidence of mortality in many countries. Fortunately, Australia imposed strict health and border policies throughout the earlier stages of Covid-19, effectively mitigating the transmission rate. This resulted in reduced cases, mortality, and hospitalisation for Covid-19, relative to other nations. Hence, exploring the corresponding results induced by the mechanisms underpinning Australia’s success to Covid-19, serves as an exemplar response model for other nations, and should be further investigated.
COVID_during_20200125_20210418 <- read.csv("COVID_during_20200125_20210418.csv")
COVID_during_20200125_20210418 <- read.csv("COVID_during_20200125_20210418.csv")
View(COVID_during_20200125_20210418)
COVID_during_20200125_20210418[c(1:450),c(2,3)]
## confirmed deaths
## 1 4 0
## 2 4 0
## 3 5 0
## 4 5 0
## 5 9 0
## 6 9 0
## 7 9 0
## 8 10 0
## 9 12 0
## 10 12 0
## 11 13 0
## 12 14 0
## 13 15 0
## 14 15 0
## 15 15 0
## 16 15 0
## 17 15 0
## 18 15 0
## 19 15 0
## 20 15 0
## 21 15 0
## 22 15 0
## 23 15 0
## 24 15 0
## 25 15 0
## 26 15 0
## 27 15 0
## 28 19 0
## 29 20 0
## 30 20 0
## 31 20 0
## 32 20 0
## 33 20 0
## 34 23 0
## 35 25 0
## 36 25 0
## 37 28 1
## 38 32 1
## 39 40 1
## 40 51 2
## 41 59 2
## 42 63 2
## 43 73 2
## 44 80 3
## 45 92 3
## 46 112 3
## 47 127 3
## 48 157 3
## 49 198 4
## 50 249 4
## 51 297 6
## 52 376 6
## 53 454 6
## 54 567 7
## 55 709 7
## 56 847 8
## 57 1072 8
## 58 1352 8
## 59 1680 8
## 60 2050 9
## 61 2430 10
## 62 2809 14
## 63 3180 14
## 64 3640 15
## 65 3984 17
## 66 4250 19
## 67 4561 20
## 68 4864 21
## 69 5137 25
## 70 5362 29
## 71 5552 31
## 72 5693 36
## 73 5799 41
## 74 5918 49
## 75 6023 51
## 76 6108 52
## 77 6214 55
## 78 6302 57
## 79 6324 60
## 80 6365 62
## 81 6414 63
## 82 6637 64
## 83 6667 64
## 84 6714 66
## 85 6756 69
## 86 6800 71
## 87 6813 72
## 88 6835 72
## 89 6842 75
## 90 6850 76
## 91 6867 79
## 92 6885 81
## 93 6904 84
## 94 6911 84
## 95 6923 85
## 96 6936 90
## 97 6944 92
## 98 6957 94
## 99 6972 94
## 100 6990 96
## 101 7014 96
## 102 7040 98
## 103 7064 98
## 104 7086 98
## 105 7104 98
## 106 7118 98
## 107 7130 98
## 108 7137 98
## 109 7157 98
## 110 7168 99
## 111 7183 99
## 112 7214 99
## 113 7231 99
## 114 7239 99
## 115 7248 100
## 116 7256 100
## 117 7267 101
## 118 7269 101
## 119 7283 102
## 120 7296 103
## 121 7299 103
## 122 7303 103
## 123 7318 103
## 124 7324 103
## 125 7342 103
## 126 7358 103
## 127 7369 103
## 128 7379 103
## 129 7387 103
## 130 7404 103
## 131 7412 103
## 132 7423 103
## 133 7434 103
## 134 7436 103
## 135 7440 103
## 136 7446 103
## 137 7448 103
## 138 7455 103
## 139 7464 103
## 140 7468 103
## 141 7481 103
## 142 7499 103
## 143 7514 103
## 144 7526 103
## 145 7549 103
## 146 7570 103
## 147 7588 103
## 148 7614 103
## 149 7639 103
## 150 7652 103
## 151 7670 103
## 152 7699 104
## 153 7735 104
## 154 7772 104
## 155 7818 104
## 156 7863 104
## 157 7944 104
## 158 8011 104
## 159 8097 104
## 160 8178 104
## 161 8243 104
## 162 8349 104
## 163 8436 104
## 164 8573 106
## 165 8742 106
## 166 8872 106
## 167 9045 106
## 168 9345 106
## 169 9537 107
## 170 9781 108
## 171 9964 108
## 172 10235 110
## 173 10479 111
## 174 10794 113
## 175 11219 116
## 176 11423 119
## 177 11784 122
## 178 12052 123
## 179 12410 126
## 180 12878 128
## 181 13285 133
## 182 13574 140
## 183 13927 145
## 184 14380 155
## 185 14912 161
## 186 15281 167
## 187 15560 176
## 188 16277 189
## 189 16880 197
## 190 17254 201
## 191 17895 208
## 192 18290 221
## 193 18702 232
## 194 19416 247
## 195 19863 255
## 196 20273 266
## 197 20698 278
## 198 21084 294
## 199 21397 312
## 200 21714 331
## 201 22127 352
## 202 22358 361
## 203 22742 375
## 204 23035 379
## 205 23288 396
## 206 23559 421
## 207 23773 438
## 208 23993 450
## 209 24236 463
## 210 24407 472
## 211 24602 485
## 212 24812 502
## 213 24916 517
## 214 25053 525
## 215 25205 549
## 216 25322 571
## 217 25448 582
## 218 25547 600
## 219 25670 611
## 220 25746 652
## 221 25819 657
## 222 25923 663
## 223 26049 678
## 224 26136 737
## 225 26207 748
## 226 26279 753
## 227 26322 762
## 228 26374 770
## 229 26465 781
## 230 26513 788
## 231 26565 797
## 232 26606 803
## 233 26650 809
## 234 26691 816
## 235 26737 816
## 236 26779 824
## 237 26813 832
## 238 26861 837
## 239 26885 843
## 240 26898 849
## 241 26912 851
## 242 26942 854
## 243 26974 859
## 244 26983 861
## 245 27000 869
## 246 27016 870
## 247 27040 872
## 248 27044 875
## 249 27063 882
## 250 27078 886
## 251 27096 888
## 252 27113 890
## 253 27121 893
## 254 27136 894
## 255 27149 894
## 256 27174 895
## 257 27182 897
## 258 27206 897
## 259 27229 897
## 260 27244 897
## 261 27264 898
## 262 27286 898
## 263 27316 899
## 264 27341 904
## 265 27362 904
## 266 27371 904
## 267 27383 904
## 268 27391 904
## 269 27399 905
## 270 27430 905
## 271 27444 905
## 272 27466 905
## 273 27484 905
## 274 27499 905
## 275 27520 905
## 276 27527 905
## 277 27541 905
## 278 27555 907
## 279 27570 907
## 280 27582 907
## 281 27590 907
## 282 27595 907
## 283 27602 907
## 284 27610 907
## 285 27622 907
## 286 27634 907
## 287 27645 907
## 288 27652 907
## 289 27658 907
## 290 27668 907
## 291 27677 907
## 292 27685 907
## 293 27698 907
## 294 27703 907
## 295 27711 907
## 296 27728 907
## 297 27750 907
## 298 27760 907
## 299 27777 907
## 300 27784 907
## 301 27792 907
## 302 27806 907
## 303 27821 907
## 304 27835 907
## 305 27848 907
## 306 27856 907
## 307 27864 907
## 308 27874 907
## 309 27885 907
## 310 27892 907
## 311 27903 908
## 312 27912 908
## 313 27923 908
## 314 27940 908
## 315 27949 908
## 316 27956 908
## 317 27965 908
## 318 27972 908
## 319 27987 908
## 320 27993 908
## 321 28001 908
## 322 28012 908
## 323 28025 908
## 324 28030 908
## 325 28039 908
## 326 28047 908
## 327 28059 908
## 328 28072 908
## 329 28093 908
## 330 28128 908
## 331 28172 908
## 332 28198 908
## 333 28219 908
## 334 28237 908
## 335 28262 908
## 336 28276 908
## 337 28296 908
## 338 28312 908
## 339 28337 909
## 340 28350 909
## 341 28381 909
## 342 28407 909
## 343 28427 909
## 344 28470 909
## 345 28483 909
## 346 28505 909
## 347 28523 909
## 348 28536 909
## 349 28546 909
## 350 28571 909
## 351 28582 909
## 352 28595 909
## 353 28614 909
## 354 28634 909
## 355 28650 909
## 356 28658 909
## 357 28669 909
## 358 28689 909
## 359 28708 909
## 360 28721 909
## 361 28731 909
## 362 28740 909
## 363 28749 909
## 364 28755 909
## 365 28761 909
## 366 28766 909
## 367 28777 909
## 368 28780 909
## 369 28787 909
## 370 28794 909
## 371 28800 909
## 372 28806 909
## 373 28812 909
## 374 28818 909
## 375 28824 909
## 376 28829 909
## 377 28838 909
## 378 28842 909
## 379 28848 909
## 380 28850 909
## 381 28857 909
## 382 28860 909
## 383 28871 909
## 384 28879 909
## 385 28887 909
## 386 28892 909
## 387 28898 909
## 388 28900 909
## 389 28905 909
## 390 28911 909
## 391 28912 909
## 392 28918 909
## 393 28920 909
## 394 28926 909
## 395 28930 909
## 396 28937 909
## 397 28939 909
## 398 28947 909
## 399 28958 909
## 400 28965 909
## 401 28970 909
## 402 28978 909
## 403 28986 909
## 404 28996 909
## 405 29007 909
## 406 29020 909
## 407 29030 909
## 408 29037 909
## 409 29046 909
## 410 29061 909
## 411 29075 909
## 412 29090 909
## 413 29102 909
## 414 29112 909
## 415 29117 909
## 416 29130 909
## 417 29137 909
## 418 29153 909
## 419 29166 909
## 420 29183 909
## 421 29192 909
## 422 29196 909
## 423 29206 909
## 424 29211 909
## 425 29220 909
## 426 29228 909
## 427 29240 909
## 428 29253 909
## 429 29260 909
## 430 29278 909
## 431 29296 909
## 432 29305 909
## 433 29323 909
## 434 29335 909
## 435 29341 909
## 436 29348 909
## 437 29357 909
## 438 29365 909
## 439 29379 909
## 440 29385 909
## 441 29390 909
## 442 29396 909
## 443 29405 909
## 444 29419 909
## 445 29437 910
## 446 29450 910
## 447 29469 910
## 448 29484 910
## 449 29505 910
## 450 29519 910
data=COVID_during_20200125_20210418[c(1:450),c(2,3)]
data [] <- lapply(data, function(x) diff(c(0, x)))
confirmed=data$confirmed
deaths=data$deaths
plot(confirmed, deaths, main="Scatterplot")
pop.1 <- lm(deaths ~ confirmed)
abline(pop.1, col=2, lwd=3)
hist(residuals(pop.1))
plot(pop.1)
cor(confirmed, deaths)
## [1] 0.4437132
shapiro.test(residuals(pop.1))
##
## Shapiro-Wilk normality test
##
## data: residuals(pop.1)
## W = 0.4958, p-value < 2.2e-16
confint(pop.1, level=0.99)
## 0.5 % 99.5 %
## (Intercept) 0.11280890 1.41392011
## confirmed 0.01445352 0.02392759
The first research question investigated differences within the patterns of confirmed cases on a monthly scale, evaluating if the relationship of their subsequent difference on mortality rates was statistically relevant
data2=read.csv("covid.txt")
options(max.print=1000000)
data2[c(1:450),c(2,8:9)]
## confirmed icu vent
## 1 4 0 0
## 2 4 0 0
## 3 5 0 0
## 4 5 0 0
## 5 9 0 0
## 6 9 0 0
## 7 9 0 0
## 8 10 0 0
## 9 12 0 0
## 10 12 0 0
## 11 13 0 0
## 12 14 0 0
## 13 15 0 0
## 14 15 0 0
## 15 15 0 0
## 16 15 0 0
## 17 15 0 0
## 18 15 0 0
## 19 15 0 0
## 20 15 0 0
## 21 15 0 0
## 22 15 0 0
## 23 15 0 0
## 24 15 0 0
## 25 15 0 0
## 26 15 0 0
## 27 15 0 0
## 28 19 0 0
## 29 20 0 0
## 30 20 0 0
## 31 20 0 0
## 32 20 0 0
## 33 20 0 0
## 34 23 0 0
## 35 25 0 0
## 36 25 0 0
## 37 28 0 0
## 38 32 0 0
## 39 40 0 0
## 40 51 0 0
## 41 59 0 0
## 42 63 0 0
## 43 73 0 0
## 44 80 0 0
## 45 92 0 0
## 46 112 0 0
## 47 127 0 0
## 48 157 0 0
## 49 198 0 0
## 50 249 0 0
## 51 297 0 0
## 52 376 0 0
## 53 454 0 0
## 54 567 0 0
## 55 709 0 0
## 56 847 0 0
## 57 1072 0 0
## 58 1352 0 0
## 59 1680 0 0
## 60 2050 0 0
## 61 2430 0 0
## 62 2809 0 0
## 63 3180 0 0
## 64 3640 0 0
## 65 3984 0 0
## 66 4250 0 0
## 67 4561 6 0
## 68 4864 76 33
## 69 5137 81 32
## 70 5362 86 32
## 71 5552 92 33
## 72 5693 96 33
## 73 5799 96 35
## 74 5918 93 37
## 75 6023 87 36
## 76 6108 81 36
## 77 6214 74 38
## 78 6302 80 38
## 79 6324 81 35
## 80 6365 79 46
## 81 6414 80 44
## 82 6637 73 42
## 83 6667 67 38
## 84 6714 60 38
## 85 6756 56 34
## 86 6800 48 33
## 87 6813 49 32
## 88 6835 47 33
## 89 6842 47 31
## 90 6850 46 29
## 91 6867 42 28
## 92 6885 43 28
## 93 6904 43 25
## 94 6911 44 27
## 95 6923 43 27
## 96 6936 38 26
## 97 6944 34 22
## 98 6957 29 21
## 99 6972 28 21
## 100 6990 28 20
## 101 7014 28 20
## 102 7040 27 20
## 103 7064 27 18
## 104 7086 23 17
## 105 7104 21 16
## 106 7118 19 15
## 107 7130 18 15
## 108 7137 16 14
## 109 7157 16 15
## 110 7168 17 14
## 111 7183 18 13
## 112 7214 18 13
## 113 7231 16 12
## 114 7239 16 12
## 115 7248 12 7
## 116 7256 11 7
## 117 7267 9 7
## 118 7269 9 7
## 119 7283 7 6
## 120 7296 5 5
## 121 7299 5 5
## 122 7303 5 5
## 123 7318 5 5
## 124 7324 6 3
## 125 7342 5 3
## 126 7358 4 3
## 127 7369 4 3
## 128 7379 4 1
## 129 7387 3 1
## 130 7404 4 2
## 131 7412 5 2
## 132 7423 4 2
## 133 7434 3 2
## 134 7436 4 2
## 135 7440 3 2
## 136 7446 3 2
## 137 7448 2 2
## 138 7455 3 2
## 139 7464 2 2
## 140 7468 2 2
## 141 7481 2 0
## 142 7499 3 0
## 143 7514 4 0
## 144 7526 3 2
## 145 7549 3 3
## 146 7570 3 2
## 147 7588 2 2
## 148 7614 3 0
## 149 7639 2 0
## 150 7652 2 0
## 151 7670 3 0
## 152 7699 2 0
## 153 7735 2 0
## 154 7772 1 0
## 155 7818 1 0
## 156 7863 1 0
## 157 7944 1 0
## 158 8011 1 0
## 159 8097 3 0
## 160 8178 5 0
## 161 8243 7 0
## 162 8349 4 0
## 163 8436 4 0
## 164 8573 6 0
## 165 8742 10 0
## 166 8872 8 0
## 167 9045 10 0
## 168 9345 13 0
## 169 9537 16 0
## 170 9781 17 0
## 171 9964 18 0
## 172 10235 27 0
## 173 10479 28 0
## 174 10794 30 0
## 175 11219 32 22
## 176 11423 26 18
## 177 11784 29 18
## 178 12052 33 17
## 179 12410 38 23
## 180 12878 42 25
## 181 13285 41 25
## 182 13574 44 1
## 183 13927 46 1
## 184 14380 46 22
## 185 14912 49 24
## 186 15281 47 24
## 187 15560 46 1
## 188 16277 40 1
## 189 16880 44 27
## 190 17254 50 28
## 191 17895 46 30
## 192 18290 43 31
## 193 18702 44 5
## 194 19416 51 36
## 195 19863 52 34
## 196 20273 51 33
## 197 20698 53 35
## 198 21084 51 32
## 199 21397 55 37
## 200 21714 59 33
## 201 22127 51 32
## 202 22358 44 31
## 203 22742 47 31
## 204 23035 48 33
## 205 23288 47 34
## 206 23559 51 37
## 207 23773 52 37
## 208 23993 53 34
## 209 24236 51 33
## 210 24407 47 31
## 211 24602 43 27
## 212 24812 39 26
## 213 24916 38 22
## 214 25053 42 23
## 215 25205 46 20
## 216 25322 35 15
## 217 25448 35 21
## 218 25547 32 21
## 219 25670 31 15
## 220 25746 27 17
## 221 25819 26 10
## 222 25923 23 16
## 223 26049 26 18
## 224 26136 27 17
## 225 26207 27 19
## 226 26279 26 20
## 227 26322 32 21
## 228 26374 29 16
## 229 26465 26 15
## 230 26513 23 15
## 231 26565 18 12
## 232 26606 15 10
## 233 26650 17 7
## 234 26691 18 10
## 235 26737 17 10
## 236 26779 16 9
## 237 26813 16 9
## 238 26861 15 9
## 239 26885 12 7
## 240 26898 10 6
## 241 26912 8 4
## 242 26942 11 6
## 243 26974 11 7
## 244 26983 11 7
## 245 27000 11 7
## 246 27016 12 5
## 247 27040 12 5
## 248 27044 11 4
## 249 27063 8 4
## 250 27078 9 3
## 251 27096 9 3
## 252 27113 6 3
## 253 27121 6 3
## 254 27136 6 1
## 255 27149 6 2
## 256 27174 5 2
## 257 27182 6 0
## 258 27206 3 0
## 259 27229 4 0
## 260 27244 4 0
## 261 27264 2 0
## 262 27286 1 0
## 263 27316 1 0
## 264 27341 1 0
## 265 27362 1 0
## 266 27371 1 0
## 267 27383 1 0
## 268 27391 1 0
## 269 27399 1 0
## 270 27430 1 0
## 271 27444 1 0
## 272 27466 1 0
## 273 27484 0 0
## 274 27499 0 0
## 275 27520 0 0
## 276 27527 0 0
## 277 27541 1 0
## 278 27555 1 0
## 279 27570 1 0
## 280 27582 1 0
## 281 27590 1 0
## 282 27595 1 1
## 283 27602 1 1
## 284 27610 1 1
## 285 27622 1 1
## 286 27634 1 1
## 287 27645 1 1
## 288 27652 1 1
## 289 27658 1 1
## 290 27668 1 1
## 291 27677 1 1
## 292 27685 0 0
## 293 27698 0 0
## 294 27703 0 0
## 295 27711 0 0
## 296 27728 0 0
## 297 27750 0 0
## 298 27760 0 0
## 299 27777 0 0
## 300 27784 0 0
## 301 27792 0 0
## 302 27806 0 0
## 303 27821 0 0
## 304 27835 0 0
## 305 27848 0 0
## 306 27856 0 0
## 307 27864 0 0
## 308 27874 0 0
## 309 27885 0 0
## 310 27892 0 0
## 311 27903 0 0
## 312 27912 0 0
## 313 27923 0 0
## 314 27940 0 0
## 315 27949 0 0
## 316 27956 0 0
## 317 27965 0 0
## 318 27972 0 0
## 319 27987 0 0
## 320 27993 0 0
## 321 28001 0 0
## 322 28012 0 0
## 323 28025 0 0
## 324 28030 0 0
## 325 28039 1 0
## 326 28047 1 0
## 327 28059 1 0
## 328 28072 1 0
## 329 28093 0 0
## 330 28128 0 0
## 331 28172 0 0
## 332 28198 0 0
## 333 28219 0 0
## 334 28237 0 0
## 335 28262 0 0
## 336 28276 0 0
## 337 28296 0 0
## 338 28312 0 0
## 339 28337 0 0
## 340 28350 0 0
## 341 28381 0 0
## 342 28407 0 0
## 343 28427 0 0
## 344 28470 0 0
## 345 28483 0 0
## 346 28505 0 0
## 347 28523 0 0
## 348 28536 0 0
## 349 28546 0 0
## 350 28571 0 0
## 351 28582 0 0
## 352 28595 0 0
## 353 28614 0 1
## 354 28634 0 1
## 355 28650 1 1
## 356 28658 1 1
## 357 28669 1 1
## 358 28689 2 0
## 359 28708 2 0
## 360 28721 2 0
## 361 28731 2 0
## 362 28740 1 0
## 363 28749 1 0
## 364 28755 1 0
## 365 28761 0 0
## 366 28766 0 0
## 367 28777 0 0
## 368 28780 0 0
## 369 28787 0 0
## 370 28794 0 0
## 371 28800 0 0
## 372 28806 0 0
## 373 28812 0 0
## 374 28818 0 0
## 375 28824 0 0
## 376 28829 0 0
## 377 28838 0 0
## 378 28842 0 0
## 379 28848 0 0
## 380 28850 0 0
## 381 28857 0 0
## 382 28860 1 0
## 383 28871 1 0
## 384 28879 1 0
## 385 28887 1 0
## 386 28892 1 0
## 387 28898 0 0
## 388 28900 0 0
## 389 28905 0 0
## 390 28911 0 0
## 391 28912 0 0
## 392 28918 1 0
## 393 28920 1 0
## 394 28926 1 0
## 395 28930 1 0
## 396 28937 0 0
## 397 28939 0 0
## 398 28947 0 0
## 399 28958 0 0
## 400 28965 1 0
## 401 28970 1 0
## 402 28978 1 0
## 403 28986 1 0
## 404 28996 1 0
## 405 29007 1 0
## 406 29020 1 0
## 407 29030 1 0
## 408 29037 1 0
## 409 29046 1 0
## 410 29061 1 1
## 411 29075 1 1
## 412 29090 1 0
## 413 29102 1 0
## 414 29112 0 0
## 415 29117 0 0
## 416 29130 0 0
## 417 29137 0 0
## 418 29153 1 0
## 419 29166 1 0
## 420 29183 1 0
## 421 29192 3 0
## 422 29196 2 0
## 423 29206 1 0
## 424 29211 1 0
## 425 29220 1 0
## 426 29228 1 0
## 427 29240 1 0
## 428 29253 2 0
## 429 29260 2 0
## 430 29278 2 0
## 431 29296 2 0
## 432 29305 1 0
## 433 29323 1 0
## 434 29335 1 0
## 435 29341 2 0
## 436 29348 3 0
## 437 29357 3 0
## 438 29365 2 0
## 439 29379 2 0
## 440 29385 2 0
## 441 29390 2 0
## 442 29396 2 0
## 443 29405 1 0
## 444 29419 1 0
## 445 29437 2 0
## 446 29450 2 0
## 447 29469 2 0
## 448 29484 2 0
## 449 29505 2 0
## 450 29519 3 0
data2= data2[c(1:450),c(2,8:9)]
data2 [] <- lapply(data2 , function(x) diff(c(0, x)))
confirmed=data2$confirmed
icu=data2$icu
vent=data2$vent
class(confirmed)
## [1] "numeric"
class(icu)
## [1] "numeric"
class(vent)
## [1] "numeric"
plot(confirmed, icu, main="Scatterplot")
cor(confirmed, icu)
## [1] 0.159778
mod.1 <- lm(icu ~ confirmed)
plot(mod.1)
abline(mod.1, col=2, lwd=3)
par(mfrow=c(2,2))
summary(mod.1)
##
## Call:
## lm(formula = icu ~ confirmed)
##
## Residuals:
## Min 1Q Median 3Q Max
## -11.269 -0.611 0.267 0.313 68.781
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.328300 0.204700 -1.604 0.109461
## confirmed 0.005106 0.001491 3.426 0.000669 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.815 on 448 degrees of freedom
## Multiple R-squared: 0.02553, Adjusted R-squared: 0.02335
## F-statistic: 11.74 on 1 and 448 DF, p-value: 0.0006693
confint(mod.1, level=0.99)
## 0.5 % 99.5 %
## (Intercept) -0.857827707 0.201228221
## confirmed 0.001250596 0.008962141
anova(mod.1)
## Analysis of Variance Table
##
## Response: icu
## Df Sum Sq Mean Sq F value Pr(>F)
## confirmed 1 170.8 170.814 11.737 0.0006693 ***
## Residuals 448 6520.2 14.554
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
hist(residuals(mod.1))
boxplot(residuals(mod.1))
shapiro.test(residuals(mod.1))
##
## Shapiro-Wilk normality test
##
## data: residuals(mod.1)
## W = 0.33473, p-value < 2.2e-16
plot(confirmed, vent, main="Scatterplot")
cor(icu, vent)
## [1] 0.4510595
mod.2 <- lm(vent ~ icu)
plot(mod.2)
abline(mod.2, col=2, lwd=3)
par(mfrow=c(2,2))
summary(mod.2)
##
## Call:
## lm(formula = vent ~ icu)
##
## Residuals:
## Min 1Q Median 3Q Max
## -26.4317 0.0029 0.0029 0.0029 27.9606
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.002897 0.156667 -0.018 0.985
## icu 0.434615 0.040629 10.697 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.323 on 448 degrees of freedom
## Multiple R-squared: 0.2035, Adjusted R-squared: 0.2017
## F-statistic: 114.4 on 1 and 448 DF, p-value: < 2.2e-16
confint(mod.2, level=0.99)
## 0.5 % 99.5 %
## (Intercept) -0.4081700 0.4023752
## icu 0.3295137 0.5397162
anova(mod.2)
## Analysis of Variance Table
##
## Response: vent
## Df Sum Sq Mean Sq F value Pr(>F)
## icu 1 1263.9 1263.86 114.43 < 2.2e-16 ***
## Residuals 448 4948.1 11.04
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
hist(residuals(mod.2))
boxplot(residuals(mod.2))
shapiro.test(residuals(mod.2))
##
## Shapiro-Wilk normality test
##
## data: residuals(mod.2)
## W = 0.39496, p-value < 2.2e-16
plot(confirmed, vent, main="Scatterplot")
cor(confirmed, vent)
## [1] 0.2151266
mod.3 <- lm(vent ~ confirmed)
plot(mod.3)
abline(mod.3, col=2, lwd=3)
par(mfrow=c(2,2))
summary(mod.3)
##
## Call:
## lm(formula = vent ~ confirmed)
##
## Residuals:
## Min 1Q Median 3Q Max
## -28.2948 -0.2611 0.3484 0.3948 31.4273
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.434559 0.195126 -2.227 0.0264 *
## confirmed 0.006625 0.001421 4.663 4.13e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.637 on 448 degrees of freedom
## Multiple R-squared: 0.04628, Adjusted R-squared: 0.04415
## F-statistic: 21.74 on 1 and 448 DF, p-value: 4.127e-06
confint(mod.3, level=0.99)
## 0.5 % 99.5 %
## (Intercept) -0.939320521 0.07020166
## confirmed 0.002949174 0.01030004
anova(mod.3)
## Analysis of Variance Table
##
## Response: vent
## Df Sum Sq Mean Sq F value Pr(>F)
## confirmed 1 287.5 287.488 21.739 4.127e-06 ***
## Residuals 448 5924.5 13.224
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
hist(residuals(mod.3))
boxplot(residuals(mod.3))
shapiro.test(residuals(mod.3))
##
## Shapiro-Wilk normality test
##
## data: residuals(mod.3)
## W = 0.40206, p-value < 2.2e-16
options(max.print=1000000)
DATA1 = read.csv("data_for_project_1.csv")
DATA1[c(2:450),c(1,2,3)]
## \u9518\u7e1eonfirmed icu vent
## 2 0 0 0
## 3 1 0 0
## 4 0 0 0
## 5 4 0 0
## 6 0 0 0
## 7 0 0 0
## 8 1 0 0
## 9 2 0 0
## 10 0 0 0
## 11 1 0 0
## 12 1 0 0
## 13 0 0 0
## 14 0 0 0
## 15 0 0 0
## 16 0 0 0
## 17 0 0 0
## 18 0 0 0
## 19 0 0 0
## 20 0 0 0
## 21 0 0 0
## 22 0 0 0
## 23 0 0 0
## 24 0 0 0
## 25 0 0 0
## 26 0 0 0
## 27 0 0 0
## 28 4 0 0
## 29 1 0 0
## 30 0 0 0
## 31 0 0 0
## 32 0 0 0
## 33 0 0 0
## 34 3 0 0
## 35 2 0 0
## 36 0 0 0
## 37 3 0 0
## 38 4 0 0
## 39 8 0 0
## 40 11 0 0
## 41 8 0 0
## 42 4 0 0
## 43 10 0 0
## 44 7 0 0
## 45 12 0 0
## 46 20 0 0
## 47 15 0 0
## 48 30 0 0
## 49 41 0 0
## 50 51 0 0
## 51 48 0 0
## 52 79 0 0
## 53 78 0 0
## 54 113 0 0
## 55 142 0 0
## 56 138 0 0
## 57 225 0 0
## 58 280 0 0
## 59 328 0 0
## 60 370 0 0
## 61 380 0 0
## 62 379 0 0
## 63 371 0 0
## 64 460 0 0
## 65 344 0 0
## 66 266 0 0
## 67 311 6 0
## 68 303 76 33
## 69 273 81 32
## 70 225 86 32
## 71 190 92 33
## 72 141 96 33
## 73 106 96 35
## 74 119 93 37
## 75 105 87 36
## 76 85 81 36
## 77 106 74 38
## 78 88 80 38
## 79 22 81 35
## 80 41 79 46
## 81 49 80 44
## 82 223 73 42
## 83 30 64 38
## 84 47 60 38
## 85 42 56 34
## 86 44 48 33
## 87 13 49 32
## 88 22 47 33
## 89 7 47 31
## 90 8 46 29
## 91 17 42 28
## 92 18 43 28
## 93 19 43 25
## 94 7 44 27
## 95 12 32 27
## 96 13 38 26
## 97 8 34 22
## 98 13 29 21
## 99 15 28 21
## 100 18 28 20
## 101 24 28 20
## 102 26 27 20
## 103 24 27 18
## 104 22 23 17
## 105 18 21 16
## 106 14 19 15
## 107 12 18 15
## 108 7 16 14
## 109 20 16 15
## 110 11 17 14
## 111 15 18 13
## 112 31 18 13
## 113 17 16 12
## 114 8 16 12
## 115 9 12 7
## 116 8 11 7
## 117 11 11 7
## 118 2 9 7
## 119 14 9 6
## 120 13 5 5
## 121 3 5 5
## 122 4 5 5
## 123 15 5 5
## 124 6 6 3
## 125 18 5 3
## 126 16 4 3
## 127 11 4 3
## 128 10 4 1
## 129 8 3 1
## 130 17 4 2
## 131 8 5 2
## 132 11 4 2
## 133 11 3 2
## 134 2 4 2
## 135 4 3 2
## 136 6 3 2
## 137 2 2 2
## 138 7 3 2
## 139 9 2 2
## 140 4 2 2
## 141 13 2 0
## 142 18 3 0
## 143 15 4 0
## 144 12 3 2
## 145 23 3 3
## 146 21 3 2
## 147 18 2 2
## 148 26 3 0
## 149 25 2 0
## 150 13 2 0
## 151 18 3 0
## 152 29 2 0
## 153 36 2 0
## 154 37 1 0
## 155 46 1 0
## 156 45 1 0
## 157 81 1 0
## 158 67 1 0
## 159 86 3 0
## 160 81 5 0
## 161 65 7 0
## 162 106 4 0
## 163 87 4 0
## 164 137 6 0
## 165 169 10 0
## 166 130 8 0
## 167 173 10 0
## 168 300 13 0
## 169 192 16 0
## 170 244 17 0
## 171 183 18 0
## 172 271 27 0
## 173 244 28 0
## 174 315 30 0
## 175 425 32 22
## 176 204 26 18
## 177 361 29 18
## 178 268 33 17
## 179 358 38 23
## 180 468 42 25
## 181 407 41 25
## 182 289 44 1
## 183 353 46 1
## 184 453 46 22
## 185 532 49 24
## 186 369 47 24
## 187 279 46 1
## 188 717 40 1
## 189 603 44 27
## 190 374 50 28
## 191 641 46 30
## 192 395 43 31
## 193 412 44 5
## 194 714 51 36
## 195 447 52 34
## 196 410 51 33
## 197 425 53 35
## 198 386 51 32
## 199 313 55 37
## 200 317 59 33
## 201 413 51 32
## 202 231 44 31
## 203 384 47 31
## 204 293 48 33
## 205 253 47 34
## 206 271 51 37
## 207 214 52 37
## 208 220 53 34
## 209 243 51 33
## 210 171 47 31
## 211 195 43 27
## 212 210 39 26
## 213 104 38 22
## 214 137 42 23
## 215 152 46 20
## 216 117 35 15
## 217 126 32 21
## 218 99 32 21
## 219 123 31 15
## 220 76 27 17
## 221 73 26 10
## 222 104 23 16
## 223 126 26 18
## 224 87 27 17
## 225 71 27 19
## 226 72 26 20
## 227 43 32 21
## 228 52 29 16
## 229 91 26 20
## 230 48 23 15
## 231 52 18 12
## 232 41 15 10
## 233 44 17 7
## 234 41 18 10
## 235 46 17 10
## 236 42 16 9
## 237 34 16 9
## 238 48 15 9
## 239 24 12 7
## 240 13 10 6
## 241 14 8 4
## 242 30 11 6
## 243 9 11 7
## 244 9 11 7
## 245 17 11 7
## 246 16 12 5
## 247 24 12 5
## 248 4 11 4
## 249 19 8 4
## 250 15 9 3
## 251 18 9 3
## 252 17 6 3
## 253 8 6 3
## 254 15 6 1
## 255 13 6 2
## 256 25 5 2
## 257 8 6 0
## 258 24 3 0
## 259 23 4 0
## 260 15 4 0
## 261 20 2 0
## 262 22 1 0
## 263 30 1 0
## 264 25 1 0
## 265 21 1 0
## 266 9 1 0
## 267 12 1 0
## 268 8 1 0
## 269 8 1 0
## 270 31 1 0
## 271 14 1 0
## 272 22 1 0
## 273 18 0 0
## 274 15 0 0
## 275 21 0 0
## 276 7 0 0
## 277 14 1 0
## 278 14 1 0
## 279 15 1 0
## 280 12 1 0
## 281 8 1 0
## 282 5 1 1
## 283 7 1 1
## 284 8 1 1
## 285 12 1 1
## 286 12 1 1
## 287 11 1 1
## 288 7 1 1
## 289 6 1 1
## 290 10 1 1
## 291 9 1 1
## 292 8 0 0
## 293 13 0 0
## 294 5 0 0
## 295 8 0 0
## 296 17 0 0
## 297 22 0 0
## 298 10 0 0
## 299 17 0 0
## 300 7 0 0
## 301 8 0 0
## 302 14 0 0
## 303 15 0 0
## 304 14 0 0
## 305 13 0 0
## 306 8 0 0
## 307 8 0 0
## 308 10 0 0
## 309 11 0 0
## 310 7 0 0
## 311 11 0 0
## 312 9 0 0
## 313 11 0 0
## 314 17 0 0
## 315 9 0 0
## 316 7 0 0
## 317 9 0 0
## 318 7 0 0
## 319 15 0 0
## 320 6 0 0
## 321 8 0 0
## 322 11 0 0
## 323 13 0 0
## 324 5 0 0
## 325 9 1 0
## 326 8 1 0
## 327 12 1 0
## 328 13 1 0
## 329 21 0 0
## 330 35 0 0
## 331 44 0 0
## 332 26 0 0
## 333 21 0 0
## 334 18 0 0
## 335 25 0 0
## 336 14 0 0
## 337 20 0 0
## 338 16 0 0
## 339 25 0 0
## 340 13 0 0
## 341 31 0 0
## 342 26 0 0
## 343 20 0 0
## 344 43 0 0
## 345 13 0 0
## 346 22 0 0
## 347 18 0 0
## 348 13 0 0
## 349 10 0 0
## 350 25 0 0
## 351 11 0 0
## 352 13 0 0
## 353 19 0 1
## 354 20 0 1
## 355 16 1 1
## 356 8 1 1
## 357 11 1 1
## 358 20 2 0
## 359 19 2 0
## 360 13 2 0
## 361 10 2 0
## 362 9 1 0
## 363 9 1 0
## 364 6 1 0
## 365 6 0 0
## 366 5 0 0
## 367 11 0 0
## 368 3 0 0
## 369 7 0 0
## 370 7 0 0
## 371 6 0 0
## 372 6 0 0
## 373 6 0 0
## 374 6 0 0
## 375 6 0 0
## 376 5 0 0
## 377 9 0 0
## 378 4 0 0
## 379 6 0 0
## 380 2 0 0
## 381 7 0 0
## 382 3 1 0
## 383 11 1 0
## 384 8 1 0
## 385 8 1 0
## 386 5 1 0
## 387 6 0 0
## 388 2 0 0
## 389 5 0 0
## 390 6 0 0
## 391 1 0 0
## 392 6 1 0
## 393 2 1 0
## 394 6 1 0
## 395 4 1 0
## 396 7 0 0
## 397 2 0 0
## 398 8 0 0
## 399 11 0 0
## 400 7 1 0
## 401 5 1 0
## 402 8 1 0
## 403 8 1 0
## 404 10 1 0
## 405 11 1 0
## 406 13 1 0
## 407 10 1 0
## 408 7 1 0
## 409 9 1 0
## 410 15 1 1
## 411 14 1 1
## 412 15 1 0
## 413 12 1 0
## 414 10 0 0
## 415 5 0 0
## 416 13 0 0
## 417 7 0 0
## 418 16 1 0
## 419 13 1 0
## 420 17 1 0
## 421 9 3 0
## 422 4 2 0
## 423 10 1 0
## 424 5 1 0
## 425 9 1 0
## 426 8 1 0
## 427 12 1 0
## 428 13 2 0
## 429 7 2 0
## 430 18 2 0
## 431 18 2 0
## 432 9 1 0
## 433 18 1 0
## 434 12 1 0
## 435 6 2 0
## 436 7 3 0
## 437 9 3 0
## 438 8 2 0
## 439 14 2 0
## 440 6 2 0
## 441 5 2 0
## 442 6 2 0
## 443 9 1 0
## 444 14 1 0
## 445 18 2 0
## 446 13 2 0
## 447 19 2 0
## 448 15 2 0
## 449 21 2 0
## 450 14 3 0
DATA3= DATA1[c(2:450),c(1,2,3)]
DATA3 [] <- lapply(DATA3, function(x) diff(c(0, x)))
class(confirmed)
## [1] "numeric"
class(icu)
## [1] "numeric"
class(vent)
## [1] "numeric"
plot(confirmed, icu, main="Scatterplot")
cor(confirmed, icu)
## [1] 0.159778
mod <- lm(icu ~ confirmed)
summary(mod)
##
## Call:
## lm(formula = icu ~ confirmed)
##
## Residuals:
## Min 1Q Median 3Q Max
## -11.269 -0.611 0.267 0.313 68.781
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.328300 0.204700 -1.604 0.109461
## confirmed 0.005106 0.001491 3.426 0.000669 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 3.815 on 448 degrees of freedom
## Multiple R-squared: 0.02553, Adjusted R-squared: 0.02335
## F-statistic: 11.74 on 1 and 448 DF, p-value: 0.0006693
## Summary The second research question investigated differences within the patterns of confirmed cases on a daily scale, evaluating if the relationship of their subsequent difference on mortality rates was statistically relevant