Hi everyone,
I have the following problem when I try to run the honestdid package (I am using Stata 17). I am not using the default option of the first post-treatment period, but the average over the two post-treatment periods. The error that arises is:
4 child processes encountered errors. Throwing last error.
(note: error during parallel run; falling back on sequential execution)
*: 3200 conformability error
_honestRMConditionalCS(): - function returned error
HonestSensitivityHelper(): - function returned error
HonestSensitivityResults(): - function returned error
HonestDiD(): - function returned error
<istmt>: - function returned error
Here is an example with simulated data with the same structure than my own data (staggered treatment) illustrating my process: * Set the number of units and periods
* Create base data
* Create the time variable as a date
* Randomly assign the treatment start time for each treated unit
* Create the post variable indicating if treatment is received
* Create the empleo_formal (dummy) variable
* Adjust empleo_formal based on treatment
* Create gvar (time of treatment)
[CODE] tab gvar [/ CODE]
* List some observations to verify the data
* Estimation with csdid2 and sensitivity with HonestDiD
* But when I try this, the error above arises:
Any help would be greatly appreciated!
I have the following problem when I try to run the honestdid package (I am using Stata 17). I am not using the default option of the first post-treatment period, but the average over the two post-treatment periods. The error that arises is:
4 child processes encountered errors. Throwing last error.
(note: error during parallel run; falling back on sequential execution)
*: 3200 conformability error
_honestRMConditionalCS(): - function returned error
HonestSensitivityHelper(): - function returned error
HonestSensitivityResults(): - function returned error
HonestDiD(): - function returned error
<istmt>: - function returned error
Here is an example with simulated data with the same structure than my own data (staggered treatment) illustrating my process: * Set the number of units and periods
Code:
local num_units = 100 local num_periods = 10
Code:
clear set obs `num_units' gen id = _n expand `num_periods' bysort id: gen time = _n
Code:
gen date = mdy(1, 1, 2000) + (time - 1) * 30 format date %td
Code:
gen treatment_start = . replace treatment_start = 5 + int(runiform() * 5) if id <= `num_units'/2
Code:
gen post = 0 bysort id: replace post = 1 if time >= treatment_start & !missing(treatment_start)
Code:
gen empleo_formal = 0
Code:
replace empleo_formal = 1 if runiform() > 0.5
Code:
replace empleo_formal = 1 if post == 1 & runiform() > 0.3 replace empleo_formal = 0 if post == 1 & runiform() <= 0.3
Code:
sort id time
Code:
by id: gen first_change = post == 1 & post[_n-1] == 0 if _n == 1 | post[_n-1] == 0
Code:
by id: egen period_start = min(cond(first_change == 1, time, .))
Code:
drop first_change
Code:
gen gvar = cond(period_start == ., 0, period_start)
Code:
label variable gvar "Treatment activation period"
Code:
drop period_start treatment_start
Code:
list id time date post empleo_formal gvar in 1/20
Code:
csdid2 empleo_formal, ivar(id) time(time) gvar(gvar) agg(event) long2
Code:
estat event, estore(csdid)
Code:
estimates restore csdid
Code:
matrix define l_vec = 0.5 \ 0.5
Code:
matlist l_vec
Code:
honestdid, l_vec(l_vec) pre(3/8) post(9/14) mvec(0.2(0.1)1.5) coefplot xtitle(Mbar) ytitle(95% Robust CI)