Hello,
I want to plot the absolute migration from East-Germany to West-Germany from 1990 to 2019 using panel data. My results show a different migration pattern than is usually found with the same data.
This is one approach for absolute migration:
This is another approach for absolute migration:
The idea behind both approaches is that when a person has lived in East-Germany (sampreg == 2) in the previous year and lives in West-Germany (sampreg == 1) in the current year, the person has migrated from east to west.
When I weight (variable phrf) the migration variable to get results for the whole population, the plot also does not look correct.
Are there mistakes in the codes or are there better approaches to create the migration variables and plot them?
Thank you very much in advance for helping.
I want to plot the absolute migration from East-Germany to West-Germany from 1990 to 2019 using panel data. My results show a different migration pattern than is usually found with the same data.
This is one approach for absolute migration:
Code:
gen migration_ost_west = 1 if sampreg == 1 & L.sampreg == 2 egen total_migration_per_year = total(migration_ost_west), by(syear) preserve duplicates drop syear, force twoway (line total_migration_per_year syear if syear >= 1990), /// xtitle(Jahr) ytitle(Absolute Migration von Ost nach West) restore
Code:
gen migration = 1 if sampreg == 1 & sampreg[_n-1] == 2 egen mig_total = sum(migration), by(syear) preserve duplicates drop syear, force line mig_total syear restore
When I weight (variable phrf) the migration variable to get results for the whole population, the plot also does not look correct.
Code:
preserve gen mig_population = migration_ost_west * phrf egen mig_pop_year = sum(mig_population), by(syear) duplicates drop syear, force line mig_pop_year syear if syear >= 1990 restore
Thank you very much in advance for helping.