Stata Postfile Error: Invalid Name -
Stata Postfile Error: Invalid Name -
i running unusual problem while trying run code. next sample of code (note: in main directory):
cd "c:/`mydir'" //where `mydir' local folder containing fig folder. utilize cleaned.dta, clear local outcome drr_trtd tempname post_handle local postfile_varlist str12(tau_text) double(pt_est se) postfile `post_handle' `postfile_varlist' using "fig/dta/es_m12_p11_`outcome'.dta", replace postclose `post_handle' utilize "fig/dta/es_m12_p11_`outcome'.dta", clear
the issue whenever seek , run code, error:
postfile `post_handle' `postfile_varlist' using "fig/dta/es_m12_p11_`outcome'.dta", replace fig/dta/es_m12_p11_drr_trtd.dta invalid name
i assumed may because of quotation marks, removed quotation marks , next error:
postfile `post_handle' `postfile_varlist' using fig/dta/es_m12_p11_`outcome'.dta, replace / invalid name
i tried create file without file-path edited postfile command follows:
postfile `post_handle' `postfile_varlist' using "hello.dta", replace
now, quotations error:
"hello.dta invalid name
without quotation same error hello.dat. doing wrong here? not understand why getting error.
new code:
local mydir /users/f h/desktop/ray/analysis cd "c:/`mydir'/" tempname post_handle local postfile_varlist str12(tau_text) double(pt_est se) pwd postfile `post_handle' `postfile_varlist' /// using "\fig\dta\event_study_m24_p59_sa.dta" /// , replace
i error:
(note: file \fig\dta\event_study_m24_p59_sa.dta not found) file \fig\dta\event_study_m24_p59_sa.dta not opened
the next test works me long have write permission in current directory, , not otherwise.
sysuse auto, clear local outcome drr_trtd tempname post_handle local postfile_varlist str12(tau_text) double(my_price myrep) postutil clear postfile `post_handle' `postfile_varlist' using `outcome'.dta, replace post `post_handle' (make[1]) (price[1]) (rep78[1]) postclose `post_handle' utilize `outcome'.dta, clear list
stata
Comments
Post a Comment