Skip to contents

Analysis Functions

Functions for analyzing relationships between time series

cross_corr()
Determine cross correlation between two time series for different lags
rolling_corr()
Calculate rolling correlation between two time series by group
estimate_rt()
Estimate reproduction over time by group
calc_percent_change()
Convert a count variable into percent change relative to baseline

Visualization

Functions for visualizing results

plot_corr()
This function plots the two time series and correlation over time There are optional arguments for confidence bands on x_var and customisation of the maximum value of the y-axis and labels for the facets of grp_var
plot_lag()
This function plots the lags by grp_var

Data

Example datasets included in the package

china_case_data
Daily confirmed cases of COVID-19 in China
exante_movement_data
Daily within-city movement data for different regions in China