Package 'PCL'

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

Help Index


Create a Proximal Causal Learning Object

Description

Create a proximal causal learning object, usually used as a variable in a model function. Argument matching

Usage

pcl(outcome, trt, trt_pxy, out_pxy, covariates)

Arguments

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

Value

pcl returns an object of class "pcl", which wraps the treatment, outcome, treatment inducing confounding proxies, outcome inducing confounding proxies and other covariates

Examples

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

Description

Fit a proximal causal learning model

Usage

pclfit(pcl_object, method = "POR")

Arguments

pcl_object

an pcl object

method

method used to fit

Value

returns the average causal effect

Examples

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)