I'm new to Stata and would highly appreciate any help.
I have a panel data. I want to implement for the following algorithm but I cannot figure out the implementation in Stata.
for id
for time
for x = var(id, time)
for y = var(id, time-1)
if x !=y then
flag = 1
else if x = y then
flag = 0
end if
end
end
end
end
0 Response to Looping with lagged values
Post a Comment