【发布时间】:2014-09-07 07:21:08
【问题描述】:
所以这按预期工作:
. forvalues i = 1(1)3 {
2. di `i'
3. }
1
2
3
这不是:
. forvalues i = 3(1)1 {
2. di `i'
3. }
<--- that's an empty line that returns from the above loop.
如果我想生产
3
2
1
我真的需要解决这个问题吗?
. forvalues i = 1(1)3 {
2. di 3+1-`i'
3. }
为什么?
【问题讨论】:
-
forv i = 3(-1) 1你的步数是 -1 而不是 1。 -
请回答! :)
-
不客气。请注意,即使在最悲观的情况下,3 + 1 也可以重写为 4。
-
@NickCox Natch...当然 `k'+1 也可能有用... :)
标签: stata