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
Understanding heckmanI have a very basic question about the Heckman code. Assuming I have the code below, which variables…
Confidence interval crossing axis values.Hi everyone, I am interested in finding exact values where confidence intervals intersects with axis…
Create table (by stacking different regression models)My goal is to create a table that looks like this: 1. Each entry (horizontal) represents a new mode…
Generating new variables out of existing ones using a loopHello, I am working with a dataset which contains daily stock prices of over 300 stocks. Each stock…
psmatch2 with missing data using multiple imputation syntax?Hello All, I hope that all is well. I am starting to see more publications using MI and psmatch2. I …
Subscribe to:
Post Comments (Atom)
0 Response to Looping with lagged values
Post a Comment