I have panel data between 2014 and 2018 on multiple socioeconomic and demography factors for 108 local authorities in England. I am performing an IV regression where the dependent variable is rent. The control variables are unemployment (unemp), crime rate per 1000 inhabitants (crime), and the number of dwellings per 1000 inhabitants (dwelling). The endogenous variable is refugees (ref) and the instrument I'm using is the foreign-born non-EU population, denoted as "iv". I am investigating the effect that refugees have on rental prices in England. Below is an example of the data:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int(id year) str28 city double ref int rent double(unemp iv dwelling crime) 1 2014 "Birmingham" 0 623 5.2151714077315825 -.021253558637156764 .3900346462436178 272.1134208606856 1 2015 "Birmingham" 8.205689277899343e-06 653 3.99517686340653 -.0013776440554339898 .3883094978550781 274.25081394949444 1 2016 "Birmingham" .00004067487756861852 682 3.971597709354186 .028752619010172335 .3868193048272802 296.34022638106944 1 2017 "Birmingham" .00016101071794679132 706 3.7171110718700335 .006443112229837433 .38335687797986934 336.0215433515804 1 2018 "Birmingham" .00010330213667667315 710 3.572528920367716 .006161045382306198 .383893248973666 366.4554456488441 2 2014 "Leeds" 0 928 4.333027883230789 -.006417851500789889 .44186411834009687 306.98651655975914 2 2015 "Leeds" .00006545359340227778 732 3.0899861080456485 -.01785574028014138 .44080339638809185 341.878399958454 2 2016 "Leeds" .0001051633927528141 659 2.146799982517078 .005637277176947146 .4396312131862368 411.67653509053844 2 2017 "Leeds" .00010412622669693612 749 2.3117193955811675 -.01352998192574386 .4403889308233936 469.63281977401346 2 2018 "Leeds" .00009962105682614976 762 1.702625092119641 .008780702124099739 .44103072348860256 513.3236766537063 3 2014 "Bradford" .00010466222645099905 483 3.868765408685758 .002879162702188392 .3974966812061445 299.2983121562678 3 2015 "Bradford" .00019154181680257917 502 4.493397726114193 .023258107339275556 .3978544969848924 330.17599770421356 3 2016 "Bradford" .00009817507636888152 499 3.0034088690663907 -.023159878111866723 .3972759081557568 404.0241924584403 3 2017 "Bradford" .0002759381898454746 523 2.698296700207994 .016822843927858117 .3993666498023123 480.16939307062415 3 2018 "Bradford" .00018550789813929957 534 1.7724310477679497 -.011471508610189817 .40066270264017595 542.0933716675964 4 2014 "Liverpool" 0 426 2.5557011795543905 .011631485129937143 .20313611683205393 160.74237034263248 4 2015 "Liverpool" 0 488 1.1759880450776294 -.00011795543905635649 .1566788950301598 124.12051869677579 4 2016 "Liverpool" .000014341317622897922 502 1.1552952100176932 -.0005557260578872944 .15726277760068005 132.59365914084546 4 2017 "Liverpool" .00004278871148213678 503 .9759616404642183 -.004519914222896382 .15841696193042384 149.25565244450104 4 2018 "Liverpool" .000023338213141535653 499 .6972101032082229 .008919440731546898 .15968928373986316 161.7295036075341 end
1) I would like generate local authority dummies in order to capture different trends in rental prices at the local level. However, I am unsure of how to create these.
2) I also aim to convert the control variables (Unemployment, crime and dwelling) into one-year lagged variables but once again I am struggling to find the correct way to do so.
Any help with these questions would be greatly appreciated!
0 Response to Creating dummies
Post a Comment