简单来说就是i和c都没法按正常取值,会不会和stata的版本有关。其它教授用同样的do file已经得出结果。。心塞。。。求助
第一次发帖,不知道对不对版块。。。
I am running this do file for a professor, and he said other professors already sucessfully got the result using it. However, when I wanna use the do file, it is showing "files ResultsAN_.dta can't be found".
What is wrong is that the file name does not take values into i and c, which they defined using the "foreach" command.
(in the previous simulations, I got a bunch of dta named ResultsAN_1_10C or ResultsAN_1_25NC and so on)
Does anyone know how to fix it?? Thanks!
local v=6
cd "I:\p\PS\Simulation"
log using "montecarlo.txt", replace
foreach i in 1_10 1_25 1_50 2_10 2_25 2_50 3_10 3_25 3_50 {
foreach c in NC C {
qui putexcel B2=("New AN Dummy") using MonteCarloResultsV`v', sheet("`i' + `c'") modify
qui putexcel C2=("New VC Dummy") using MonteCarloResultsV`v', sheet("`i' + `c'") modify
** Directory #1
use "I:\p\PS\Simulation\ResultsAN_`i'`c'.dta"
ttest coef==0 if var=="AN_anyrd"
return list
qui putexcel B3=(r(mu_1)) using MonteCarloResultsV`v', sheet("`i' + `c'") modify