Skip to content

qkrcks0218/CRTBound

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRTBound

This Github repository contains CRTBound R package that implements the methodologies in Park and Kang (2021). We consider a cluster randomized trial (CRT) when both partial interference and noncompliance are present. In particular, the package focuses on the three types of the causal estimands:

  • Overall intent-to-Treat (ITT) Effect
  • Heteogeneous ITT effect
  • Compliance group ITT effects (i.e. network effects) arising from CRTs under the presence of interference and noncompliance

To infer the overall, heterogeneous ITT effects, we propose a modest extension of a nonparametric, regression-esque method based on Ding et al. (2019). In CRTBound package, the inference of the overall, heterogeneous ITT effects can be done by running ITT and HTE functions, respecitvely.

To infer the network effects, we use the classification-based bounding methods via linear programming. In CRTBound package, this method is implemented in SharpBound function. Additionally, we propose extensions of bounds by Grilli and Mealli (2008) and Long and Hudgens (2013) to CRT settings with interference. In CRTBound package, these methods are implemented in LongHudgens function. Lastly, by intersecting the bound estimates from the above two approaches, narrower bounds can be obtained. In CRTBound package, these methods are implemented in Bound.Intersect function.

This package is currently in beta.

Installation

To install CRTBound package in R, run the commands below:

library(devtools)
install_github("qkrcks0218/CRTBound")

Example Usage

Here are some examples of analyzing a simulated CRT:

library(CRTBound)
#################################
# Generate Population
#################################

J <- 100 ; m <- 60
nc <- sample(c(3,4,5),J,replace=T)
N <- sum(nc)
C <- rep(1:J,nc)
n <- rep(nc,nc)
X1 <- rnorm(N)
X2 <- rbinom(N,1,0.3)
X3 <- rep(rnorm(J),nc)
A0 <- rbinom(N,1,logistic(-2+2*X3))
A1 <- apply(cbind(A0,rbinom(N,1,logistic(-2+3*X1+3*X2+2*X3))),1,max)
OtherA1 <- (rep(aggregate(A1~C,FUN="sum")[,2],nc)-A1)/(n-1)
NT <- which(A1==0 & A0==0)
AT <- which(A1==1 & A0==1)
CO <- which(A1==1 & A0==0)
Y0 <- Y1 <- rep(0,N)
for(jj in NT){
    Y0[jj] <- rbinom(1,1,logistic(-2+2*OtherA1[jj]))
    Y1[jj] <- max(Y0[jj],rbinom(1,1,logistic(-2+2*OtherA1[jj])))
}
for(jj in AT){
    Y0[jj] <- rbinom(1,1,logistic(2+X1[jj]+X2[jj]))
    Y1[jj] <- max(Y0[jj],rbinom(1,1,logistic(2+X1[jj]+X2[jj])))
}
for(jj in CO){
    Y0[jj] <- rbinom(1,1,logistic(-2+2*OtherA1[jj]))
    Y1[jj] <- max(Y0[jj],rbinom(1,1,logistic(2+X1[jj]+X2[jj])))
}
X <- cbind(1,X1,X2,X3,n)

Zc <- rep(0,J)
Zc[sort(sample(J,m))] <- 1
Z <- rep(Zc,nc)
A <- Z*A1 + (1-Z)*A0
Y <- Z*Y1 + (1-Z)*Y0

#################################
# Reform the Data
#################################

Reformed.Data <- Data.Reform(Y,Z,A,C,X,seed=1)
Simulated.Data <- Simulation.Reform(Y0,Y1,Z,A0,A1,C,X,seed=1)

#################################
# ITT Effect
#################################

ITT.Data <- ITT(Reformed.Data,Input.Type="Data")
ITT.Sim.Data <- ITT(Simulated.Data,Input.Type="Sim")

#################################
# HT Effect
#################################

HT.Data <- HTE(Reformed.Data,Xvar=1:5,Input.Type="Data")
HT.Sim.Data <- HTE(Simulated.Data,Xvar=1:5,Input.Type="Sim")

#################################
# Bounds
#################################

Bound1 <- SharpBound(Reformed.Data,paraC=1:5,method="Logistic",CIcalc=TRUE,SSsize=100,level=0.95,seed=1,Input.Type="Data")
Bound2 <- LongHudgens(Reformed.Data,paraC=c(3),CIcalc=TRUE,SSsize=100,level=0.95,seed=1,Input.Type="Data")
Bound3 <- Bound.Intersect(Bound1,Bound2,level=0.95,Input.Type="Data")

Bound1.Sim <- SharpBound(Simulated.Data,paraC=1:5,method="Logistic",CIcalc=TRUE,SSsize=100,level=0.95,seed=1,Input.Type="Sim")
Bound2.Sim <- LongHudgens(Simulated.Data,paraC=c(3),CIcalc=TRUE,SSsize=100,level=0.95,seed=1,Input.Type="Sim")
Bound3.Sim <- Bound.Intersect(Bound1.Sim,Bound2.Sim,level=0.95,Input.Type="Sim")

Reproduce Park and Kang (2021)

The R-codes in /Reproduce folder replicate the simulation and the data analysis in Park and Kang (2021). The simulation results may differ from those in Park and Kang (2021). The simulated data set used in Park and Kang (2021) is available by loading Simulation.RData.

References

Grilli Leonardo & Mealli Fabrizia (2008) Nonparametric Bounds on the Causal Effect of University Studies on Job Opportunities Using Principal Stratification, Journal of Educational and Behavioral Statistics, 33(1), 111-130 [link]

Dustin M. Long & Michael G. Hudgens (2013) Sharpening Bounds on Principal Effects with Covariates, Biometrics, 69(4), 812-819 [link]

Peng Ding, Avi Feller & Luke Miratrix (2019) Decomposing Treatment Effect Variation, Journal of the American Statistical Association, 114(525), 304-317 [link]

Chan Park & Hyunseung Kang (2021+) Assumption-Lean Analysis of Cluster Randomized Trials in Infectious Diseases for Intent-to-Treat Effects and Network Effects, Journal of the American Statistical Association, In press [link]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages