Hi!
I have a problem that I wonder if anybody can help me with.
I have panel data of individuals were the time period is 2 years. Each individual have a unique identification number (indID) and a house ID which is unique in each region but different regions can have the same number.
What I want to do now is to see if an individual have moved to a new house or not (coded as a 1) and thus changed house ID (there is a theoretical chance that a person moves between two houses with the same house ID but different regions).
I don't know how to solve this but a first start is the following.
xtset indID year
bysort indID: gen Change=1 if house ID!=houseID[_n+1]
My problem with this code is that it gives a 1 in all houses in period 2, independently if houseID have changed or not.
Any good advice or alternative solutions?
Related Posts with Matching different ID between two periods
mixed Command; Using Random Intercept as a Control variablHi. I am using mixed modeling for my multilevel data across countries, industries, and firms. I need…
Two stage Program: First stage is OLS and second is mlogit, error in calculating bootstrap standard errorsStata Code: program my2sls regress son_yrs_schooling ib(first).age_cohort father_yrs_schooling ib(l…
Why does the number of observation differ after the PSM estimation?I used attnd command to estimate nearest-neighbor matching. Then, I got the result as follows. *AT…
Modifying Ben Jann's "appendmodels" program for different commands.Hello, I am using Ben Jann's appendmodels program which can be found here. The program works perfec…
Unsignificant resultsMy name is Muhammad Rashid student of MS BA I have panel data for 10 years of 1600 companies when I …
Subscribe to:
Post Comments (Atom)
0 Response to Matching different ID between two periods
Post a Comment