MyNixOS website logo
Description

Causal Decomposition of Group Disparities.

The framework of causal decomposition of group disparities developed by Yu and Elwert (2023) <doi:10.48550/arXiv.2306.16591>. This package implements the decomposition estimators that are based on efficient influence functions. For the nuisance functions of the estimators, both parametric and nonparametric options are provided, as well as manual options in case the default models are not satisfying.

cdgd

R-CMD-check CRAN Downloadsoverall

The package cdgd implements the causal decompositions of group disparities in Yu and Elwert (2023).

Installation

The latest release of the package can be installed through CRAN.

install.packages("cdgd")

The current development version can be installed from source using devtools.

devtools::install_github("ang-yu/cdgd")

Examples

library(cdgd)  

# load the simulated example data
data(exp_data)
head(exp_data)
#>       outcome treatment  confounder          Q group_a
#> 748 1.4608165         1  0.26306864  0.6748330       0
#> 221 0.4777308         0  1.30296394  0.5920512       1
#> 24  0.8760129         1 -1.49971226  1.6294327       1
#> 497 0.4131192         1 -1.17219619 -0.8391873       1
#> 249 2.0483222         1  1.71790879  2.9546966       1
#> 547 0.1912013         0 -0.02438458 -0.3704544       0

Use cdgd0_ml, cdgd0_pa, or cdgd0_manual for unconditional decomposition

results0 <- cdgd0_pa(Y="outcome",D="treatment",G="group_a",X=c("confounder","Q"),data=exp_data,alpha=0.05)

round(results0$results, 4)
#>              point     se p_value CI_lower CI_upper
#> total       0.2675 0.0390  0.0000   0.1911   0.3439
#> baseline    0.0421 0.0131  0.0013   0.0164   0.0678
#> prevalence  0.2579 0.0337  0.0000   0.1919   0.3240
#> effect     -0.1372 0.0209  0.0000  -0.1781  -0.0963
#> selection   0.1047 0.0150  0.0000   0.0754   0.1340

Use cdgd1_ml, cdgd1_pa, or cdgd1_manual for conditional decomposition

results1 <- cdgd1_pa(Y="outcome",D="treatment",G="group_a",X="confounder",Q="Q",data=exp_data,alpha=0.05)

round(results1, 4)
#>                                 point     se p_value CI_lower CI_upper
#> total                          0.2675 0.0390  0.0000   0.1911   0.3439
#> baseline                       0.0421 0.0131  0.0013   0.0164   0.0678
#> conditional prevalence         0.2032 0.0371  0.0000   0.1305   0.2760
#> conditional effect            -0.1644 0.0220  0.0000  -0.2076  -0.1212
#> conditional selection          0.0875 0.0143  0.0000   0.0595   0.1156
#> Q distribution                 0.0990 0.0188  0.0000   0.0621   0.1359
#> conditional Jackson reduction  0.2362 0.0378  0.0000   0.1621   0.3103
Metadata

Version

0.3.5

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows