Description Usage Arguments Value Author(s) References See Also Examples
Residualizes the outcome variable and the treatment variable with covariates (via inverse probability weighted least squares regression) and plots the relationship. When weights are applied, the graph shows the relative weighting of each observation
1 | resresplot(Y, Z, X, prob = NULL, scale = 1)
|
Y |
numeric vector of length N, outcome variable |
Z |
binary vector (0 or 1) of length N, treatment indicator |
X |
N-by-k numeric matrix of covariates for regression adjustment |
prob |
numeric vector within the (0,1) interval of length N, probability of treatment assignment, as outputted by |
scale |
a scalar parameter controlling the size of the plotted points |
produces a plot of residualized and weighted values
Peter M. Aronow <peter.aronow@yale.edu>; Cyrus Samii <cds2083@nyu.edu>
Gerber, Alan S. and Donald P. Green. 2012. Field Experiments: Design, Analysis, and Interpretation. New York: W.W. Norton.
1 2 3 4 5 6 7 8 9 | y <- c(8,6,2,0,3,1,1,1,2,2,0,1,0,2,2,4,1,1)
Z <- c(1,1,0,0,1,1,0,0,1,1,1,1,0,0,1,1,0,0)
X <- c(1:18)
cluster <- c(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9)
block <- c(rep(1,4),rep(2,6),rep(3,8))
probs <- genprobexact(Z,block,cluster) # generate probability of assignment
resresplot(y,Z,X,prob=probs,scale=3) # produce res-res plot
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.