Skip to contents

This function takes an object (result of PanelEstimate or similar) and plots its estimates over time.

Usage

plot_panel_estimate(
  pe.object,
  ylab = "Estimated Effect of Treatment",
  xlab = "Time Since Treatment",
  main = "Estimated Effects of Treatment Over Time",
  ylim = NULL,
  theme_use = causalverse::ama_theme(),
  ...
)

plot_PanelEstimate(...)

Arguments

pe.object

The object with the estimation results.

ylab

The y-axis label.

xlab

The x-axis label.

main

The main title for the plot.

ylim

The limits for the y-axis.

theme_use

The theme to use for the plot. Defaults to causalverse::ama_theme().

...

Additional parameters to pass to labs() function.

Value

A ggplot object with the desired plot.

Examples

if (FALSE) { # \dontrun{
library(PanelMatch)
pd <- PanelData(panel.data = dem, unit.id = "wbcode2",
                time.id = "year", treatment = "dem", outcome = "y")
PM.results.ps.weight <- PanelMatch(
  panel.data = pd, lag = 4, refinement.method = "ps.weight",
  match.missing = FALSE, listwise.delete = TRUE,
  covs.formula = ~ I(lag(tradewb, 1:4)) + I(lag(y, 1:4)),
  size.match = 5, qoi = "att", lead = 0:4,
  forbid.treatment.reversal = FALSE
)

PE.results <- PanelEstimate(sets = PM.results.ps.weight,
                            panel.data = pd,
                            se.method = "bootstrap",
                            number.iterations = 1000,
                            confidence.level = .95)

plot_panel_estimate(PE.results)
} # }