.get_plot_df2 | R Documentation |
This function processes data for multiple treated units, calculating synthetic outcomes, confidence intervals, and treatment effects. It combines this information into a data frame suitable for plotting the results.
.get_plot_df2(y_synth_draws, data, treated_ids, id, time, outcome, ci = 0.75)
y_synth_draws |
A data frame containing synthetic outcome draws for each treated unit and time period. |
data |
A data frame with the original data, including outcomes for treated units. |
treated_ids |
A vector of identifiers for the treated units. |
id |
The name of the variable in |
time |
The name of the time period variable (as a string). |
outcome |
The name of the outcome variable (as a string). |
ci |
The width of the credible confidence interval (default: 0.75). |
A data frame containing:
time
: The time period.
id
: The unit identifier (including "Average" for the average treatment effect).
outcome
: The observed outcome (for treated units).
y_synth
: The mean synthetic outcome (for treated units and the average).
LB
: The lower bound of the confidence interval for the synthetic outcome.
UB
: The upper bound of the confidence interval for the synthetic outcome.
tau
: The treatment effect (difference between observed and synthetic outcomes).
tau_LB
: The lower bound of the confidence interval for the treatment effect.
tau_UB
: The upper bound of the confidence interval for the treatment effect.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.