plot.fect | R Documentation |
Visualizes results from a fect
estimation.
## S3 method for class 'fect'
plot(
x,
type = NULL,
loo = FALSE,
highlight = NULL,
plot.ci = NULL,
show.points = NULL,
show.group = NULL,
bound = NULL,
vis = NULL,
count = TRUE,
proportion = 0.3,
pre.periods = NULL,
f.threshold = NULL,
tost.threshold = NULL,
effect.bound.ratio = FALSE,
stats = NULL,
stats.labs = NULL,
raw = "none",
main = NULL,
xlim = NULL,
ylim = NULL,
xlab = NULL,
ylab = NULL,
xangle = NULL,
yangle = NULL,
xbreaks = NULL,
ybreaks = NULL,
xticklabels = NULL,
yticklabels = NULL,
gridOff = FALSE,
legendOff = FALSE,
legend.pos = NULL,
legend.nrow = NULL,
legend.labs = NULL,
stats.pos = NULL,
show.stats = TRUE,
theme.bw = TRUE,
nfactors = NULL,
include.FE = TRUE,
id = NULL,
cex.main = NULL,
cex.main.sub = NULL,
cex.axis = NULL,
cex.lab = NULL,
cex.legend = NULL,
cex.text = NULL,
axis.adjust = FALSE,
axis.lab = "both",
axis.lab.gap = c(0, 0),
shade.post = FALSE,
start0 = FALSE,
return.test = FALSE,
balance = NULL,
weight = NULL,
line.color = NULL,
line.width = c(1.2, 0.5),
lcolor = NULL,
lwidth = NULL,
...
)
x |
A fitted |
type |
Plot type: |
loo |
Logical; if |
highlight |
Logical; if |
plot.ci |
Specifies the confidence interval to be plotted. Options include:
|
show.points |
Logical; if |
show.group |
Optional; specify a subgroup to plot. |
bound |
Which bounds to display in bounding/equivalence tests:
|
vis |
Controls line display for placebo/carryover tests: |
count |
Logical; if |
proportion |
Restrict plotted time points to those with at least this fraction of the max units. |
pre.periods |
Specifies pre-treatment periods used for bounding. |
f.threshold |
F-test threshold in equivalence checks. |
tost.threshold |
Threshold for TOST-based checks. |
effect.bound.ratio |
If |
stats |
Specifies which statistics to display: e.g., |
stats.labs |
Custom labels for the displayed statistics. |
raw |
For |
main |
Main plot title. |
xlim |
Specifies x-axis limits. |
ylim |
Specifies y-axis limits. |
xlab |
x-axis label. |
ylab |
y-axis label. |
xangle |
Angle (in degrees) for x-axis labels. |
yangle |
Angle (in degrees) for y-axis labels. |
xbreaks |
Positions of major ticks on the x-axis. |
ybreaks |
Positions of major ticks on the y-axis. |
xticklabels |
Labels for the x-axis ticks. |
yticklabels |
Labels for the y-axis ticks. |
gridOff |
Logical; if |
legendOff |
Logical; if |
legend.pos |
Position of the legend. |
legend.nrow |
Number of rows in the legend. |
legend.labs |
Custom legend labels. |
stats.pos |
(x,y) coordinates for displaying text of test statistics. |
show.stats |
Logical; if |
theme.bw |
Logical; if |
nfactors |
Number of factors to plot when |
include.FE |
Logical; if |
id |
When specified, plots only the chosen unit(s). |
cex.main |
Font size of the main title. |
cex.main.sub |
Font size of a possible subtitle. |
cex.axis |
Font size of axis tick labels. |
cex.lab |
Font size of axis labels. |
cex.legend |
Font size of legend text. |
cex.text |
Font size for text annotations. |
axis.adjust |
If |
axis.lab |
Controls axis labeling in |
axis.lab.gap |
Gap spacing for axis labels in |
shade.post |
If |
start0 |
If |
return.test |
If |
balance |
Logical; if |
weight |
Logical; if |
line.color |
Color for main plot lines. |
line.width |
A numeric vector specifying line widths for different line types. |
lcolor |
Color for reference lines (e.g., 0 line, vertical lines). |
lwidth |
Line width for reference lines. |
... |
Additional graphical parameters passed to internal plotting routines. |
plot.fect
generates various visualizations for objects estimated via fect
. Depending on
the selected type
, it can show treatment-effect dynamics, equivalence test outcomes, factor/loadings
for factor models, or raw vs. counterfactual trajectories.
p |
A |
test.out |
If |
Licheng Liu, Ye Wang, Yiqing Xu, Ziyi Liu
Xu, Y. (2017). Generalized Synthetic Control Method: Causal Inference with Interactive Fixed Effects Models. Political Analysis, 25(1), 57–76.
library(fect)
data(fect)
out.fect <- fect(Y ~ D + X1 + X2, data = simdata, index = c("id","time"),
method = "fe", force = "two-way", se = TRUE, parallel = TRUE, nboots = 200)
plot(out.fect, main = "Estimated ATT (FEct)", ylab = "Effect of D on Y")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.