Hello everyone,
I am a beginner user of stata and was trying to create a loop to fill the missing values of a variable. To do that I used stored data in r(N). However the loop should conclude at some point but it does not end at all.
This is my relevant part of the code. r(N) should become 0 at some point but it gets stuck at 8 somehow. I could not figure out what is wrong. Any help is appreciated!
I am a beginner user of stata and was trying to create a loop to fill the missing values of a variable. To do that I used stored data in r(N). However the loop should conclude at some point but it does not end at all.
count if missing(unemplength)
return list, all
while `r(N)' >= 1 {
replace unemplength = unemplength[_n+1] if missing(unemplength)
count if missing(unemplength)
return list, all
}
return list, all
while `r(N)' >= 1 {
replace unemplength = unemplength[_n+1] if missing(unemplength)
count if missing(unemplength)
return list, all
}
Comment