I'm designing a randomized encouragement trial in which half of the sample will be randomly assigned to receive a special invitation to try a new intervention. This design will likely result in two-sided non-compliance with respect to random assignment:
Everyone randomized to the encouragement arm will receive a special invitation to try the intervention, but only a subset of people in this group will take up this offer.
People randomized to the control arm will NOT receive a special invitation to try the intervention, but some will learn about it through other channels and try it out on their own.
Encouragement designs account for this non-compliance by estimating the local average treatment effect (LATE). LATE is the effect of the intervention on 'compliers'—those who tried the intervention because they were randomly encouraged to do so but would not have tried if not encouraged.
I simulated a basic dataset that mimics the planned study, and have a question about interpreting the treatment effect.
# setup
library(dplyr)
library(arm)
library(AER)
library(ivpack)
library(stargazer)
n <- 134
# https://rpubs.com/wsundstrom/t_ivreg
# function to calculate corrected SEs for OLS regression
cse = function(reg) {
rob = sqrt(diag(vcovHC(reg, type = "HC1")))
return(rob)
}
# corrected SEs for IV regressions... slight difference from S&W method
ivse = function(reg) {
rob = robust.se(reg)[,2]
return(rob)
}
# create dataframe
dat <- data.frame(partID=seq(1, n, 1),
trt=c(rep(0, n/2),
rep(1, n/2)))
# set proportion use
useT <- .8 # treatment group (encouraged)
useC <- .2 # control group (not encouraged)
# create use variable
set.seed(493)
dat$use <- c(rbinom(n/2, 1, useC),
rbinom(n/2, 1, useT))
# create covariate
# http://stackoverflow.com/questions/42147053/simulate-continuous-variable-that-is-correlated-to-existing-binary-variable
x1 <- dat$use # fixed given data
rho <- 0.1 # desired correlation = cos(angle)
theta <- acos(rho) # corresponding angle
x2 <- rnorm(n, 2, 0.5) # new random data
X <- cbind(x1, x2) # matrix
Xctr <- scale(X, center=TRUE,
scale=FALSE) # centered columns (mean 0)
Id <- diag(n) # identity matrix
Q <- qr.Q(qr(Xctr[ , 1, drop=FALSE])) # QR-decomposition, just matrix Q
P <- tcrossprod(Q) # = Q Q' # projection onto space defined by x1
x2o <- (Id-P) %*% Xctr[ , 2] # x2ctr made orthogonal to x1ctr
Xc2 <- cbind(Xctr[ , 1], x2o) # bind to matrix
Y <- Xc2 %*% diag(1/sqrt(colSums(Xc2^2))) # scale columns to length 1
x <- Y[ , 2] + (1 / tan(theta)) * Y[ , 1] # final new vector
dat$age <- (1 + x) * 25
cor(dat$use, dat$age)
dat$age <- round(dat$age, 0)
# outcome
outT <- .35
outC <- .05
dat$y <- c(rbinom(n/2, 1, outC),
rbinom(n/2, 1, outT))
# IV Regression
ivR = ivreg(y ~ use + rescale(age) | rescale(age) + trt , data = dat)
stargazer(ivR,
se=list(ivse(ivR)),
title="IV Regression",
type="text",
df=FALSE,
digits=5,
ci=TRUE)
The coefficient on use
is 0.43. This is the effect on the 'compliers'. The outcome y
is binary. I want to be able to say that the intervention increased y
by 43% points from a to b.
How do I get a? The proportion among the control group is 0.03, but this includes compliers and never-takers
.