All Projects → ngreifer → cobalt

ngreifer / cobalt

Licence: other
Covariate Balance Tables and Plots - An R package for assessing covariate balance

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to cobalt

SIN
Causal Effect Inference for Structured Treatments (SIN) (NeurIPS 2021)
Stars: ✭ 32 (-38.46%)
Mutual labels:  causal-inference
cibookex-r
Causal Inference: What If. R and Stata code for Exercises
Stars: ✭ 54 (+3.85%)
Mutual labels:  causal-inference
causal-learn
Causal Discovery for Python. Translation and extension of the Tetrad Java code.
Stars: ✭ 428 (+723.08%)
Mutual labels:  causal-inference
policytree
Policy learning via doubly robust empirical welfare maximization over trees
Stars: ✭ 59 (+13.46%)
Mutual labels:  causal-inference
drtmle
Nonparametric estimators of the average treatment effect with doubly-robust confidence intervals and hypothesis tests
Stars: ✭ 14 (-73.08%)
Mutual labels:  causal-inference
Causal Reading Group
We will keep updating the paper list about machine learning + causal theory. We also internally discuss related papers between NExT++ (NUS) and LDS (USTC) by week.
Stars: ✭ 339 (+551.92%)
Mutual labels:  causal-inference
causeinfer
Machine learning based causal inference/uplift in Python
Stars: ✭ 45 (-13.46%)
Mutual labels:  causal-inference
CIKM18-LCVA
Code for CIKM'18 paper, Linked Causal Variational Autoencoder for Inferring Paired Spillover Effects.
Stars: ✭ 13 (-75%)
Mutual labels:  causal-inference
evalsp20.classes.andrewheiss.com
🎓 GSU MPA/MPP course on program evaluation and causal inference
Stars: ✭ 22 (-57.69%)
Mutual labels:  causal-inference
doubleml-for-r
DoubleML - Double Machine Learning in R
Stars: ✭ 58 (+11.54%)
Mutual labels:  causal-inference
SyntheticControlMethods
A Python package for causal inference using Synthetic Controls
Stars: ✭ 90 (+73.08%)
Mutual labels:  causal-inference
CausalityTools.jl
Algorithms for causal inference and the detection of dynamical coupling from time series, and for approximation of the transfer operator and invariant measures.
Stars: ✭ 45 (-13.46%)
Mutual labels:  causal-inference
doubleml-for-py
DoubleML - Double Machine Learning in Python
Stars: ✭ 129 (+148.08%)
Mutual labels:  causal-inference
RECCON
This repository contains the dataset and the PyTorch implementations of the models from the paper Recognizing Emotion Cause in Conversations.
Stars: ✭ 126 (+142.31%)
Mutual labels:  causal-inference
paradox
ParamHelpers Next Generation
Stars: ✭ 23 (-55.77%)
Mutual labels:  experimental-design
causal-ml
Must-read papers and resources related to causal inference and machine (deep) learning
Stars: ✭ 387 (+644.23%)
Mutual labels:  causal-inference
Awesome-Neural-Logic
Awesome Neural Logic and Causality: MLN, NLRL, NLM, etc. 因果推断,神经逻辑,强人工智能逻辑推理前沿领域。
Stars: ✭ 106 (+103.85%)
Mutual labels:  causal-inference
Python-for-Epidemiologists
Tutorial in Python targeted at Epidemiologists. Will discuss the basics of analysis in Python 3
Stars: ✭ 107 (+105.77%)
Mutual labels:  causal-inference
pcalg-py
Implement PC algorithm in Python | PC 算法的 Python 实现
Stars: ✭ 52 (+0%)
Mutual labels:  causal-inference
drnet
💉📈 Dose response networks (DRNets) are a method for learning to estimate individual dose-response curves for multiple parametric treatments from observational data using neural networks.
Stars: ✭ 48 (-7.69%)
Mutual labels:  causal-inference

cobalt: Covariate Balance Tables and Plots

CRAN_Status_Badge CRAN_Downloads_Badge

Overview

Welcome to cobalt, which stands for Covariate Balance Tables (and Plots). cobalt allows users to assess balance on covariate distributions in preprocessed groups generated through weighting, matching, or subclassification, such as by using the propensity score. cobalt’s primary function is bal.tab(), which stands for “balance table”, and is meant to replace (or supplement) the balance assessment tools found in other R packages. To examine how bal.tab() integrates with these packages and others, see the help file for bal.tab() with ?bal.tab, which links to the methods used for each package. Each page has examples of how bal.tab() is used with the package. There are also five vignettes detailing the use of cobalt, which can be accessed at vignette("cobalt"): one for basic uses of cobalt, one for the use of cobalt with additional packages, one for the use of cobalt with multiply imputed and/or clustered data, one for the use of cobalt with longitudinal treatments, and one for the use of cobalt to generate publication-ready plots. Currently, cobalt is compatible with output from MatchIt, twang, Matching, optmatch, CBPS, ebal, WeightIt, designmatch, sbw, MatchThem, and cem as well as data not processed through these packages.

Why cobalt?

Most of the major conditioning packages contain functions to assess balance; so why use cobalt at all? cobalt arose out of several desiderata when using these packages: to have standardized measures that were consistent across all conditioning packages, to allow for flexibility in the calculation and display of balance measures, and to incorporate recent methodological recommendations in the assessment of balance. In addition, cobalt has unique plotting capabilities that make use of ggplot2 in R for balance assessment and reporting.

Because conditioning methods are spread across several packages which each have their idiosyncrasies in how they report balance (if at all), comparing the resulting balance from various conditioning methods can be a challenge. cobalt unites these packages by providing a single, flexible tool that intelligently processes output from any of the conditioning packages and provides the user with both useful defaults and customizable options for display and calculation. cobalt also allows for balance assessment on data not generated through any of the conditioning packages. In addition, cobalt has tools for assessing and reporting balance for clustered data sets, data sets generated through multiple imputation, and data sets with a continuous treatment variable, all features that exist in very limited capacities or not at all in other packages.

A large focus in developing cobalt was to streamline output so that only the most useful, non-redundant, and complete information is displayed, all at the user’s choice. Balance statistics are intuitive, methodologically informed, and simple to interpret. Visual displays of balance reflect the goals of balance assessment rather than being steps removed. While other packages have focused their efforts on processing data, cobalt only assesses balance, and does so particularly well.

New features are being added all the time, following the cutting edge of methodological work on balance assessment. As new packages and methods are developed, cobalt will be ready to integrate them to further our goal of simple, unified balance assessment.

Examples

Below are examples of cobalt’s primary functions:

library("cobalt")
library("MatchIt")
data("lalonde", package = "cobalt")

# Nearest neighbor matching with MatchIt
m.out <- matchit(treat ~ age + educ + race + married + nodegree + re74 + re75, data = lalonde)

# Checking balance before and after matching:
bal.tab(m.out, thresholds = c(m = 0.1), un = TRUE)
#> Call
#>  matchit(formula = treat ~ age + educ + race + married + nodegree + 
#>     re74 + re75, data = lalonde)
#> 
#> Balance Measures
#>                 Type Diff.Un Diff.Adj        M.Threshold
#> distance    Distance  1.7941   0.9739                   
#> age          Contin. -0.3094   0.0718     Balanced, <0.1
#> educ         Contin.  0.0550  -0.1290 Not Balanced, >0.1
#> race_black    Binary  0.6404   0.3730 Not Balanced, >0.1
#> race_hispan   Binary -0.0827  -0.1568 Not Balanced, >0.1
#> race_white    Binary -0.5577  -0.2162 Not Balanced, >0.1
#> married       Binary -0.3236  -0.0216     Balanced, <0.1
#> nodegree      Binary  0.1114   0.0703     Balanced, <0.1
#> re74         Contin. -0.7211  -0.0505     Balanced, <0.1
#> re75         Contin. -0.2903  -0.0257     Balanced, <0.1
#> 
#> Balance tally for mean differences
#>                    count
#> Balanced, <0.1         5
#> Not Balanced, >0.1     4
#> 
#> Variable with the greatest mean difference
#>    Variable Diff.Adj        M.Threshold
#>  race_black    0.373 Not Balanced, >0.1
#> 
#> Sample sizes
#>           Control Treated
#> All           429     185
#> Matched       185     185
#> Unmatched     244       0
# Examining distributional balance with plots:
bal.plot(m.out, var.name = "educ")
bal.plot(m.out, var.name = "distance", mirror = TRUE, type = "histogram")

# Generating a Love plot to report balance:
love.plot(m.out, stats = c("mean.diffs", "variance.ratios"), thresholds = c(m = 0.1, 
    v = 2), abs = TRUE, binary = "std", var.order = "unadjusted")

Please remember to cite this package when using it to analyze data. For example, in a manuscript, you could write: “Matching was performed using the Matching package (Sekhon, 2011), and covariate balance was assessed using cobalt (Greifer, 2021), both in R (R Core Team, 2020).” Use citation("cobalt") to generate a bibliographic reference for the cobalt package.

Bugs appear in cobalt occasionally, often found by users. Please report any bugs at https://github.com/ngreifer/cobalt/issues. To install the latest development version of cobalt, which may have removed a bug you’re experiencing, use the following code:

devtools::install_github("ngreifer/cobalt")
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].