Time after time: calculating the autocorrelation function for uneven or grouped time series

Checking for autocorrelation must be done carefully when some observations are missing from a time series or the time series is measured for independent groups. I show an approach where I pad the dataset with NA via tidyr::complete() to fill in any missed sampling times and make sure groups are considered independent prior to calculating the autocorrelation function.

Ariel Muldoon

I currently work as an applied statistician in aviation and aeronautics. In a previous role as a consulting statistician in academia I created and taught R workshops for applied science graduate students who are just getting started in R, where my goal was to make their transition to a programming language as smooth as possible. See these workshop materials at my website.