*********SIBLINGS DATA ANALYSIS******** clear set more off capture log close /*set mem 100000*/ use "C:\Users\John\Documents\Teach\ox_course\siblings.dta", clear log using "C:\Users\John\Documents\Teach\ox_course\siblings.log", replace la var x "number of siblings identified in data" xtset mapid pid xtdes xtsum age sex years payears mayears yob misspa aveyears lnpay avelnpay x pahgs mahgs plbornc xtsum age sex years payears mayears yob misspa aveyears lnpay avelnpay x pahgs mahgs plbornc if age>=22 & x>1 & x~=. ta x if age>=22 ***CALCULATE SIBING CORRELATION IN YEARS OF EDUCATION FOR SIBLINGS AGED >21 AND AT LEAST 2 SIBS IN DATA** xtreg years if age>=22 & x>1 & x~=., re ***CONTROL FOR AGE AND SEX IN CALCULATING THE CORRELATION** xtreg years age sex if age>=22 & x>1 & x~=., re **REGRESS YEARS OF EDUCATION ON AVERAGE PARENTS' YEARS OF EDUCATION** xtreg years aveyears age sex if age>=22 & x>1 & x~=., re xttest0 **REGRESS YEARS OF EDUCATION ON MOTHER'S YEARS OF EDUCATION** xtreg years mayears age sex if age>=22 & x>1 & x~=., re **REGRESS YEARS OF EDUCATION ON MOTHER'S AND FATHER'S YEARS OF EDUCATION** xtreg years mayears payears age sex if age>=22 & x>1 & x~=., re ***ANALYSIS OF LOG PAY OF SIBLINGS*** ***REGRESS LOG PAY ON OWN YEARS OF EDUCATION** xtreg lnpay years age sex if age>=22 & x>1 & x~=., re xttest0 ***ALSO CONTROL FOR PARENTS' EDUCATION** xtreg lnpay years age sex aveyears if age>=22 & x>1 & x~=., re xtreg lnpay years age sex mayears payears if age>=22 & x>1 & x~=., re exit