Covid 19 Analysis - Toronto

Background

“

The COVID-19 pandemic has significantly impacted communities worldwide, and Toronto, as one of Canada’s largest and most populous cities, has been no exception. The analysis of COVID-19 data in Toronto provides crucial insights into the spread of the virus, also the level of spread.

Prior to executing the code, kindly adhere to the provided instructions

Please install the following packages to run the program smoothly

  1. library(ggthemes)
  2. library(ggrepel)
  3. library(hrbrthemes)
  4. library(ggridges)
  5. library(gganimate)
  6. library(babynames)
  7. library(RColorBrewer)
  8. library(scales)
  9. library(viridis)
  10. library(eurostat)
  11. library(kableExtra)
  12. library(lubridate)
  13. library(tidyverse)
  14. library(dplyr)
  15. library(ggsignif)
  16. library(summarytools)
  17. library(corrplot)

Types of Analysis we are doing


  • Age Group Level Analysis and Their Contribution
  • Tracking COVID-19: Monthly and Yearly Case Count
  • Analysis of COVID-19 by Gender in Toronto Over Years
  • Case Level Analysis
  • Frequency Analysis of COVID-19 at the Source Level
  • T-Test: Two Independent Groups (Below 30 and Above 30)
  • Correlation Plot: COVID Case Analysis

Data - Briefing

Data

Data Source : https://open.toronto.ca/dataset/covid-19-cases-in-toronto/

Published by: Toronto Public Health

Key indicators

  1. _id: Unique identifier for each row in the Open Data database.
  2. Assigned_ID: Unique ID assigned by Toronto Public Health for case tracking.
  3. Outbreak Associated: Indicates if cases are linked to outbreaks in healthcare or congregate settings.
  4. Age Group: Age at the time of illness, categorized in groups.
  5. Neighbourhood Name: Geographic location in Toronto.
  6. FSA: First three characters of postal code based on the case’s home address.
  7. Source of Infection: Describes the likely source of COVID-19 infection.
  8. Classification: Indicates if cases are confirmed or probable according to provincial criteria.
  9. Episode Date: Estimated date when the disease was acquired.
  10. Reported Date: Date when the case was reported to Toronto Public Health.
  11. Client Gender: Self-reported gender.
  12. Outcome: Indicates if the case is fatal, resolved, or active.
  13. Ever Hospitalized: Indicates if the case was ever hospitalized.
  14. Ever in ICU: Indicates if the case was ever in the intensive care unit.
  15. Ever Intubated: Indicates if the case was ever intubated.

Trend Analysis


Unveiling Demographic Dynamics: An In-Depth Exploration of COVID-19 Impact through Age Group Level Analysis and Contribution


Introduction:

As we look at how COVID-19 is affecting Toronto, it’s important to check out different age groups. This study is all about that. We’re going to dive into the details of how different age ranges impact the way the virus is spreading. We’ll look at the numbers of confirmed and likely cases across age groups, trying to find patterns and understand who might be more vulnerable. This will help us see the unique situations each age group brings to the COVID-19 story in Toronto. Come along as we uncover the interesting stuff hidden in the age group data. It’s like putting on glasses to see the challenges COVID-19 is throwing at Toronto more clearly.


1. Table -1 Breakdown of Age Groups and Their Influence


Total Cases by Age Group
Age.Group Total_cases Male Female contribution
19 and younger 55077 27965 26681 13.44 %
20 to 29 Years 77452 35400 40850 18.9 %
30 to 39 Years 73292 33566 38946 17.88 %
40 to 49 Years 56970 24612 31818 13.9 %
50 to 59 Years 52610 23493 28664 12.84 %
60 to 69 Years 35282 17262 17762 8.61 %
70 to 79 Years 23321 11698 11539 5.69 %
80 to 89 Years 22216 9302 12861 5.42 %
90 and older 13664 4177 9456 3.33 %

Major Findings


The table shows the percentage of total cases by age group. The highest percentage of cases is in the 20-29 age group, followed by the 30-39 age group and the 40-49 age group. The percentage of cases decreases with age, with the lowest percentage of cases in the 90 and older age group.

This suggests that younger people are more likely to contract COVID-19 than older people. This may be due to a number of factors, such as younger people being more likely to socialize and participate in activities that put them at risk of exposure to the virus, as well as younger people having stronger immune systems, which may make them more likely to show symptoms of COVID-19.


2. Graph-1 Breakdown of Age Groups and Their Influence



3. Tracking COVID-19: Monthly and Yearly Case Count - Bar plot

Introduction:

Let’s take a step back in time to see how many COVID-19 cases popped up each month and year. This look into the past helps us spot any patterns and understand how the virus has changed over time. Come along as we explore the numbers and get a clearer picture of how the situation unfolded month by month.

4. Tracking COVID-19: Monthly and Yearly Case Count - Line plot

Major Findings

The graph shows that the number of COVID-19 cases in Toronto has fluctuated over time, with four distinct waves of cases occurring since the start of the pandemic. The first wave, which occurred in the spring of 2020, was the largest, with over 20,000 cases reported in that month. The subsequent waves have been smaller, with the largest number of cases reported in the second wave at around 40,000 cases per month,Especially the end of 2021 and starting of 2022 we have a significant surge in covid 19 cases which exceeded more than 50,000 per month.


5. Mapping Peaks: Identifying Monthly COVID-19 Spikes with Density Plots

Introduction:


In our exploration of COVID-19 trends at a monthly level, we’re honing in on the moments when the virus made a significant jump. This analysis utilizes density plots to highlight those spikes, giving us a clear visual of the intensity each month.

Major Findings

The graph shows that the number of cases increased steadily from January to April. In May, the number of cases peaked and then began to decline. The number of cases continued to decline in June and July, but then began to increase again in August. In September and October, the number of cases plateaued. In November, the number of cases began to increase again, and in December, the number of cases reached a new peak.

Gender Analysis

1. Analysis of COVID-19 by Gender in Toronto over years.


The graph shows that the total number of confirmed cases is higher for women than for men in all years except for 2020. This is likely due to a number of factors, including the fact that women are more likely to work in healthcare and other front-line occupations, and the fact that women are more likely to have underlying health conditions that make them more vulnerable to COVID-19.


2. Analysis of gender - frequency of confirmed cases


The graph shows that the female population has the highest number of confirmed cases, followed by the male population. The non-binary, not listed,other, trans man, trans woman, transgender, and unknown populations have relatively fewer confirmed cases.

Graph -1 Box-plot


Graph -2 Bar-plot with year

Case Level Analysis


1. Table case level analysis


It shows that for confirmed cases, the vast majority (98.33%) have recovered, with a mere 0.4% still active. This suggests that the vast majority of those who contracted COVID-19 have successfully fought off the infection. The statement further draws a parallel to probable COVID-19 cases, indicating that a similar trend is observed. In probable cases, 99.49% have resolved, while only 0.35% remain active and 0.17% have fatal outcomes. This implies that probable cases also exhibit a high recovery rate, with only a small fraction leading to fatalities.


Total Cases by Classification, and Outcome
Classification Outcome Total_cases Ever_Hospitalized Ever_in_ICU Ever_Intubated contribution
CONFIRMED ACTIVE 1575 96 12 8 0.4 %
CONFIRMED FATAL 5013 3285 1195 852 1.27 %
CONFIRMED RESOLVED 388730 14754 1828 873 98.33 %
PROBABLE ACTIVE 52 0 0 0 0.35 %
PROBABLE FATAL 25 4 1 1 0.17 %
PROBABLE RESOLVED 14911 50 7 2 99.49 %

2. Graph Case level Analysis


the graph shows the representation of total cases by classification

3. Analysis of COVID-19 at the source level in Toronto.


This data provides insights into the distribution of cases based on the sources of infection. It highlights the importance of categories like community, close contact, and healthcare institutions in contributing to the total number of cases. Additionally, a significant portion of cases (50.76%) has no information regarding the source of infection.


3.1 frequency Analysis of COVID-19 at the source level in Toronto.


Primary Sources of Infection:


1. Community (28.91%): The community is a significant source of infection, indicating that a substantial portion of cases is originating from general interactions within the community.

2. Close Contact (7.14%): While not as prominent as the community, close contact still plays a notable role in the spread of the infection.

3. Household Contact (14.34%): Infections within households contribute significantly, highlighting the importance of preventive measures within family settings.

4. criticality of cases Vs Source of infection


Examining the criticality of COVID-19 cases involves a specific focus on individuals who have experienced hospitalization, ICU admission, or intubation. This analysis further centers on determining the source through which individuals contracted the virus. By assessing the number of hospitalizations and ICU admissions attributed to each source, the goal is to identify and prioritize sources that warrant heightened caution and preventive measures

Looking at all the information, it’s clear that most people are getting COVID-19 from the community, and a lot of them end up in the hospital because of it. The same goes for the healthcare sector – more people from there are getting hospitalized compared to other sources. Also, when it comes to serious cases needing ICU care or a ventilator, the numbers follow a similar pattern for different sources. This tells us that we need to be extra careful in the community and healthcare settings because that’s where the risk of getting really sick is higher



T-Test

T_Test - two independent groups (Below 40 and Above 40)

2 groups

  • Above 40 group - based on age
  • Below 40 group - based on age

Hypothesis

Null Hypothesis (H0): There is no significant difference in the means between the “Above 40” and “Below 40” groups

Alternative Hypothesis (H1): There is a significant difference in the means between the “Above 40” and “Below 40” groups

## 
##  Welch Two Sample t-test
## 
## data:  Total_cases by Age_Group_Category
## t = 0.34475, df = 22, p-value = 0.7336
## alternative hypothesis: true difference in means between group Above 40 and group Below 40 is not equal to 0
## 95 percent confidence interval:
##  -3935.560  5504.894
## sample estimates:
## mean in group Above 40 mean in group Below 40 
##               8501.083               7716.417

Interpretation

The t-test results suggest that there is not enough evidence to reject the null hypothesis. The p-value is high (0.7807), indicating that the observed difference in means is not statistically significant. The 95% confidence interval includes 0, supporting the idea that the true difference in means could be zero. Therefore, based on this analysis, you do not have sufficient evidence to conclude that there is a significant difference in the means of the “Above 40” and “Below 40” groups.” what is the null hypothesis

Correlation

Correlation Plot

This correlation plot examines the relationship between ICU admissions and hospitalizations resulting from COVID-19 in Toronto. By visualizing this connection we are aim to see any relation between these two variables

Correlation Matrix

Variables we are considering

  • Total Cases
  • Ever Hospitalized
  • Ever In ICU
  • Ever Intubated

We are doing a correlation matrix to understand the relation between all these 4 matrix and which is more related to each other

##                   Total_cases Ever_Hospitalized Ever_in_ICU Ever_Intubated
## Total_cases         1.0000000         0.7307022   0.6634514      0.6290552
## Ever_Hospitalized   0.7307022         1.0000000   0.9767905      0.9646499
## Ever_in_ICU         0.6634514         0.9767905   1.0000000      0.9940267
## Ever_Intubated      0.6290552         0.9646499   0.9940267      1.0000000


####Result

  1. correlation coefficients for the variables
  • Total_cases and Ever_Hospitalized: 0.730
  • Total_cases and Ever_in_ICU: 0.663
  • Total_cases and Ever_Intubated: 0.629
  • Ever_Hospitalized and Ever_in_ICU: 0.976
  • Ever_Hospitalized and Ever_Intubated: 0.964
  • Ever_in_ICU and Ever_Intubated: 0.994

These coefficients suggest positive correlations between all pairs of variables, with stronger correlations between Ever_Hospitalized and both Ever_in_ICU and Ever_Intubated. The values close to 1 indicate a strong positive linear relationship between these variables.