The aim of counterfactual analysis is to estimate the causal effects of interventions or treatments, by comparing what actually happened (observed outcomes) with what would have happened if a different action had been taken (counterfactual outcomes). In observational settings, where random allocation into different treatments is not possible, researchers often employ methods involving 'propensity scores' (the estimated probability of receiving the treatment/intervention, based on a set of observed covariates). These propensity scores can then be used in an analysis to balance the characteristics of treatment vs non-treated groups, reducing bias and enabling a more accurate estimation of the causal effect of receiving the treatment.
With the DigiCAT app, you can upload your own data and leverage propensity score methods to conduct counterfactual analyses, gaining insights into the causal effects of specific interventions or treatments. The primary objective of the DigiCAT app is to provide researchers, regardless of their statistical background, with a user-friendly platform that removes barriers and enables them to utilize these methods effectively.
Currently, DigiCAT is available as an Shiny app, both online and as a downloadable R package.
Our online tool allows users to use our example data to carry out counterfactual analysis. Please only use synthetic data if you wish to upload your own data to the online tool.
DigiCAT is available as a downloadable R package that enables users to run the tool locally and use real data. R (>= 3.3.0) required.
install.packages("remotes")
remotes::install_github("uoe-digicat/DigiCAT")
library(DigiCAT)
Once DigiCAT has been installed, the DigiCAT tool can be launched in RStudio or a browser. Launching the tool locally with 'enableLocal = TRUE' enables the upload local data for counterfactual analysis. If you would like to upload and analyse your own data, please specify the directory path, otherwise this will default to your home directory.
DigiCAT::run_DigiCAT(enableLocal = TRUE, filePath = "this/folder/contains/my/data/")
DigiCAT is also available as a container, meaning all required software is combined into a monolithic application. This means DigiCAT can be easily installed on new systems and is robust to updates in dependencies.
https://docs.docker.com/get-docker/
This can be done from the command line and requires approximately 3 gigabytes of storage.
docker pull digicatuoe/digicat_tool:latest
DigiCAT can now be run locally from the command line. Users must specify the file path containing the data they would like to upload and analyse in DigiCAT.
docker run -v </path/to/data>:/srv/shiny-server/home -p 3838:3838 digicatuoe/digicat_tool
Once running, visit http://0.0.0.0:3838/ or localhost:3838 in Google Chrome of Firefox to use the DigiCAT tool.
DigiCAT can also be run from Docker Desktop. Please watch the guide below for guidance on how to do this.
https://github.com/uoe-digicat/DigiCAT/assets/53822789/595fbc6b-2d7e-4e36-b9f4-3bf622f79fb9
To learn more about counterfactual analysis and the DigiCAT tool, please visit our tutorial. Here you will find a comprehensive guide to the counterfactual analysis provided in our digital tool.
If you have any questions or feedback, please get in touch!
Email: uoe_digicat-group\@uoe.onmicrosoft.com
Contains overall metadata about the DigiCAT package, such as package dependencies.
Contains the names of functions exported by the DigiCAT package and imported packages.
This folder contains all R scripts (.R files) that will be sourced when the DigiCAT package is installed.
propensity_estimation_stage.R: Contains the function 'estimation_stage()' which calculates the propensity score (or likelihood of belonging to the treatment group) for each individual in the sample data, based on the matching variables provided.
balance_data.R: Contains the function 'balance_data()' which balances datasets for counterfactual analysis in DigiCAT..
outcome_analysis_stage.R: Contains the function ''outcome_analysis_stage()' which runs the outcome model for counterfactual analysis in DigiCAT.
Modules for each analysis page: Get Started (mod_home.R), Data Upload (mod_data_upload.R), Approach (mod_counterfactual_approach.R), Balancing (mod_balancing.R) and Outcome (mod_outcome_model.R).
This folder contains the sample dataset 'zp_eg'. Visit our tutorial to find out more about this dataset.
Contains
This folder contains documentation for the functions exported from the DigiCAT package.