This internal helper function extracts synthetic draws from a Stan fit object generated by a predictor match model. It combines these draws with observed outcome data and returns a tidy data frame suitable for analysis or plotting. It specifically works with variable definitions from the predictor match model.
.get_synth_draws_predictor_match(fit, pre_data, post_data, time, outcome)A data frame containing:
draw: The index of the synthetic draw.
time: The time period.
y_synth: The synthetic outcome for the given draw and time period.
outcome: The observed outcome for the given time period.
A Stan fit object containing the model results.
A data frame with outcome data before the intervention.
A data frame with outcome data after the intervention.
The name of the time period variable (as a string).
The name of the outcome variable (as a string).