Description Usage Arguments Details Value References Examples
Implements various estimators of PS-ACE from randomized experiments and observational studies
1 | psace(X, Z, S, Y, family.Y, nboot = 0)
|
X |
is a matrix of pre-treatment covariates without intercept (n x p). |
Z |
is a vector of treatment (n x 1). |
S |
is a vector of binary intermediate outcome (n x 1). |
Y |
is a vector of outcome ( n x 1). |
family.Y |
specifies the family for the outcome model.
|
nboot |
is the number of bootstrap samples. |
Details will be provided in the reference paper.
tau10w
: a principal score weighting estimator of tau10
tau10sw
: a stabilized weighting estimator of tau10
tau10reg
: a regression estimator of tau10 using outcome mean regression and inverse probability of treatment weighting
tau10reg2
: a regression estimator of tau10 using outcome mean and principal score regression
tau10aw
: a triply robust estimator of tau10
bootstrap variance estimator
ve.tau10w
ve.tau10sw
ve.tau10reg
ve.tau10reg2
ve.tau10aw
tau00w
: a principal score weighting estimator of tau00
tau00sw
: a stabilized weighting estimator of tau00
tau00reg
: a regression estimator of tau00 using outcome mean regression and inverse probability of treatment weighting
tau00reg2
: a regression estimator of tau00 using outcome mean and principal score regression
tau00aw
: a triply robust estimator of tau00
bootstrap variance estimator
ve.tau00w
ve.tau00sw
ve.tau00reg
ve.tau00reg2
ve.tau00aw
tau11w
: a principal score weighting estimator of tau11
tau11sw
: a stabilized weighting estimator of tau11
tau11reg
: a regression estimator of tau11 using outcome mean regression and inverse probability of treatment weighting
tau11reg2
: a regression estimator of tau11 using outcome mean and principal score regression
tau11aw
: a triply robust estimator of tau11
bootstrap variance estimator
ve.tau11w
ve.tau11sw
ve.tau11reg
ve.tau11reg2
ve.tau11aw
A reference paper will come up soon.
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | library(stats)
set.seed(1)
#X consists of 5 covariates
n <- 500
X <- rnorm(n,0.25,1)
for(k in 2:4){
X <- cbind(X,rnorm(n,0.25,1))
}
X <- cbind(X,rbinom(n,1,0.5))
# treatment assignment
Xtilde1 <- (X-0.25)/1
theta <- 0
eta <- c(0,1,1,1,1,theta)/2.5
px0 <- exp(cbind(1,Xtilde1)%*%eta)
pix <- px0/(1+px0)
Z <- rbinom(n,1,pix)
# S-model
eta1 <- c( 2,-1,1,-1,1,theta)/2.5
eta0 <- c(-2,1,-1,1,-1,theta)/2.5
p1xtemp <- exp(cbind(1,Xtilde1)%*%eta1)
p0xtemp <- exp(cbind(1,Xtilde1)%*%eta0)
p1x <- p1xtemp/(1+p1xtemp)
p0x <- p0xtemp/(1+p0xtemp)
s1<-rbinom(n,1,p1x)
s0<-rbinom(n,1,p0x)
S<-s1*Z+s0*(1-Z)
# Y-model (continuous outcome)
Y1<- Xtilde1%*%rep(1,5)*(1+S+Z) +rnorm(n)
# Y-model (binary outcome)
leYtemp <- Xtilde1%*%rep(1,5)*(1+S+Z)/4
eY<-exp(leYtemp)/(1+exp(leYtemp) )
Y2<-rbinom(n,1,eY)
out1<-psace(X,Z,S,Y1,family.Y="gaussian",nboot=50)
out1$tau10aw
out1$ve.tau10aw
out2<-psace(X,Z,S,Y2,family.Y="binomial",nboot=50)
out2$tau10aw
out2$ve.tau10aw
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.