Type: | Package |
Title: | Proximal Causal Learning |
Version: | 1.0 |
Date: | 2021-04-04 |
Maintainer: | Andrew Ying <aying9339@gmail.com> |
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 <doi:10.48550/arXiv.2009.10982>. |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Depends: | R (≥ 4.0) |
RoxygenNote: | 7.1.1 |
Encoding: | UTF-8 |
NeedsCompilation: | no |
Packaged: | 2021-04-09 00:59:22 UTC; andrewying |
Author: | Andrew Ying [aut, cre], Yifan Cui [ctb], AmirEmad Ghassami [ctb] |
Repository: | CRAN |
Date/Publication: | 2021-04-10 07:50:10 UTC |
This function is to compute mean squared error
Description
This function is to compute mean squared error
Usage
MSE_func(bridge_func, para, Y, W, Z)
Value
returns mean squared error
This function is to compute estimating equation of outcome-inducing confounding bridge function
Description
This function is to compute estimating equation of outcome-inducing confounding bridge function
Usage
hbridge(para, Y, W, Z)
Value
returns the sample level estimating equations for q function
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)
This function is to compute estimating equation of treatment-inducing confounding bridge function
Description
This function is to compute estimating equation of treatment-inducing confounding bridge function
Usage
qbridge(para, Y, W, Z)
Value
returns the sample level estimating equations for q function