Skip to content

Instantly share code, notes, and snippets.

@thlytras
Created April 30, 2022 20:20
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 thlytras/8cb57e9fa9b736cf63f009b9db97597a to your computer and use it in GitHub Desktop.
Save thlytras/8cb57e9fa9b736cf63f009b9db97597a to your computer and use it in GitHub Desktop.
Show EuroMOMO z-scores are autocorrelated
# Data from: https://www.euromomo.eu/graphs-and-maps/#z-scores-by-country
dat <- read.csv2("charts-z-scores-by-country.csv")
dat$zscore <- as.numeric(dat$zscore)
png("autocorr-EuroMOMO.png", width=3000, height=1500, pointsize=15)
par(mfcol=c(7,4), family="Fira Sans", mar=c(4,4,3,2))
lapply(unique(dat$country), function(x) {
acf(subset(dat, country==x)$zscore, main=x, na.action=na.omit, xlab=NA, bty="l")
mtext("Lag (weeks)", side=1, line=1.5, cex=0.8, adj=1)
})
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment