Hi there,
I am quite new to STATA and am still getting to grips with the syntax. I want to loop through my variables using something like:
local j
j=2
while (var(j)==var(j-1)) { /*Here, var(j) means the j'th observation of the variable 'var'*/
My question is how should I be writing the var(j) part? Also, should I be using _n instead of declaring some j?
Thanks
I am quite new to STATA and am still getting to grips with the syntax. I want to loop through my variables using something like:
local j
j=2
while (var(j)==var(j-1)) { /*Here, var(j) means the j'th observation of the variable 'var'*/
...do something...}
j=j+1
My question is how should I be writing the var(j) part? Also, should I be using _n instead of declaring some j?
Thanks
Comment