For loops with numerical variables - resulting object-order
Posted: Sun Feb 02, 2014 1:05 pm
Hello,
I´m running For-loops with numerical variables, just as an example:
rndseed 123
For !i = 1 to 1000
!w1 = @runif(0.1,1)
!w2 = @runif(0.1,1)
!w3 = @runif(0.1,1)
!w1n = (!w1)/(!w1 + !w2 + !w3)
!w2n = (!w2)/(!w1 + !w2 + !w3)
!w3n = (!w3)/(!w1 + !w2 + !w3)
series hdi!i = edu^(!w1n) * lexp^(!w2n) * inc^(!w3n)
next
As a result I´m getting the following object-order in my workfile: hdi1, hdi10, hdi100, hdi 1000, hdi101, hdi102, […], hdi11, hdi110, hdi111, hdi112 and so on
How can I create a “normal” order like this: hdi1, hdi2, hdi3, hdi4, hdi5, etc. ?
Thank you very much!
I´m running For-loops with numerical variables, just as an example:
rndseed 123
For !i = 1 to 1000
!w1 = @runif(0.1,1)
!w2 = @runif(0.1,1)
!w3 = @runif(0.1,1)
!w1n = (!w1)/(!w1 + !w2 + !w3)
!w2n = (!w2)/(!w1 + !w2 + !w3)
!w3n = (!w3)/(!w1 + !w2 + !w3)
series hdi!i = edu^(!w1n) * lexp^(!w2n) * inc^(!w3n)
next
As a result I´m getting the following object-order in my workfile: hdi1, hdi10, hdi100, hdi 1000, hdi101, hdi102, […], hdi11, hdi110, hdi111, hdi112 and so on
How can I create a “normal” order like this: hdi1, hdi2, hdi3, hdi4, hdi5, etc. ?
Thank you very much!