xuyiqing / gsynth

Generalized Synthetic Control Method
Other
131 stars 40 forks source link

Error in obs.missing[, rm.id] <- 4 : incorrect number of subscripts on matrix #88

Closed liqizheng0328 closed 10 months ago

liqizheng0328 commented 10 months ago

Dear Sir or Madam,

I encountered the following error when running the code below. My gsyth version is already the latest, 1.2.1.

Thank you very much.

EM method

out <- gsynth(Acquiror_freq ~ treat_post + labor_productivity + lnassets + lnage + liability_asset,

  • data = M_A2,
  • index = c("bvdidnumber","year"), EM = TRUE,
  • force = "two-way", inference = "parametric",
  • min.T0 = 7,
  • se = TRUE, nboots = 500, r = c(0, 5),
  • CV = TRUE, parallel = TRUE) Some treated units has too few pre-treatment periods. They will be automatically removed. There are not any observations under control at 2007 , drop that period. There are not any observations under control at 2008 , drop that period. Parallel computing ... Cross-validating ... r = 0; sigma2 = 1.41233; IC = 1.54594; PC = 1.25198; MSPE = 4.25296* r = 1; sigma2 = 1.26255; IC = 2.63291; PC = 2.12783; MSPE = 11.11690 r = 2; sigma2 = 1.13777; IC = 3.72739; PC = 2.82654; MSPE = 20.66888 r = 3; sigma2 = 1.03467; IC = 4.83040; PC = 3.39709; MSPE = 19.54135 r = 4; sigma2 = 0.95057; IC = 5.94308; PC = 3.88050; MSPE = 13.04548 r = 5; sigma2 = 0.88651; IC = 7.07023; PC = 4.32740; MSPE = 24.90956

r* = 0

Bootstrapping ... Error in obs.missing[, rm.id] <- 4 : incorrect number of subscripts on matrix

xuyiqing commented 10 months ago

Hi, this is becasue "some treated units have too few pre-treatment periods" as the message indicates.