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?
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 selectedWhy is this happening? Note that I don't get the error message when estimator = 'ife' and inference = 'parametric'
Any ideas?