Title: | Proximal Causal Learning |
---|---|
Description: | We fit causal models using proxies. We implement two stage proximal least squares estimator. E.J. Tchetgen Tchetgen, A. Ying, Y. Cui, X. Shi, and W. Miao. (2020). An Introduction to Proximal Causal Learning. arXiv e-prints, arXiv-2009 <arXiv:2009.10982>. |
Authors: | Andrew Ying [aut, cre], Yifan Cui [ctb], AmirEmad Ghassami [ctb] |
Maintainer: | Andrew Ying <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0 |
Built: | 2025-03-08 02:28:53 UTC |
Source: | https://github.com/cran/PCL |
Create a proximal causal learning object, usually used as a variable in a model function. Argument matching
pcl(outcome, trt, trt_pxy, out_pxy, covariates)
pcl(outcome, trt, trt_pxy, out_pxy, covariates)
outcome |
the outcome variable |
trt |
the binary treatment variable |
trt_pxy |
the treatment-inducing proxies |
out_pxy |
the outcome-inducing proxies |
covariates |
the observed confounders |
pcl returns an object of class "pcl", which wraps the treatment, outcome, treatment inducing confounding proxies, outcome inducing confounding proxies and other covariates
n <- 100 outcome <- rnorm(n, 0, 1) trt <- rbinom(n, 1, 0.5) trt_pxy <- rnorm(n, 0, 1) out_pxy <- rnorm(n, 0, 1) covariates <- rnorm(n, 0, 1) pcl_object <- pcl(outcome, trt, trt_pxy, out_pxy, covariates)
n <- 100 outcome <- rnorm(n, 0, 1) trt <- rbinom(n, 1, 0.5) trt_pxy <- rnorm(n, 0, 1) out_pxy <- rnorm(n, 0, 1) covariates <- rnorm(n, 0, 1) pcl_object <- pcl(outcome, trt, trt_pxy, out_pxy, covariates)
Fit a proximal causal learning model
pclfit(pcl_object, method = "POR")
pclfit(pcl_object, method = "POR")
pcl_object |
an pcl object |
method |
method used to fit |
returns the average causal effect
n <- 100 outcome <- rnorm(n, 0, 1) trt <- rbinom(n, 1, 0.5) trt_pxy <- matrix(rnorm(n, 0, 1), ncol = 1) out_pxy <- matrix(rnorm(n, 0, 1), ncol = 1) covariates <- matrix(rnorm(n, 0, 1), ncol = 1) pcl_object <- pcl(outcome, trt, trt_pxy, out_pxy, covariates) fit <- pclfit(pcl_object)
n <- 100 outcome <- rnorm(n, 0, 1) trt <- rbinom(n, 1, 0.5) trt_pxy <- matrix(rnorm(n, 0, 1), ncol = 1) out_pxy <- matrix(rnorm(n, 0, 1), ncol = 1) covariates <- matrix(rnorm(n, 0, 1), ncol = 1) pcl_object <- pcl(outcome, trt, trt_pxy, out_pxy, covariates) fit <- pclfit(pcl_object)