.get_plot_df | R Documentation |
This function processes data frames containing synthetic and observed outcomes, calculates confidence intervals for the synthetic outcomes, and returns a combined data frame suitable for plotting the results.
.get_plot_df(y_synth_draws, pre_data, post_data, time, outcome, ci = 0.75)
y_synth_draws |
A data frame containing draws from the Stan fit object. |
pre_data |
A data frame with data before the intervention. |
post_data |
A data frame with data after the intervention. |
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.
outcome
: The observed outcome.
y_synth
: The mean synthetic outcome.
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 difference between the observed and synthetic outcomes.
tau_LB
: The lower bound of the confidence interval for tau
.
tau_UB
: The upper bound of the confidence interval for tau
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.