Dear Statalisters,
I have written an ado program for treatment effects evaluation which can compute 4 estimators called DID, CIC, TC and LQTE. These are specified via the wald_lqte( ) option. There can only be 4 variables entered in the varlist: the outcome variable y, the treatment group variable g, the period indicator t and the actual treatment indicator d, all in this specific order. My program has worked fine so far on the databases I tested it with, but I have just had an awkward (and serious) problem with a new dataset. When I try to run the program (all variables are numeric as required), it stops right at the beginning (at the syntax step), claims "variable y not found" and my Stata session clears the database I am using. Unfortunately I can neither give you the database (access restricted base) and my program is several thousands lines long. I can still give you the very beginning of my .ado so that you can perhaps spot some basic programming mistakes I made at the start of the program:
/*do file command use:*/
fuzzydid y g t d if t>=0, wald_lqte(DID)
/*Ado file:*/
clear all
clear mata
/**********************/
/*Interface with users*/
/**********************/
quietly capture program drop fuzzyDID
quietly program fuzzyDID, byable(recall) eclass sortpreserve
version 12
if replay() {
if "‘e(cmd)'"!="wald_did" & "‘e(cmd)'"!="wald_tc" & ///
"‘e(cmd)'"!="wald_cic" & "‘e(cmd)'"!="lqte" {
error 301
}
else{
syntax [, ‘options']
}
}
else{
syntax varlist(min=4 numeric) [if] [in] ///
[, cluster(varlist numeric) yextrareg(varlist numeric) ///
dextrareg(varlist numeric) ///
LINEAR MOREOUTPUT CDFGRAPH TEST wald_lqte(namelist min=1 max=1) ///
new_categ(numlist) ///
bwidth_method(name) continuous(varlist numeric) discrete(varlist numeric) ///
breps(numlist int>=2 max=1)]
/*LONG PROGRAMMING BIT*/
/*end of the program:*/
ereturn local sample=`touse'
}
end
N.B: I issue the e(cmd) variable within each subprogram.
Thanks in advance and sorry for the lack of reproducible code and data!!!
Yannick Guyonvarch
I have written an ado program for treatment effects evaluation which can compute 4 estimators called DID, CIC, TC and LQTE. These are specified via the wald_lqte( ) option. There can only be 4 variables entered in the varlist: the outcome variable y, the treatment group variable g, the period indicator t and the actual treatment indicator d, all in this specific order. My program has worked fine so far on the databases I tested it with, but I have just had an awkward (and serious) problem with a new dataset. When I try to run the program (all variables are numeric as required), it stops right at the beginning (at the syntax step), claims "variable y not found" and my Stata session clears the database I am using. Unfortunately I can neither give you the database (access restricted base) and my program is several thousands lines long. I can still give you the very beginning of my .ado so that you can perhaps spot some basic programming mistakes I made at the start of the program:
/*do file command use:*/
fuzzydid y g t d if t>=0, wald_lqte(DID)
/*Ado file:*/
clear all
clear mata
/**********************/
/*Interface with users*/
/**********************/
quietly capture program drop fuzzyDID
quietly program fuzzyDID, byable(recall) eclass sortpreserve
version 12
if replay() {
if "‘e(cmd)'"!="wald_did" & "‘e(cmd)'"!="wald_tc" & ///
"‘e(cmd)'"!="wald_cic" & "‘e(cmd)'"!="lqte" {
error 301
}
else{
syntax [, ‘options']
}
}
else{
syntax varlist(min=4 numeric) [if] [in] ///
[, cluster(varlist numeric) yextrareg(varlist numeric) ///
dextrareg(varlist numeric) ///
LINEAR MOREOUTPUT CDFGRAPH TEST wald_lqte(namelist min=1 max=1) ///
new_categ(numlist) ///
bwidth_method(name) continuous(varlist numeric) discrete(varlist numeric) ///
breps(numlist int>=2 max=1)]
/*LONG PROGRAMMING BIT*/
/*end of the program:*/
ereturn local sample=`touse'
}
end
N.B: I issue the e(cmd) variable within each subprogram.
Thanks in advance and sorry for the lack of reproducible code and data!!!
Yannick Guyonvarch
Comment