IPW.meandifference: Estimating the treatment effect from a partially nested...

Description Usage Arguments Details Value Examples

View source: R/IPW.meandifference.R

Description

IPW.meandifference is used to estimate the treatment effect from a partially nested design (where the treatment arm has multiple treatment clusters, and the control arm has no clusters) with the inverse-propensity-weighted mean difference estimation approach adapted to the partially nested design feature.

Usage

1
2
3
4
5
6
7
IPW.meandifference(
  Y,
  Trt,
  clus,
  Lyz,
  Ly
)

Arguments

Y

An outcome variable

Trt

Treatment assignment indicator (1 for treatment and 0 for control). The treatment arm has multiple treatment clusters, and the control arm has no clusters.

clus

Observed treatment cluster assignment. clus = 0 for the control arm

Lyz

A matrix containing pre-treatment covariates. Lyz can contain two types of covariates. The first type of covariates affect both the treatment assignment and outcome directly. The second type of covariates do not affect the outcome in a given treatment cluster directly, but affect both the treatment assignment and treatment cluster assignment.

Ly

A matrix containing the pre-treatment covariates that affect both the treatment assignment and outcome directly. Ly is the first type of covariates contained in Lyz.

Details

The sandwisch type standard error estimation does not account for the clustering in the treatment arm.

Value

IPW.meandifference returns a list "ipw10.md" containing the following components:

meanDiff

the treatment effect estimate, i.e., the mean difference between the treatment and control arm.

se_sw

the sandwich-type standard error estimate of the treatment effect estimate.

z.wald

the Wald statistic (i.e., meanDiff/se_sw).

Examples

1
2
3
4
5
6
7
data(dat_obs)
head(dat_obs)
IPW.meandifference(Y=dat_obs$Y,
                   Trt=dat_obs$Trt,
                   clus=dat_obs$clus,
                   Lyz=dat_obs[,c('Ly','Lz')],
                   Ly=dat_obs[,c('Ly')] )

IPWpn documentation built on April 13, 2021, 5:08 p.m.