Skip to main content
added 137 characters in body
Source Link
Borexino
  • 342
  • 4
  • 12
# Import dataset from authoritative source:  
 # https://ourworldindata.org/coronavirus-source-data
 covid <- read.csv("https://covid.ourworldindata.org/data/ecdc/full_data.csv")
        
 # Subsetting only data from China and Italy
 dataset <- subset(covid, location == "China" | location == "Italy")
        
 # Fatality ratio: is the proportion of deaths from a certain disease compared to the 
 # total number of people diagnosed with the disease for a certain period of time.
 dataset$fatality <- round(dataset$total_deaths/dataset$total_cases*100, 2)
    
 # Outbreak duration in days 
    dataset$days <- difftime(dataset$date,min(dataset$date), units="days")
    
    
  # Generating plot
    library(ggplot2)
    ggplot(dataset, aes(as.numeric(date)days, fatality, color = location, group = location))+
      geom_smooth(size= .5, alpha=.25, color = "gray65")+
      geom_line()+
      geom_point()+
      labs(x="Outbreak duration (days)", y= "Fatality rate (%)", color = "Location")+
      theme_light(14)
# Generating bar plot
library(ggplot2)
ggplot()+
  geom_bar(data=subset(dataset, location == "China"), 
           aes(as.numeric(date)days, fatality, fill = "China"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  geom_bar(data=subset(dataset, location == "Italy"), 
           aes(as.numeric(date)days, fatality, fill = "Italy"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  labs(x="Outbreak duration (days)", y= "Fatality rate (%)", fill = "Location")+
  scale_fill_brewer(palette = "Set1")+
  theme_light(14)
# Generating bar plot
library(ggplot2)
ggplot()+
  geom_bar(data=subset(dataset, location == "China"), 
           aes(as.numeric(date)days, new_deaths, fill = "China"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  geom_bar(data=subset(dataset, location == "Italy"), 
           aes(as.numeric(date)days, new_deaths, fill = "Italy"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  labs(x="Outbreak duration (days)", y= "Daily deaths (n)", fill = "Location")+
  scale_fill_brewer(palette = "Set1")+
  theme_light(14)
# Import dataset from authoritative source:  
# https://ourworldindata.org/coronavirus-source-data
covid <- read.csv("https://covid.ourworldindata.org/data/ecdc/full_data.csv")

# Subsetting only data from China and Italy
dataset <- subset(covid, location == "China" | location == "Italy")

# Fatality ratio: is the proportion of deaths from a certain disease compared to the 
# total number of people diagnosed with the disease for a certain period of time.
dataset$fatality <- round(dataset$total_deaths/dataset$total_cases*100, 2)

# Generating plot
library(ggplot2)
ggplot(dataset, aes(as.numeric(date), fatality, color = location, group = location))+
  geom_smooth(size= .5, alpha=.25, color = "gray65")+
  geom_line()+
  geom_point()+
  labs(x="Outbreak duration (days)", y= "Fatality rate (%)", color = "Location")+
  theme_light(14)
# Generating bar plot
library(ggplot2)
ggplot()+
  geom_bar(data=subset(dataset, location == "China"), 
           aes(as.numeric(date), fatality, fill = "China"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  geom_bar(data=subset(dataset, location == "Italy"), 
           aes(as.numeric(date), fatality, fill = "Italy"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  labs(x="Outbreak duration (days)", y= "Fatality rate (%)", fill = "Location")+
  scale_fill_brewer(palette = "Set1")+
  theme_light(14)
# Generating bar plot
library(ggplot2)
ggplot()+
  geom_bar(data=subset(dataset, location == "China"), 
           aes(as.numeric(date), new_deaths, fill = "China"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  geom_bar(data=subset(dataset, location == "Italy"), 
           aes(as.numeric(date), new_deaths, fill = "Italy"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  labs(x="Outbreak duration (days)", y= "Daily deaths (n)", fill = "Location")+
  scale_fill_brewer(palette = "Set1")+
  theme_light(14)
# Import dataset from authoritative source:  
 # https://ourworldindata.org/coronavirus-source-data
 covid <- read.csv("https://covid.ourworldindata.org/data/ecdc/full_data.csv")
        
 # Subsetting only data from China and Italy
 dataset <- subset(covid, location == "China" | location == "Italy")
        
 # Fatality ratio: is the proportion of deaths from a certain disease compared to the 
 # total number of people diagnosed with the disease for a certain period of time.
 dataset$fatality <- round(dataset$total_deaths/dataset$total_cases*100, 2)
    
 # Outbreak duration in days 
    dataset$days <- difftime(dataset$date,min(dataset$date), units="days")
    
    
  # Generating plot
    library(ggplot2)
    ggplot(dataset, aes(days, fatality, color = location, group = location))+
      geom_smooth(size= .5, alpha=.25, color = "gray65")+
      geom_line()+
      geom_point()+
      labs(x="Outbreak duration (days)", y= "Fatality rate (%)", color = "Location")+
      theme_light(14)
# Generating bar plot
library(ggplot2)
ggplot()+
  geom_bar(data=subset(dataset, location == "China"), 
           aes(days, fatality, fill = "China"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  geom_bar(data=subset(dataset, location == "Italy"), 
           aes(days, fatality, fill = "Italy"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  labs(x="Outbreak duration (days)", y= "Fatality rate (%)", fill = "Location")+
  scale_fill_brewer(palette = "Set1")+
  theme_light(14)
# Generating bar plot
library(ggplot2)
ggplot()+
  geom_bar(data=subset(dataset, location == "China"), 
           aes(days, new_deaths, fill = "China"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  geom_bar(data=subset(dataset, location == "Italy"), 
           aes(days, new_deaths, fill = "Italy"), 
           stat = "identity", position = position_dodge(), alpha = .75)+
  
  labs(x="Outbreak duration (days)", y= "Daily deaths (n)", fill = "Location")+
  scale_fill_brewer(palette = "Set1")+
  theme_light(14)
deleted 1 character in body
Source Link
AdamO
  • 64.8k
  • 6
  • 135
  • 273

In my knowdledgeknowledge, fatality rate is a ratio between deaths from a certain disease compared to the total number of subjects diagnosed with the disease.

In my knowdledge, fatality rate is a ratio between deaths from a certain disease compared to the total number of subjects diagnosed with the disease.

In my knowledge, fatality rate is a ratio between deaths from a certain disease compared to the total number of subjects diagnosed with the disease.

plots updated
Source Link
Borexino
  • 342
  • 4
  • 12

EDT: enter image description hereenter image description here Bar Plot

enter image description hereenter image description here From this basis, I'm a little bit confused about such difference in terms of fatality rate between the two analyzed countries. In fact, China has the maximum fatality rate at 4%, while Italy at more than 6%. For this reason I've two questions:

enter image description hereenter image description here

EDT: enter image description here Bar Plot

enter image description here From this basis, I'm a little bit confused about such difference in terms of fatality rate between the two analyzed countries. In fact, China has the maximum fatality rate at 4%, while Italy at more than 6%. For this reason I've two questions:

enter image description here

EDT: enter image description here Bar Plot

enter image description here From this basis, I'm a little bit confused about such difference in terms of fatality rate between the two analyzed countries. In fact, China has the maximum fatality rate at 4%, while Italy at more than 6%. For this reason I've two questions:

enter image description here

added 13 characters in body
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
added 1 character in body
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
added 863 characters in body; edited title
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
added 863 characters in body; edited title
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
added 863 characters in body; edited title
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
edited body
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
added 441 characters in body
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
added 739 characters in body
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
added 1 character in body
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
added 3 characters in body
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
Became Hot Network Question
Tweeted twitter.com/StackStats/status/1238253581767229443
deleted 3 characters in body
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
added 153 characters in body
Source Link
Borexino
  • 342
  • 4
  • 12
Loading
edited title
Link
Borexino
  • 342
  • 4
  • 12
Loading
Source Link
Borexino
  • 342
  • 4
  • 12
Loading