Skip to content

plot.GeoLiftMarketSelection fails with "Two versions of estimated impacts do not correspond" for 2+ treated locations #226

Description

@castroisabel

Bug description

Calling plot() on a GeoLiftMarketSelection object fails with the internal error "Two versions of estimated impacts do not correspond. Serious error. Please contact package maintainers." The error originates in augsynth's get_placebo_gaps() during the permutation inference step (add_placebo_distribution).

This is fully reproducible using the package's own example dataset (GeoLift_PreTest), so it is not specific to user data. It occurs with multiple treated locations (the recommended markets here have 2–3 locations). The GeoLiftMarketSelection() call itself completes successfully and returns the recommendations table; only the subsequent plot() fails.

Session information

R version 4.6.0 (2026-04-24)
Platform: aarch64-apple-darwin23
Running under: macOS Tahoe 26.4.1

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.6/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1

locale:
[1] C.UTF-8/UTF-8/C.UTF-8/C/C.UTF-8/C.UTF-8

time zone: America/Sao_Paulo
tzcode source: internal

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] dplyr_1.2.1 tidyr_1.3.2 augsynth_0.2.0 GeoLift_2.7.5

loaded via a namespace (and not attached):
[1] tidyselect_1.2.1 IRdisplay_1.1 farver_2.1.2
[4] S7_0.2.2 fastmap_1.2.0 GGally_2.4.0
[7] fixest_0.14.1 digest_0.6.39 lifecycle_1.0.5
[10] dreamerr_1.5.0 magrittr_2.0.5 compiler_4.6.0
[13] rlang_1.2.0 progress_1.2.3 rngtools_1.5.2
[16] tools_4.6.0 utf8_1.2.6 knitr_1.51
[19] labeling_0.4.3 prettyunits_1.2.0 doRNG_1.8.6.3
[22] plyr_1.8.9 repr_1.1.7 RColorBrewer_1.1-3
[25] abind_1.4-8 pbdZMQ_0.3-14 withr_3.0.2
[28] purrr_1.2.2 numDeriv_2016.8-1.1 grid_4.6.0
[31] xts_0.14.2 future_1.70.0 ggplot2_4.0.3
[34] globals_0.19.1 scales_1.4.0 iterators_1.0.14
[37] MASS_7.3-65 cli_3.6.6 mvtnorm_1.3-7
[40] crayon_1.5.3 generics_0.1.4 future.apply_1.20.2
[43] reshape2_1.4.5 directlabels_2026.4.23 proxy_0.4-29
[46] stringr_1.6.0 assertthat_0.2.1 parallel_4.6.0
[49] bsts_0.9.11 base64enc_0.1-6 stringmagic_1.2.0
[52] vctrs_0.7.3 Matrix_1.7-5 sandwich_3.1-1
[55] jsonlite_2.0.0 hms_1.1.4 Formula_1.2-5
[58] listenv_0.10.1 foreach_1.5.2 glue_1.8.1
[61] parallelly_1.47.0 dtw_1.23-2 ggstats_0.13.0
[64] codetools_0.2-20 fect_2.4.1 gsynth_1.4.0
[67] stringi_1.8.7 gtable_0.3.6 quadprog_1.5-8
[70] osqp_1.0.0 Boom_0.9.16 tibble_3.3.1
[73] pillar_1.11.1 htmltools_0.5.9 IRkernel_1.3.2
[76] R6_2.6.1 BoomSpikeSlab_1.2.7 panelView_1.3.1
[79] MarketMatching_1.2.1 doParallel_1.0.17 CausalImpact_1.4.1
[82] evaluate_1.0.5 lattice_0.22-9 Rcpp_1.1.1-1.1
[85] uuid_1.2-2 gridExtra_2.3 nlme_3.1-169
[88] xfun_0.57 zoo_1.8-15 pkgconfig_2.0.3

Reproduction steps

library(GeoLift)
data(GeoLift_PreTest)

GeoTestData_PreTest <- GeoDataRead(
data = GeoLift_PreTest,
date_id = "date",
location_id = "location",
Y_id = "Y",
X = c(),
format = "yyyy-mm-dd",
summary = TRUE
)

MarketSelections <- GeoLiftMarketSelection(
data = GeoTestData_PreTest,
treatment_periods = c(10),
N = c(2, 3),
Y_id = "Y",
location_id = "location",
time_id = "time",
effect_size = seq(0, 0.5, 0.05),
lookback_window = 1,
cpic = 1.0,
alpha = 0.1,
Correlations = TRUE,
fixed_effects = TRUE,
side_of_test = "two_sided"
)

this line throws the error:
plot(MarketSelections, market_ID = 1, print_summary = FALSE)

Expected behavior

plot(MarketSelections, market_ID = 1) should render the plot of observed vs. synthetic outcome for the selected market, as documented, instead of throwing an internal error from the inference step.

Error in get_placebo_gaps(augsynth, att = FALSE): Two versions of estimated impacts do not correspond.  Serious error.  Please contact package maintainers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions