Detects changes in time series using the R package gets (https://cran.r-project.org/web/packages/gets/index.html). Uses a combination of Google BigQuery and Python to query data, which is then fed to the R change detection code. Outputs a table containing results
Python with an associated install of R. I've used Anaconda to do this.
- ebmdatalab library https://github.com/ebmdatalab/datalab-pandas
- zoo
- caTools
- gets
See https://github.com/ebmdatalab/prescribing_change_metrics/blob/master/change_speed_metrics.ipynb for example of use
- Queries data from BigQuery, either by:
- creating a SQL query in the queries folder, query must produce a table with only the fields
code
month
numerator
anddenominator
- querying any number of the OpenPrescribing measures
- creating a SQL query in the queries folder, query must produce a table with only the fields
- Reshapes data with Pandas
- Splits data into chunks and passes each chunk to the R change detection code
- The resulting output is then extracted with further R code
- The R outputs are then concatenated