比如:
forvalues i=1/5{
use "C/Desktop/Statistic/data`i'.dta",clear
drop if var1==0
save "C/Desktop/Statistic/newdata_`j'",replace
}
我在Statistic这个文件夹里只有data1、data2、data3、data5这四个数据,要怎么实现跳过`i'==4,而直接到`i'==5呢?
之前用过【capture】如下:
forvalues i=1/5{
capture use "C/Desktop/Statistic/data`i'.dta",clear
drop if var1==0
save "C/Desktop/Statistic/newdata_`j'",replace
}
结果还是生成了5个newdata,其中第四个使用了第三个的数据。