uoe-digicat / DigiCAT

digital counterfactual analysis tool
Apache License 2.0
0 stars 0 forks source link

Digital Counterfactual Analysis Tool: DigiCAT

Counterfactual Analysis

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.

Our App

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.

Getting Started

Currently, DigiCAT is available as an Shiny app, both online and as a downloadable R package.

Online Tool

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.

Local 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.

1. Install DigiCAT

install.packages("remotes")
remotes::install_github("uoe-digicat/DigiCAT")
library(DigiCAT)

2. Run DigiCAT locally

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/")

Container platform

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.

From the command line

1. Install Docker

https://docs.docker.com/get-docker/

Download DigiCAT

This can be done from the command line and requires approximately 3 gigabytes of storage.

docker pull digicatuoe/digicat_tool:latest
3. Run DigiCAT

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.

From Docker Desktop

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

DigiCAT Tutorial

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.

Contact

If you have any questions or feedback, please get in touch!

Email: uoe_digicat-group\@uoe.onmicrosoft.com

Package Structure

DESCRIPTION file

Contains overall metadata about the DigiCAT package, such as package dependencies.

NAMESPACE file

Contains the names of functions exported by the DigiCAT package and imported packages.

R/ directory

This folder contains all R scripts (.R files) that will be sourced when the DigiCAT package is installed.

Main counterfactual analysis scripts

mod_* files

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).

data/ directory

This folder contains the sample dataset 'zp_eg'. Visit our tutorial to find out more about this dataset.

inst/DigiCAT directory

Contains

man/ directory

This folder contains documentation for the functions exported from the DigiCAT package.