My search on this topic has not been satisfactory:
https://www.statalist.org/forums/for...stfile-command
https://www.stata.com/statalist/arch.../msg01072.html
https://www.stata.com/statalist/arch.../msg00382.html
So, my question is: How can I successfully run the code below and skip the instances in which Stata returns r(2000)? E.g., all observations failed (event=1 for all items) or did not fail (event=0 for all items). In my do file, that simple simulation stops at step 2.
Code:
*! step 1 clear set obs 100 gene trt = runiform()<0.5 gene event = runiform()<0.2 logit event trt *! step 2 cap drop trt event set obs 100 gene trt = runiform()<0.5 gene event = runiform()<0.001 logit event trt *! step 3 cap drop trt event set obs 100 gene trt = runiform()<0.5 gene event = runiform()<0.999 logit event trt *! step 4 cap drop trt event set obs 100 gene trt = runiform()<0.5 gene event = runiform()<0.2 logit event trt
Tiago
0 Response to How to skip the r(2000) error and continue with code in Stata
Post a Comment