Hi everyone,
I think my question is quite simple but I wasn't able to solve it.
I have a panel dataset with information on 280 housing units over 24 time periods (years). For every unit and period I have the monthly rent of the unit (rr) and a dummy called t_change, which takes on value 1 if a new tenant enters the unit during that year.
I want Stata to generate a variable reporting the difference between the rent paid by tenants who just entered the unit (so, the rent paid in years when t_change = 1) and the rent paid for the same unit in the year before (by the old tenant).
What is the easiest way to do this?
Aurora
Related Posts with Generating a variable reporting the difference between values of another variable considered in different years (Panel dataset)
How to put all graphs in a same pdf file?Hello. I would like to know if it is possible to make Stata combine all pdf generated by the loop b…
How to drop sequence of observations when the observations are zero sequentlyI am now cleaning my firm-level data. I have panel data which contains 19,150 observations/year for …
margins plot for*interaction of two continuous variablesHi, I am trying to create a margins plot to illustrate the interaction term between savings rate (% …
Changing Type of Local VariablesI have an imported dataset where I need to rename all of the variables and want to use the imported …
Unit root test on panel dataHi! I have a panel data with 155 countries and 43 years. I tried the command Code: xtunitroot ht…
Subscribe to:
Post Comments (Atom)
0 Response to Generating a variable reporting the difference between values of another variable considered in different years (Panel dataset)
Post a Comment