insongkim / PanelMatch

113 stars 34 forks source link

An error that I can not understand #70

Open metascience-lab opened 3 years ago

metascience-lab commented 3 years ago

Hello, I tried to use your great package to analysis my own data. But I don't understand what happened by this error tips. Could you please give me a hand generously? I will attach me code and my data as attachments in this Issues. Looking for your generous reply, thanks a lot!!!!! code&data.zip

PM.results_ps <- PanelMatch(lag = Lag, time.id = "months", unit.id = "county_code",

  • treatment = "X", refinement.method = "ps.weight",
  • data = Data, match.missing = FALSE, listwise.delete = TRUE,
  • covs.formula = ~ I(lag(Z, 1:Lag)) + I(lag(Y, 1:Lag)),
  • size.match = 5, qoi = "att", outcome.var = "Y",
  • lead = 0:Lead, forbid.treatment.reversal = FALSE,
  • use.diagonal.variance.matrix = TRUE) Error in stm:nrow(x) : NA/NaN argument In addition: Warning message: In lwd_refinement(msets, ordered.data, treated.ts, treated.ids, : NAs introduced by coercion