For loops
Posted: Fri Feb 05, 2010 12:55 pm
Greetings,
I am having trouble with the following for loop. I would like to make every 12th observation equal to a certain number:
create u 500
series myvar = 0
for !i = 1 to 30 step 12
series myvar(!i) = 5
next
but when I run this code, every single observation, for the whole length of the series, gets assigned the number 5.
Any help would be appreciated.
Thanks in advance,
- cap
I am having trouble with the following for loop. I would like to make every 12th observation equal to a certain number:
create u 500
series myvar = 0
for !i = 1 to 30 step 12
series myvar(!i) = 5
next
but when I run this code, every single observation, for the whole length of the series, gets assigned the number 5.
Any help would be appreciated.
Thanks in advance,
- cap