clear
set obs 10
gen randnum = .
local i = 1
while `i' < 11 {
local r = ceil(runiform()*100)
if !inlist(r, randnum) {
replace randnum = r in `i'
local i = `i' + 1
}
else{
local i = `i'
}
}
. do "C:\Users\good\AppData\Local\Temp\STD668c_000000.t mp"
. while `i' < 11 {
2. local r = ceil(runiform()*100)
3. if !inlist(r, randnum) {
4. replace randnum = r in `i'
5. local i = `i' + 1
6. }
7. else{
8. local i = `i'
9. }
10. }
<11 invalid name
r(198);
The error invalid name?Why?I even check it by the example in help.
set obs 10
gen randnum = .
local i = 1
while `i' < 11 {
local r = ceil(runiform()*100)
if !inlist(r, randnum) {
replace randnum = r in `i'
local i = `i' + 1
}
else{
local i = `i'
}
}
. do "C:\Users\good\AppData\Local\Temp\STD668c_000000.t mp"
. while `i' < 11 {
2. local r = ceil(runiform()*100)
3. if !inlist(r, randnum) {
4. replace randnum = r in `i'
5. local i = `i' + 1
6. }
7. else{
8. local i = `i'
9. }
10. }
<11 invalid name
r(198);
The error invalid name?Why?I even check it by the example in help.

Comment