Dear all,
I am writing a simple loop by using the "local" function. The following is my code:
gen pos_a =.
gen pos_b =.
local a = 1
while `a'<=32{
local b=1
while `b'<=32 {
local z=`a'*100 + `b'
quietly ineqdec0 mv190 if mv131==77|mv131==88|mv131==99|mv131==17|mv131== `a'|mv131==`b'
quietly replace gini_wi_group =r(gini) in `z'
quietly replace pos_a=`a' in `z'
quietly replace pos_b=`b' in `z'
local b = `b'+1
}
local a = `a'+1
}
However, an error term of "Obs. nos. out of range" always shows up. When I change the number of 32 to 15 (for instance), it works. The sample size is about 2500. I am wondering why. Any help would be very much appreciated. Thanks a lot.
Best,
Jim
I am writing a simple loop by using the "local" function. The following is my code:
gen pos_a =.
gen pos_b =.
local a = 1
while `a'<=32{
local b=1
while `b'<=32 {
local z=`a'*100 + `b'
quietly ineqdec0 mv190 if mv131==77|mv131==88|mv131==99|mv131==17|mv131== `a'|mv131==`b'
quietly replace gini_wi_group =r(gini) in `z'
quietly replace pos_a=`a' in `z'
quietly replace pos_b=`b' in `z'
local b = `b'+1
}
local a = `a'+1
}
However, an error term of "Obs. nos. out of range" always shows up. When I change the number of 32 to 15 (for instance), it works. The sample size is about 2500. I am wondering why. Any help would be very much appreciated. Thanks a lot.
Best,
Jim
Comment