Skip to content

Error: undefined columns selected, only when estimaror=mc  #86

@danielrojaslozano

Description

@danielrojaslozano

Hello, I'm running the following code and it works

out_mc_riot = gsynth(vacancies_pc ~ treat_riot + random_x,
data = dt,
estimator = 'mc',
index = c("codmun","time"), force = "two-way",
CV = TRUE, r = c(0, 5), se = TRUE, cl = c('codmun','coddep_month'),
inference = "nonparametric",
parallel = FALSE)

Then, I subset dt to select covariates and omit NAs:

dt_covariates = dt[, .(vacancies_pc,random_x,treat_riot,log_urban_pop,
codmun,coddep_month,time)] %>% na.omit()

Then, I run the model with log_urban_pop:

out_mc_riot2 = gsynth(vacancies_pc ~ treat_riot + random_x + log_urban_pop,
data = dt_covariates,
estimator = 'mc',
index = c("codmun","time"), force = "two-way",
CV = TRUE, r = c(0, 5), se = TRUE, cl = c('codmun','coddep_month'),
inference = "nonparametric",
parallel = FALSE)

And I get:
Error in [.data.frame(data, , variable) : undefined columns selected

Why is this happening? Note that I don't get the error message when estimator = 'ife' and inference = 'parametric'

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions