Skip to content

Instantly share code, notes, and snippets.

@cavedave
Last active November 13, 2021 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cavedave/9fbd53dbccc6678a7504205e1254559d to your computer and use it in GitHub Desktop.
Save cavedave/9fbd53dbccc6678a7504205e1254559d to your computer and use it in GitHub Desktop.
European Countries Covid Vaccination Rates. Vaccine take-up, from west to east. Model this asked marginalrevolution about this tweet https://twitter.com/MacaesBruno/status/1458773133897478149
Country vaccinated long lat
Denmark 77.4 10.445 55.728
Belgium 75.2 4.39 50.86
Austria 66.5 15.3 47.97
Croatia 48.4 16.173 45.567
Albania 36.1 19.8 41.28
Belarus 29.2 27.56 53.9
Bosnia 24.4 18.41 43.86
Iceland 82.5 -21.95 64.15
Ireland 76.8 -7.063 53.208
Finland 76.6 25.064 61.139
France 76.1 2.562 47.836
Germany 69.2 9.329 51.036
Hungary 62.1 19.117 47.455
Estonia 61.2 24.949 59.349
Portugal 88.9 -8.436 39.964
Malta 83.8 14.467 35.886
Italy 77.5 12.128 43.679
Norway 77.1 10.392 59.946
Netherlands 75.9 5.182 52.081
Luxembourg 70.1 6.11 49.6
Lithuania 68 23.993 55.013
Liechtenstein 66.3 9.512 47.16
Latvia 65.2 24.166 56.923
Poland 54 19.378 51.652
Montenegro 41.8 19.26 42.43
North Macedonia 40.9 21.42 41.99
Spain 81.5 -3.583 40.389
United Kingdom 73.8 -1.317 52.442
Sweden 71.6 15.562 59.105
Switzerland 66 8.06 47.15
Turkey 65.5 32.86 39.93
Slovenia 57.7 14.825 46.143
Serbia 46.5 20.8 44.83
Slovakia 46.3 18.781 48.768
Russia 40.4 37.6 55.75
Romania 36.9 25.591 45.510
Bulgaria 22.2 24.87 42.58
Czechia 59.3 15.25 49.96
Kosovo 47.3 20.878 42.539
Greece 65.1 21.8 39
Ukraine 27.3 30.5 50.4
vaccine <- read.csv("vaccine.csv",header=TRUE)
res <- cor(vaccine$vaccinated,vaccine$long)
res
#lat 0.24
#long -0.66
library(ggplot2)
p<-ggplot(vaccine, aes(x=long, y=vaccinated)) + geom_point()+ geom_smooth(method="lm", se=False)
p<-p + ggtitle("European Covid Vaccination Rates West->East") +
ylab("% Vaccinated") + xlab("Longitude of Countries Population") +theme_bw()+ theme(plot.title = element_text(hjust = 0.5))
p<-p + annotate(geom="text", x=-19, y=80, label="Iceland",
color="black",size = 3.5)
p<-p + annotate(geom="text", x=31, y=63, label="Turkey",
color="black",size = 3.5)
#Russia 40.4 37.6
p<-p + annotate(geom="text", x=36, y=38, label="Russia",
color="black",size = 3.5)
#Bulgaria 22.2 24.87
p<-p + annotate(geom="text", x=24.5, y=22.0, label="Bulgaria",
color="black",size = 3.5)
#Bosnia 24.4 18.41
p<-p + annotate(geom="text", x=19, y=24, label="Bosnia",
color="black",size = 3.5)
#Serbia 46.5 20.8
p<-p + annotate(geom="text", x=20, y=44, label="Serbia",
color="black",size = 3.5)
#Portugal 88.9 -8.436
p<-p + annotate(geom="text", x=-8, y=92, label="Portugal",
color="black",size = 3.5)
#Malta 83.8 14.467
p<-p + annotate(geom="text", x=14, y=87, label="Malta",
color="black",size = 3.5)
#United Kingdom 73.8 -1.317
p<-p + annotate(geom="text", x=-1, y=71, label="UK",
color="black",size = 3.5)
#Ireland 76.8 -7.063
p<-p + annotate(geom="text", x=-7, y=74, label="Ireland",
color="black",size = 3.5)
#Finland 76.6 25.064
p<-p + annotate(geom="text", x=25, y=74, label="Finland",
color="black",size = 3.5)
#France 76.1 2.562
p<-p + annotate(geom="text", x=2.5, y=78, label="France",
color="black",size = 3.5)
#Germany 69.2 9.329
p<-p + annotate(geom="text", x=9, y=64, label="Germany",
color="black",size = 3.5)
#Italy 77.5 12.128
p<-p + annotate(geom="text", x=12, y=75, label="Italy",
color="black",size = 3.5)
#Poland 54 19.378
p<-p + annotate(geom="text", x=17, y=53, label="Poland",
color="black",size = 3.5)
#Spain 81.5 -3.583
p<-p + annotate(geom="text", x=-3, y=85, label="Spain",
color="black",size = 3.5)
#Romania 36.9 25.591
p<-p + annotate(geom="text", x=25, y=34, label="Romania",
color="black",size = 3.5)
#Belarus 29.2 27.56
p<-p + annotate(geom="text", x=28, y=25.2, label="Belarus",
color="black",size = 3.5)
#Montenegro 41.8 19.26
p<-p + annotate(geom="text", x=19, y=40, label="Montenegro",
color="black",size = 3.5)
#Sweden 71.6 15.562
p<-p + annotate(geom="text", x=15, y=70, label="Sweden",
color="black",size = 3.5)
#Ukraine 27.3 30.5
p<-p + annotate(geom="text", x=26, y=29, label="Ukraine",
color="black",size = 3.5)
#Latvia 65.2 24.166
p<-p + annotate(geom="text", x=24.166, y=64.9, label="Latvia",
color="black",size = 3.5)
p<-p + annotate(geom="text", x=35, y=10, label="data:ourworldindata\n cor:-0.66",
color="black",size = 2.5)
p
p
ggsave("TrustVaccinesEU.png")
@cavedave
Copy link
Author

TrustVaccinesEU

@cavedave
Copy link
Author

TrustVaccinesEU2

@cavedave
Copy link
Author

TrustVaccinesEU2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment