ui.causal: Uncertainty intervals for Average Causal Effects

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ui.causal.R

Description

This function allows you to derive uncertainty intervals for the average causal effect (ACE) or the average causal effect on the treated (ACT). The function uses a regression imputation estimator and a doubly robust estimator. The uncertainty intervals can be used as a sensitivity analysis to unconfoundedness. Note that rho=0 render the same results as assuming no unobserved confounding.

Usage

1
2
3
ui.causal(out.formula, treat.formula, data, rho = c(-0.3, 0.3),
  rho0 = NULL, rho1 = NULL, ACT = FALSE, sand = TRUE, gridn = 21,
  plot = TRUE, rho.plotrange = c(-0.5, 0.5), alpha = 0.05)

Arguments

out.formula

Formula for the outcome regression models

treat.formula

Formula for the propensity score model (regression model for treatment assignment).

data

data.frame containing the variables in the formula.

rho

Pre-specified interval for rho0 and rho1.

rho0

Pre-specified value of rho0, if an interval it has to be the same as rho1.

rho1

Pre-specified value of rho1, if an interval it has to be the same as rho0.

ACT

If TRUE Average Causal effect of the Treated is calculated, if FALSE Average Causal effect is calculated. Default is FALSE.

sand

Specifies which estimator of the standard errors should be used for OR, see details.

gridn

Number of fixed points within the rho interval for which sigma0 and sigma1 should be estimated.

plot

If TRUE the function runs slightly slower but you will be able to plot your results using plot.uicausal.

rho.plotrange

an interval larger than rho for the plot using plot.uicausal.

alpha

Default 0.05 corresponding to a confidence level of 95 for CI and UI.

Details

In order to visualize the results, you can use plot.uicausal. Details about estimators can be found in Genbäck and de Luna (2018)

The standard errors are calculated with the following estimators:

DR ACE - simplified sandwich estimator

DR ACT - sandwich estimator

OR ACE - if sand=TRUE sandwich estimator (default and recommended), if sand=FALSE large sample variance

OR ACT - if sand=TRUE sandwich estimator (default and recommended), if sand=FALSE large sample variance

Value

A list containing:

call

The matched call

rho0

The rage of rho0 from which the ui is calculated

rho1

If ACT==FALSE,range of rho1 from which the ui is calculated

out.model0

Outcome regression model for non-treated.

out.model1

Outcome regression model for treated.

treat.model

Regression model for treatment mechanism (propensity score).

sigma0

Consistent estimate of sigma0 for different values of rho0

sigma1

Consistent estimate of sigma1 for different values of rho1

DR

DR inference, confidence intervals for different pre-specified values of rho for the OR estimator, uncertainty interval, coefficient estimates, confounding bias, indentification interval, standard error etc.

OR

OR inference, confidence intervals for different pre-specified values of rho for the OR estimator, uncertainty interval, coefficient estimates, confounding bias, indentification interval, standard error etc.

Author(s)

Minna Genbäck

References

Genbäck, M., de Luna, X. (2018). Causal Inference Accounting for Unobserved Confounding after Outcome Regression and Doubly Robust Estimation. Biometrics. DOI: 10.1111/biom.13001

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
library(MASS)
n<-500
delta<-c(-0.3,0.65)
rho<-0.3
X<-cbind(rep(1,n),rnorm(n))
x<-X[,-1]
s0<-2
s1<-3
error<-mvrnorm(n, c(0,0,0), matrix(c(1,0.6,0.9,0.6,4,0.54,0.9,0.54,9), ncol=3))
zstar<-X%*%delta+error[,1]
z<- zstar>0
y1<-ifelse(x< (-1),0.2*x-0.1*x^2, ifelse(x< 1,0.3*x, ifelse(x<3,0.4-0.1*x^2,-0.2-0.1*x)))+error[,3]
y0<-ifelse(x<1.5, x-0.4*x^2, ifelse(x<2, -0.15-0.25*x+0.5*x^2, 1.85-0.25*x))+error[,2]
y<-y0
y[z==1]<-y1[z==1]
data<-data.frame(y,z,x)


ui<-ui.causal(y~x, z~x, data=data, rho=c(0,0.3), ACT=FALSE)
ui
plot(ui)
profile(ui)
mean(y1-y0)

ui<-ui.causal(y~x, z~x, data=data, rho=c(0,0.3), ACT=TRUE)
ui
plot(ui)
mean(y1[z==1]-y0[z==1])

ui documentation built on Nov. 11, 2019, 5:07 p.m.

Related to ui.causal in ui...