Created
April 30, 2022 20:20
-
-
Save thlytras/8cb57e9fa9b736cf63f009b9db97597a to your computer and use it in GitHub Desktop.
Show EuroMOMO z-scores are autocorrelated
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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