multi.att: ATT Propensity Score Weighting Estimator for Clustered Data

Description Usage Arguments Value See Also Examples

View source: R/psmultilevel.R

Description

multi.att implements a variety of algorithms for calculating propensity score weighting estimators and their standard errors for the sample average treatment effect for the treated (ATT) in a clustered data setting. Here, the treatment is assigned on an individual level and not cluster level. multi.att has an optional threshold for the minimum number of units in each treatment group of each cluster - clusters that don't meet this requirement are removed before the propensity scores are estimated.

multi.att offers four weighting estimators: marginal weighting, clustered weighting, stratification, and doubly-robust. Standard errors are obtained by bootstrapping. psmultilevel makes calls to multi.att as needed.

Usage

1
2
3
multi.att(data, Y, Z, cluster, y.formula = NULL, pscore.formula, method,
  modeltype = "fixed", y.type, se.report = FALSE, nboot = 75, nsub = 6,
  ps.cut = c(0.05, 0.95), cl.cutoff = 0)

Arguments

data

Data containing covariates except for the outcome, the treatment, and the cluster identification.

Y

A vector containing the outcome of interest. This can be either binary or continuous, but will need to be specified for methods involving outcome models.

Z

A vector indicating the observations which are in the treated and control group. This is binary-coded: 1 = Treated, 0 = Untreated.

cluster

A vector of factored cluster identification.

y.formula

Outcome formula, required for Doubly-Robust. The treatment variable should be called "Z" and the cluster variable should be called "cluster".

pscore.formula

Propensity score formula. The treatment variable should be called "Z" and the cluster variable should be called "cluster".

method

A character string for the method of interest. Options: "marwt" for marginal weighting, "clwt" for clustered weighting, "stratification" for stratification/ subclassification, and "DR" for doubly-robust.

modeltype

A character string identifying the model of the cluster-specific effects for both the propensity score and the outcome. Options: "fixed" for a fixed effects model, and "random" for a random effects model. Default: fixed effects model. Note that for random effects models, function glmer of package lme4 is utilized, and for large models it can be very slow to fit. To speed up, we add two options to the glmer defaults: nAGQ=0 and control = glmerControl(optimizer = "nloptwrap"). See the documentation of glmer for the details about these options.

y.type

A character string classifying the outcome type. Options: "binary"/ "continuous".

se.report

A logical flag for whether the standard error for the estimator should be reported.

nboot

The number of bootstrap samples to be drawn. Default value is 75.

nsub

A scalar denoting the number of subclasses to be used for stratification. Default value is 6.

ps.cut

A vector of length 2 containing the lower and upper limit for the propensity scores cut-offs. Observations beyond these limits are removed. Default values are (0.05,0.95).

cl.cutoff

A scalar denoting the minimum number of observations required in both the treatment and the control groups. Clusters with fewer observations than the threshold in either group will be removed before the estimation process. Default value is 0.

Value

A list with the elements:

estimate

Value of the estimator of interest.

se

The standard error of the estimator, obtained by bootstrapping.

See Also

multi.ate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
y.formula.re<-function(){
return (Y~Z+X1+X2+(1|cluster))
}

ps.formula.re<-function(){
return(Z~ X1+X2+ (1|cluster))
}
data<-simdata[,c(1:2)]

multi.att(data=data,Y=simdata$Y,Z=simdata$Z,cluster=simdata$cluster,y.formula=NULL,
pscore.formula=ps.formula.re(),method='marwt',modeltype='random',y.type=NULL,
se.report=FALSE,ps.cut=c(0.05,0.95),cl.cutoff=0)
## Not run: 
#Method = Cluster weighting, obtain bootstrapped SE
multi.att(data=data,Y=simdata$Y,Z=simdata$Z,cluster=simdata$cluster,
y.formula = y.formula.re(),pscore.formula=ps.formula(),method='clwt',modeltype='random',
se.report=TRUE,nboot=75,ps.cut=c(0.05,0.95),cl.cutoff=0)

## End(Not run)

nln6/psmultilevel documentation built on May 29, 2019, 7:18 a.m.