You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Stata中synth_runner包pre_limit_mult参数失效问题求助

Troubleshooting pre_limit_mult(2) Not Excluding Placebo Groups in synth_runner

Let's break down why your pre_limit_mult(2) parameter isn't filtering out those high-RMSPE placebo groups in synth_runner—here are the most likely culprits and fixes:

  • You put the parameter in the wrong place
    The pre_limit_mult argument needs to be nested inside synth_control() when you call synth_runner(), not passed directly or stuck in the synth() function call. A lot of users mess this up. Here's the correct structure:

    runner_output <- synth_runner(
      data = your_dataset,
      treatment = "treated_group",
      outcome = "your_outcome",
      predictors = c("pred1", "pred2", "pred3"),
      pre_period = c(2005, 2015),
      post_period = c(2016, 2020),
      control = synth_control(pre_limit_mult = 2)
    )
    

    If your parameter isn't wrapped in synth_control(), the package ignores the filtering rule entirely.

  • Your pre-period definition is off
    The pre_limit_mult filter relies on the RMSPE calculated over the exact pre-period you specify. If your pre_period includes post-treatment dates, or misses part of the actual pre-treatment window, the RMSPE values will be wrong—and the filter won't catch the groups you expect. Double-check that your pre_period matches the time frame before treatment was applied.

  • You're running an outdated version of synth_runner
    Older versions of the package had bugs with the pre_limit_mult parameter, or didn't support it at all. Head to your console and run install.packages("synth_runner") to grab the latest release, then restart your R session and re-run your code. This fixes a surprising number of parameter-related issues.

  • You're not using the right plotting function
    Even if the filter worked behind the scenes, if you're manually extracting placebo data to plot (instead of using the package's built-in plot() method), you'll still see all groups. Make sure you're plotting with:

    plot(runner_output)
    

    This method automatically respects the pre_limit_mult filter and only shows valid placebo groups.

  • Your placebo groups actually don't exceed the RMSPE threshold
    It's possible none of your placebo groups have an RMSPE more than twice the treated unit's. To confirm, manually calculate the RMSPE values:

    # Extract treated unit's pre-treatment RMSPE
    treated_rmspe <- runner_output$synth_tables$tab1$RMSPE[runner_output$synth_tables$tab1$Unit == "Treated"]
    # Extract placebo RMSPEs
    placebo_rmspe <- runner_output$placebos$rmspe_pre
    # Check which placebos exceed 2x treated RMSPE
    sum(placebo_rmspe > 2 * treated_rmspe)
    

    If this sum is 0, that means no placebos meet your exclusion criteria—you might need to adjust the threshold or re-evaluate your predictor variables to get more meaningful placebo matches.

内容的提问来源于stack exchange,提问作者Charlotte Van Houtvinck

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 09:20:57