Quick Control Charts for AFL
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Who doesn’t like a wikipedia entry control chart If analysis of the control chart indicates that the process is currently under control (i.e., is stable, with variation only coming from sources common to the process), then no corrections or changes to process control parameters are needed or desired
I mean gee whiz this sure could relate to something like I don’t know AFL total game scores?
There seems to always be talk about the scores in AFLM see AFL website, foxsports just to name a couple. Of course you could find more if you searched out for it as well.
Let’s use fitzRoy and the good people over at statsinsder who have kindly provided me with the expected score data you can get from the herald sun.
First thing, lets use fitzRoy
library(fitzRoy) library(tidyverse) ## ── Attaching packages ──────────────── tidyverse 1.2.1 ── ## ✔ ggplot2 3.1.0 ✔ purrr 0.3.2 ## ✔ tibble 2.1.1 ✔ dplyr 0.8.0.1 ## ✔ tidyr 0.8.3 ✔ stringr 1.4.0 ## ✔ readr 1.3.1 ✔ forcats 0.4.0 ## ── Conflicts ─────────────────── tidyverse_conflicts() ── ## ✖ dplyr::filter() masks stats::filter() ## ✖ dplyr::lag() masks stats::lag() library(ggQC) fitzRoy::match_results%>% mutate(total=Home.Points+Away.Points)%>% group_by(Season,Round)%>% summarise(meantotal=mean(total))%>% filter(Season>1989 & Round=="R1")%>% ggplot(aes(x=Season,y=meantotal))+geom_point()+geom_line()+stat_QC(method="XmR")+ylab("Mean Round 1 Total for Each Game") +ggtitle("Stop Freaking OUT over ONE ROUND")
So if we were to look at the control chart just for round 1 in each AFLM season since the 90s it would seem as though that even though this round was lower scoring that there isn’t much too see here.
After all we can and should expect natural variation in scores, wouldn’t footy be boring if scores were the same every week.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.