library(ggplot2)
library(lubridate)
library(readxl)
library(gridExtra)
library(ggpubr)
library(naniar)
library(tidyr)
library(dplyr)
library(ggrepel)## # A tibble: 6 × 5
## AVERAGE Period Mean Confidence_interval SE
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 Australia - ACORN* 6-mo 0.29 0.0153 0.0047
## 2 England* 6-mo 0.268 0.00223 0
## 3 Canada - Alberta 12-mo 0.260 0.0185 0.01
## 4 Netherlands 12-mo 0.263 0.00603 0
## 5 Sweden 12-mo 0.195 0.00642 0
## 6 Canada - Manitoba~ 12-mo 0.205 0.0170 0
ggplot(fig23, aes(x = AVERAGE, y = Mean)) +
geom_point() +
labs(x = "Country", y = "Mean") +
ggtitle("Hip replacement mean, by country")ggplot(fig23, aes(x = AVERAGE, y = Mean)) +
geom_bar(stat = "identity") +
labs(x = "Country", y = "Mean") +
ggtitle("Hip replacement mean by country") +
theme_minimal()ggplot(fig23, aes(x = AVERAGE, y = Mean)) +
geom_bar(stat = "identity") +
geom_errorbar(
aes(ymin = Mean - Confidence_interval, ymax = Mean + Confidence_interval),
width = 0.1
) +
labs(x = "Country", y = "Mean") +
ggtitle(
"Hip replacement: adjusted mean change between pre- and post-operative EQ-5D-3L scores (US valuation), with 95% confidence intervals"
) +
theme_minimal()fig25 <- read_excel("Week 4.xlsx", sheet = "Fig2.5")
fig25subset <- subset(
fig25,
country %in% c("Israel", "United States Of America", "United Kingdom")
)
fig25subset <- subset(fig25subset, indicator == "cases")
fig25subset <- separate(fig25subset, col = year_week, into = c("Year", "Week"), sep = "-")
fig25subset$Year <- as.numeric(fig25subset$Year)
fig25subset$Week <- as.numeric(fig25subset$Week)
fig25subset$Weeknew <- ifelse(
fig25subset$Year == 2021, fig25subset$Week + 52,
ifelse(fig25subset$Year == 2022, fig25subset$Week + 104, fig25subset$Week)
)ggplot(fig25subset, aes(x = Weeknew, y = weekly_count, fill = Year, color = Year)) +
geom_point() +
facet_wrap(~country) +
geom_line()fig216 <- read_excel("Week 4.xlsx", sheet = "Fig2.16")
fig216 <- fig216 %>%
mutate(`2019` = ifelse(`2019` == "..", NA, `2019`))
fig216$`2019` <- as.numeric(fig216$`2019`)
long_fig216 <- fig216 %>% gather(Year, Proportion, "2018":"2019")
ggplot(long_fig216, aes(x = Country, y = Proportion, fill = Year)) +
geom_bar(stat = "identity", position = position_dodge(), na.rm = TRUE) +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))fig319 <- read_excel("Week 4.xlsx", sheet = "Fig3.19")
fig319$year2020 <- fig319$`2020`
fig319$year2021 <- fig319$`2021`
fig319$precovid <- fig319$`Pre-COVID-19`
long_fig319 <- fig319 %>% gather(Type, Prevalence, year2020:precovid)
ggplot(long_fig319, aes(x = Country, y = Prevalence, fill = Type)) +
geom_bar(stat = "identity", position = "dodge") +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))fig39 <- read_excel("Week 4.xlsx", sheet = "Fig3.9")
ggplot(fig39, aes(x = "", y = Percentage, fill = Causes)) +
geom_bar(stat = "identity", width = 1, color = "white", na.rm = TRUE) +
coord_polar("y", start = 0) +
theme_void()fig59 <- read_excel("Week 4.xlsx", sheet = "Fig5.9")
long_fig59 <- fig59 %>% gather(Type, OOP, "Medical Goods":"Other")
ggplot(long_fig59, aes(fill = Type, y = OOP, x = Country)) +
geom_bar(position = "fill", stat = "identity") +
theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))LifeExp <- read_excel("Week 4.xlsx", sheet = "LifeExp")
SpendGDP <- read_excel("Week 4.xlsx", sheet = "SpendGDP")
fig17 <- merge(x = LifeExp, y = SpendGDP, by = "Country")
fig17$Life_Exp2017 <- fig17$`2017`
fig17$GDP_Health <- fig17$Total
ggplot(fig17, aes(Life_Exp2017, GDP_Health)) +
labs(x = "Life Expectancy (2017)", y = "% of GDP Spent in Health") +
ggtitle("Life expectancy and Health expenditure") +
geom_hline(yintercept = 10, color = "lightgrey", size = 1.5) +
geom_vline(xintercept = 75, color = "lightgrey", size = 1.5) +
geom_point() +
geom_text_repel(aes(label = Country)) +
geom_smooth(method = lm)