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
Related Posts with Looping with lagged values
Is it available to use fixed effect term in xtgee ?I read one article to identify effects of policies. The article was published from a high IF journal…
Matching 2 datasets based on multiple criteriaDear all, I am using Stata 13.1 and trying to match two datasets in the following logic: The first…
Factor Analysis for Customer SegmentationI have done FA and identified the number of segments. However, I am unable to assign each respondent…
_const in logistic 0?Hello everyone, I´m fitting a logistic regression model and get a constant value close to 0, is thi…
graph box and graph boxDear Stata users, I have a continuous variable and I want to present the minimum value, maximum valu…
Subscribe to:
Post Comments (Atom)
0 Response to Looping with lagged values
Post a Comment