Data Visualization
US Stock Prices of Healthcare Companies since 2010
The interactive plot below have shown the stock price of healthcare companies over last 12 years and Moderna (MRNA) since 2019. Overall, the stock prices of healthcare companies has been grow over the period of time. The stock prices of United Health Group (UNH), AstraZeneca (ANZ), Eli Lilly And Co (LLY), and CVS have shown more prevailingly rising trend, especially UNH, it surpassed the rest of healthcare companies and have been ranked the highest stock price since 2015. While Pfizer (PFE) has comparatively small increase in stock price over the period of time. The stock price of MRNA surged in COVID-19, peaked at Augest 2021 and then plummeted. Apart from MRNA, every company has a steep drop of stock price in March 2020, which was closely related to fears of COVID-19 spreading across the country and the global community.
Show the code
<- read.csv('data/stock.csv')
stock_df $Dates <- as.Date(stock_df$Dates)
stock_df
<- ggplot(stock_df, aes(x=Dates)) +
g1geom_line(aes(y=PFE, colour="PFE"))+
geom_line(aes(y=UNH, colour="UNH"))+
geom_line(aes(y=AZN, colour="AZN"))+
geom_line(aes(y=CVS, colour="CVS"))+
geom_line(aes(y=LLY, colour="LLY"))+
geom_line(data = mrna_df, aes(y=MRNA.Adjusted, colour="MRNA"))+
labs(
title = "Stock Prices for the Healthcare Companies Since 2010",
subtitle = "From 2010-2023",
x = "Date",
y = "Adjusted Closing Prices")+
guides(colour=guide_legend(title="Healthcare Companies"))
ggplotly(g1) %>% layout(hovermode = "x")
US Stock Prices of Healthcare Companies Since COVID-19 Pandemic
Show the code
<- filter(stock_df,Dates>"2020-01-05")
covid_stock <- filter(mrna_df,Dates>"2020-01-05")
covid_mrna
<- ggplot(covid_stock, aes(x=Dates)) +
g2geom_line(aes(y=PFE, colour="PFE"))+
geom_line(aes(y=UNH, colour="UNH"))+
geom_line(aes(y=AZN, colour="AZN"))+
geom_line(aes(y=CVS, colour="CVS"))+
geom_line(aes(y=LLY, colour="LLY"))+
geom_line(data = covid_mrna, aes(y=MRNA.Adjusted, colour="MRNA"))+
labs(
title = "Stock Prices for the Healthcare Companies Since COVID-19 Pandemic",
subtitle = "From 2020-2023",
x = "Date",
y = "Adjusted Closing Prices")+
guides(colour=guide_legend(title="Healthcare Companies"))
ggplotly(g2) %>% layout(hovermode = "x")
Like many other stocks, healthcare stocks experienced a decline in their stock prices in March 2020, when the pandemic began to spread rapidly across the United States. This was due to investor concerns about the potential economic impact of the pandemic, as well as uncertainties around the healthcare industry’s response to the crisis. Despite the initial decline, healthcare stocks have shown resilience and have generally performed well during the pandemic. This is likely due to the essential nature of healthcare services, as well as the industry’s strong financial position and diverse business models.
Among these stocks, MRNA shows a different trend to rest of the stocks with a big surge in 2021 and plummeted at 2022, and followed by a slight upward trend. Moderna is a biotechnology company that specializes in developing mRNA-based therapeutics and vaccines. The COVID-19 pandemic has had a significant impact on Moderna’s business, as the company has been at the forefront of developing a vaccine to combat the virus.
Overall, the pandemic has also led to increased demand for healthcare services and products, which has boosted the stock prices of companies that provide these services.
COVID-19 Weekly Case Number in US
Show the code
<- ggplot(data = covid_df, aes(x=Dates, y = Weekly.Cases)) +
g3 geom_line()+
labs(title = 'COVID-19 Weekly Case Number in US')
ggplotly(g3) %>% layout(hovermode = "x")
Daily COVID-19 Vaccination Number in US
Show the code
<- read.csv('data/vaccine_clean.csv')
vaccine_df $Date <- as.Date(vaccine_df$Date)
vaccine_df#vaccine_df
<- ggplot(data = vaccine_df, aes(x=Date, y = total_doses)) +
g4 geom_line()+
labs(title = 'Daily COVID-19 Vaccination Number in US')
ggplotly(g4) %>% layout(hovermode = "x")
The time series of daily COVID-19 vaccination number in US shows an increasing trend in the beginning as more people become eligible for the vaccine and supply chains are established, peaked at 2021 April and then shows a decreasing trend. The data shows a cyclic pattern weekly, it reached the bottom at weekend and bounced up during the weekday. The trend of time series data roughly matches with the trend of MRNA.