*Final regressions *03.11.2016 cd "I:\wealth\Migranten und Wohnungseigentum\Data\Datensaetze" use hmaster_mig_aufbereitet.dta, clear cd "I:\wealth\Migranten und Wohnungseigentum\Data\STATA Logfiles" log using regressions_new.log, replace *Decomposition for groups of years gen year2005=1 if jahr>2000 & jahr<2006 replace year2005=0 if jahr<=2000 gen year2012=1 if jahr>=2006 & jahr<=2012 replace year2012=0 if jahr>2000 & jahr<2006 *generate migration cohorts gen c1=1 if immiyear<1976 gen c2=1 if immiyear>=1976 & immiyear<1986 gen c3=1 if immiyear>=1986 & immiyear<1996 gen c4=1 if immiyear>=1996 & immiyear<2006 replace c1=0 if c2==1 | c3==1 | c4==1 replace c2=0 if c1==1 | c3==1 | c4==1 replace c3=0 if c2==1 | c1==1 | c4==1 replace c4=0 if c2==1 | c3==1 | c1==1 *generate income cd "I:\wealth\Migranten und Wohnungseigentum\Data" merge m:1 jahr using "verbraucherpreisindex lang.dta" drop if _merge==2 drop _merge gen netincdef=(netinc/verbraucherpreise)*100 gen netwealthdef=(netwealth/verbraucherpreise)*100 gen netpropdef=(netprop/verbraucherpreise)*100 xtile netinc_quin=netincdef, nq(5) *Regionstyp gen reg_typ2=reg_typ replace reg_typ2=subinstr(reg_typ2, char(228), "ae", .) *Newspaper - less categories gen newspaper2=. replace newspaper2=1 if newspaper==1 | newspaper==2 replace newspaper2=2 if newspaper==3 replace newspaper2=3 if newspaper==4 | newspaper==5 replace newspaper2=4 if newspaper==6 *Household size gen singlehh=1 if numberpers==1 replace singlehh=0 if numberpers>1 replace singlehh=. if numberpers==. *Categories with interaction of gender and hh size gen single_male=(singlehh==1 & mann==1) gen single_female=(singlehh==1 & mann==0) gen couple_male=(singlehh==0 & mann==1) gen couple_female=(singlehh==0 & mann==0) *Education of partner replace educpart=99 if educpart==-1 // Partner, but no information on education replace educpart=0 if singlehh==1 replace educpart=. if partz==. tab educpart singlehh gen educpart2=educpart replace educpart2=. if educpart==99 *Migration background of partner gen migpart=2 if nationpart>1 & nationpart!=. replace migpart=1 if nationpart==1 // deutsch replace migpart=99 if nationpart==-1 // missing replace migpart=0 if nationpart==0 tab migpart singlehh replace migpart=0 if singlehh==1 & partz!=. *Average ysm for each cohort in each observation period foreach var of varlist c1 c2 c3 c4 { sum ysm if year2005==0 & `var'==1 } foreach var of varlist c1 c2 c3 c4 { sum ysm if year2005==1 & `var'==1 } foreach var of varlist c1 c2 c3 c4 { sum ysm if year2012==1 & `var'==1 } ******************************************************************************* *Define variables tab educ, gen(educ) // creates dummy variables tab netinc_quin, gen(net) tab reg_typ2, gen(reg) tab language, gen(lang) tab jahr, gen(jd) tab educpart, gen(edp) tab educpart2, gen(edp2) tab migpart, gen(migp) global xsd "alter31_60 alter60 educ2 educ3 empld married" global xhh "couple_female single_male single_female numberkids net2 net3 net4 net5" global xreg "west reg2 reg3 price" global xmig2 "lang2 lang3 stay" global part "edp21 edp23 edp24 migp1 migp2 migp3 migp4" // less than high school as reference cat ******************************************************************************* ***TABLE 2: Pooled probit regression for migrants and natives*** probit downer $xsd $xhh $xreg c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2 jd* if mig==1, vce(cluster hhnrakt) gen sample=e(sample) // 8058 observations margins, dydx(*) probit downer $xsd $xhh $xreg jd* if mig==0 & jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012, vce(cluster hhnrakt) gen sample_nat=e(sample) // 86,405 observations margins, dydx(*) xtdes if sample==1 xtdes if sample_nat==1 ******* *TABLE A.1: include education and migback of partner -> reduced observation numbers probit downer $part $xsd $xhh $xreg c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2 jd* if mig==1, vce(cluster hhnrakt) margins, dydx(*) /*Random effects xtset persnr jahr xtprobit downer $xsd $xhh $xreg c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2 if mig==1, vce(cluster persnr) re margins, dydx(*) xtprobit downer $xsd $xhh $xreg if mig==0 & jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012, vce(cluster persnr) re margins, dydx(*) */ ******************************************************************************* ***TABLE 3:Decompose between 1996 and 2005*** *Fairlie decomposition fairlie downer (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1, by(year2005) ref(1) probit noest // with migration related variables gen sample1=e(sample) // sample 1996-2005 fairlie downer ($xsd) ($xhh) ($xreg) if mig==1 & sample1==1, by(year2005) ref(1) probit noest // w/o migration rel. variables *Decompose between 2000 and 2012 fairlie downer (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1, by(year2012) ref(1) probit noest // with migration related variables gen sample2=e(sample) // sample 2000-2012 fairlie downer ($xsd) ($xhh) ($xreg) if mig==1 & sample2==1, by(year2012) ref(1) probit noest // w/o migration rel. variables ******** *TABLE A.2: include education and migback of partner fairlie downer ($part) (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1, by(year2005) ref(1) probit noest ro // with migration related variables gen sample12=e(sample) fairlie downer ($part) ($xsd) ($xhh) ($xreg) if mig==1 & sample12==1, by(year2005) ref(1) probit noest ro // w/o migration rel. variables fairlie downer ($part) (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1, by(year2012) ref(1) probit noest ro // with migration related variables gen sample22=e(sample) // sample 2000-2012 fairlie downer ($part) ($xsd) ($xhh) ($xreg) if mig==1 & sample22==1, by(year2012) ref(1) probit noest ro // w/o migration rel. variables ******************************************************************************* ***TABLE 4: More detilied decomposition*** fairlie downer c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2 $xsd $xhh $xreg if mig==1 & sample1==1, by(year2005) ref(1) probit noest fairlie downer c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2 $xsd $xhh $xreg if mig==1 & sample2==1 , by(year2012) ref(1) probit noest ******************************************************************************* ***TABLE A.3: Compare with natives*** fairlie downer ($xsd) ($xhh) ($xreg) if mig==0 & jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012, by(year2005) ref(1) probit noest fairlie downer ($xsd) ($xhh) ($xreg) if mig==0 & jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012, by(year2012) ref(1) probit noest ******************************************************************************* *TABLE A.4: More detailed decomposition for natives*** fairlie downer $xsd $xhh $xreg if mig==0 & jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012, by(year2005) ref(1) probit noest fairlie downer $xsd $xhh $xreg if mig==0 & jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012, by(year2012) ref(1) probit noest ******************************************************************************* *********** *Robustness Checks ***TABLE 6: Change ordering of variables (coarse characteristics categories)*** *reverse fairlie downer ($xreg) ($xhh) ($xsd) (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) if sample1==1, by(year2005) ref(1) probit noest fairlie downer ($xreg) ($xhh) ($xsd) (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) if sample2==1, by(year2012) ref(1) probit noest *other orderings fairlie downer ($xhh) ($xsd) (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xreg) if sample1==1, by(year2005) ref(1) probit noest fairlie downer ($xhh) ($xsd) (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xreg) if sample2==1, by(year2012) ref(1) probit noest fairlie downer ($xsd) (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xreg) ($xhh) if sample1==1, by(year2005) ref(1) probit noest fairlie downer ($xsd) (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xreg) ($xhh) if sample2==1, by(year2012) ref(1) probit noest fairlie downer (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xreg) ($xhh) ($xsd) if sample1==1, by(year2005) ref(1) probit noest fairlie downer (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xreg) ($xhh) ($xsd) if sample2==1, by(year2012) ref(1) probit noest *randomized fairlie downer (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if sample1==1, by(year2005) ref(1) probit noest ro fairlie downer (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if sample2==1, by(year2012) ref(1) probit noest ro ***TABLE 7: randomized and detailed*** fairlie downer c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2 $xsd $xhh $xreg if mig==1, by(year2005) ref(1) probit noest ro fairlie downer c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2 $xsd $xhh $xreg if mig==1, by(year2012) ref(1) probit noest ro ************* *TABLE 8: Change of reference group *group 0 as reference group fairlie downer (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 & sample1==1, by(year2005) ref(0) probit noest fairlie downer (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 & sample2==1, by(year2012) ref(0) probit noest *pooled model as reference group fairlie downer (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 & sample1==1, by(year2005) pooled probit noest fairlie downer (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 & sample2==1, by(year2012) pooled probit noest log close ************ *TABLE A.3: snapshot of individual years: 1998, 2004 and 2009 (middle of period) gen group1=1 if jahr==2003 replace group1=0 if jahr==1998 gen group2=1 if jahr==2009 replace group2=0 if jahr==2003 fairlie downer (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 [pweight=hhrf], by(group1) ref(1) probit noest ro // with migration related variables fairlie downer (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 [pweight=hhrf], by(group2) ref(1) probit noest ro // with migration related variables drop group1 group2 *1996, 2001 and 2007 (begin of period) gen group1=1 if jahr==2001 replace group1=0 if jahr==1996 gen group2=1 if jahr==2007 replace group2=0 if jahr==2001 fairlie downer (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 [pweight=hhrf], by(group1) ref(1) probit noest ro // with migration related variables fairlie downer (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 [pweight=hhrf], by(group2) ref(1) probit noest ro // with migration related variables drop group1 group2 *2000, 2005 and 2011 (end of period) gen group1=1 if jahr==2005 replace group1=0 if jahr==2000 gen group2=1 if jahr==2011 replace group2=0 if jahr==2005 fairlie downer (c2 c3 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 [pweight=hhrf], by(group1) ref(1) probit noest ro // with migration related variables fairlie downer (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 [pweight=hhrf], by(group2) ref(1) probit noest ro // with migration related variables drop group1 group2 *2007 and 2011 gen group1=1 if jahr==2011 replace group1=0 if jahr==2007 fairlie downer (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 [pweight=hhrf], by(group1) ref(1) probit noest ro // with migration related variables drop group1 *1996 and 2011 gen group1=1 if jahr==2011 replace group1=0 if jahr==1996 fairlie downer (c2 c3 c4 oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if mig==1 [pweight=hhrf], by(group1) ref(1) probit noest ro // with migration related variables drop group1 ************************ *TABLE 5 Change of nativity gap gen group1=1 if year2005==0 & mig==1 // first period, migrants replace group1=0 if year2005==0 & mig==0 // first period, natives fairlie downer ($xsd) ($xhh) ($xreg) if (mig==1 & sample1==1) | (mig==0 & jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012) , by(group1) ref(1) probit noest ro gen group2=1 if year2005==1 & mig==1 // second period, migrants replace group2=0 if year2005==1 & mig==0 // second period, natives fairlie downer ($xsd) ($xhh) ($xreg) if (mig==1 & sample1==1) | (mig==0 & jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012) , by(group2) ref(1) probit noest ro gen group3=1 if year2012==1 & mig==1 // third period, migrants replace group3=0 if year2012==1 & mig==0 // third period, natives fairlie downer ($xsd) ($xhh) ($xreg) if (mig==1 & sample2==1) | (mig==0 & jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012) , by(group3) ref(1) probit noest ro **Decomposition of change of gap qui reg downer $xsd $xhh $xreg if sample1==1 & year2005==0 & mig==1 eststo mig1 qui reg downer $xsd $xhh $xreg if jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012 & year2005==0 & mig==0 eststo nat1 qui reg downer $xsd $xhh $xreg if sample1==1 & year2005==1 & mig==1 eststo mig2 qui reg downer $xsd $xhh $xreg if jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012 & year2005==1 & mig==0 eststo nat2 smithwelch mig1 nat1 mig2 nat2, b(1) r(2) eststo clear qui reg downer $xsd $xhh $xreg if sample2==1 & year2012==0 & mig==1 eststo mig1 qui reg downer $xsd $xhh $xreg if jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012 & year2012==0 & mig==0 eststo nat1 qui reg downer $xsd $xhh $xreg if sample2==1 & year2012==1 & mig==1 eststo mig2 qui reg downer $xsd $xhh $xreg if jahr!=2002 & jahr!=2004 & jahr!=2006 & jahr!=2012 & year2012==1 & mig==0 eststo nat2 smithwelch mig1 nat1 mig2 nat2, b(1) r(2) eststo clear ******************************************************************************** /**Decomposition separately for cohorts** cd "D:\Promotion\Housing Prices and Fertility\Literatur\Home-ownership\Migrants\Logfiles HH Daten" log using regressions_new.log, append tab alterKat3 if c1==1 & jahr==1996 tab alterKat3 if c1==1 & jahr==2006 tab alterKat3 if c1==1 & jahr==2012 tab corigin2 if c1==1 & jahr==1996 *1996-2005 *C1 fairlie downer (oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if c1==1, by(year2005) ref(1) probit noest ro gen sample3=e(sample) fairlie downer ($xsd) ($xhh) ($xreg) if c1==1 & sample3==1, by(year2005) ref(1) probit noest ro *C2 fairlie downer (oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if c2==1, by(year2005) ref(1) probit noest ro gen sample4=e(sample) fairlie downer ($xsd) ($xhh) ($xreg) if c2==1 & sample4==1, by(year2005) ref(1) probit noest ro *C3 fairlie downer (oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if c3==1, by(year2005) ref(1) probit noest ro gen sample5=e(sample) fairlie downer ($xsd) ($xhh) ($xreg) if c3==1 & sample5==1, by(year2005) ref(1) probit noest ro *2000-2012 *C1 fairlie downer (oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if c1==1, by(year2012) ref(1) probit noest ro gen sample6=e(sample) fairlie downer ($xsd) ($xhh) ($xreg) if c1==1 & sample6==1, by(year2012) ref(1) probit noest ro *C2 fairlie downer (oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if c2==1, by(year2012) ref(1) probit noest ro gen sample7=e(sample) fairlie downer ($xsd) ($xhh) ($xreg) if c2==1 & sample7==1, by(year2012) ref(1) probit noest ro *C3 fairlie downer (oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if c3==1, by(year2012) ref(1) probit noest ro gen sample8=e(sample) fairlie downer ($xsd) ($xhh) ($xreg) if c3==1 & sample8==1, by(year2012) ref(1) probit noest ro *C4 fairlie downer (oecd2 eu2 turkey2 yugos2 otherorigin2 $xmig2) ($xsd) ($xhh) ($xreg) if c4==1, by(year2012) ref(1) probit noest ro gen sample9=e(sample) fairlie downer ($xsd) ($xhh) ($xreg) if c4==1 & sample9==1, by(year2012) ref(1) probit noest ro drop sample3 sample4 sample5 sample6 sample7 sample8 sample9 log close