insongkim / PanelMatch

118 stars 36 forks source link

Bug in placebo_test #127

Open r-perla opened 1 year ago

r-perla commented 1 year ago

Hello,

I've observed two issues within the placebo_test function, both also present in the CRAN release:

  1. Incorrect Condition in QOI Extraction:

    • Location: Line extracting matched sets from the PanelMatch object.
    • Code:
      if (identical(qoi.in, "ate")) {
       matchedsets <- pm.obj[["att"]]
      }
    • Expected Behavior: The condition should probably be identical(qoi.in, "att"). With the current condition, objects with ATT as their QOI are unable to assign matchedsets, leading to errors later in the function.
  2. Mismatched Function Call:

    • Location: Call to the panel_estimate function.
    • Code:
      placebo.results.raw <- panel_estimate(sets = pm.obj, data = data, 
      number.iterations = number.iterations, df.adjustment = df.adjustment, 
      placebo.test = TRUE, placebo.lead = lag.in)
    • Issue: The function panel_estimate doesn't appear to exist in the library. Furthermore, the actual PanelEstimate function doesn't have the arguments placebo.test and placebo.lead, eliminating it as a possible substitute.

Would appreciate your review on this. Thanks!

SeraphineM commented 8 months ago

Hi,

thanks for the great package and new approach. I am having similar issues with placebo_test throwing an error as the object "matchedsets" is not found, would be really great if you could fix this little bug or point me to the placebo_test function (could not find it in folder "R"), thanks!

Seraphine