plot.tjbal | R Documentation |
Visualizes results from trajectory balancing.
## S3 method for class 'tjbal'
plot(x, type = "gap", xlim = NULL, ylim = NULL,
xlab = NULL, ylab = NULL, count = TRUE, legendOff = FALSE,
legend.pos = "bottom", legend.ncol = NULL, legend.labs = NULL,
main = NULL, raw = "none", stat = "mean", trim = TRUE, trim.wtot = 0.9,
theme.bw = TRUE, cex.main = NULL, cex.axis = NULL, cex.lab = NULL,
cex.legend = NULL, cex.text = NULL, log.weights = FALSE, wmin = NULL,
axis.adjust = FALSE, ...)
x |
a |
type |
a string that specifies the type of the plot. Must be one of the following: "gap" (plotting the average treatment effect on the treated; "counterfactual" or "ct" for short (plotting predicted average Y(0)'s); "balance" (plotting balance of covariates and pre-treatment outcomes before and after reweighting); "weights" (plotting the distribution of weights of the control units – weights added up to the number of the treated units). |
subgroup |
a numeric value indicating the subgroup for which the results will be plotted. |
xlim |
a two-element numeric vector specifying the range of x-axis. When
class of time varible is string, must specify not original value but a counting number e.g. |
ylim |
a two-element numeric vector specifying the range of y-axis. |
xlab |
a string indicating the label of the x-axis. |
ylab |
a string indicating the label of the y-axis. |
count |
a logical flag indicating whether a bar plot of the number of treated units will be shown at the bottom of the plot. The default is TRUE. Ignored if |
legendOff |
a logical flag controlling whether to show the legends. |
legend.pos |
a character controlling the position of the legends. The default is "bottom". |
legend.ncol |
a numeric value controlling the number of columns of the legends. |
legend.labs |
a vector of characters specifying the labels of the legends. |
main |
a string that controls the title of the plot. If not supplied, no title will be shown. |
raw |
a string indicating whether or how raw data for the outcome
variable will be shown in the "counterfactual" plot. Ignored if |
stat |
a string that specifies the statistics in the |
trim |
a logical flag controlling whether to trim the control group data in a counterfactual plot when |
trim.wtot |
a numeric value controlling the total sum of weights of the most heavily weighted controls to remain in the plot. The default is 0.9. |
theme.bw |
a logical flag controlling whether a black-white theme will be used. The default is TRUE. |
cex.main |
a numeric value controlling the font size of the title. |
cex.axis |
a numeric value controlling the font size of the axis labels. |
cex.lab |
a numeric value controlling the font size of the axis titles. |
cex.legend |
a numeric value controlling the font size of the legends. |
cex.text |
a numeric value controlling the font size of the text in the figure (such as Ntr = 47). |
log.weights |
a logical flag controlling whether to take a common logarithmic transformation of the weights. The default is FALSE. Ignored if |
wmin |
a numeric number specifying the minimum weight (in common logarithmic). Ignored if |
axis.adjust |
a logic flag indicating whether to adjust labels on x-axis. Useful when class of time variable is string and data magnitude is large. |
... |
other argv. |
plot.tjbal
visualizes the results of trajectory balancing.
Chad Hazlett <chazlett@ucla.edu>, UCLA
Yiqing Xu (Maintainer) <yiqingxu@stanford.edu>, Stanford
Hazlett, Chad and Yiqing Xu, 2020. “Trajectory Balancing: A General Reweighting Approach to Causal Inference with Time-Series Cross-Sectional Data.” Working Paper, UCLA and Stanford.
tjbal
and print.tjbal
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.