*********EXAMPLE DATA ANALYSIS******** clear /*clear matrix clear mata*/ set more off capture log close set mem 100000 use "C:\Users\John\Documents\Teach\ox_course\csupport_eg.dta", clear log using "C:\Users\John\Documents\Teach\ox_course\eg_data.log", replace *****LAB SESSION************* *** PLOT /*twoway (scatter cshare pshare) (lfit cshare pshare) */ xtset pp wave ***DESCRIPTIVES xtdes xtsum cshare pshare oshare lnhhinc common hers cohab age duration childsup xttab childsup **DO BASIC REGRESSIONS** reg cshare pshare, r cl(pp) xtreg cshare pshare, fe est store fxd0 xtreg cshare pshare, re xttest0 hausman fxd0 . xtreg cshare pshare, be *****MUNDLAK******** egen mipshare=mean(pshare), by(pp) xtreg cshare pshare mipshare, re ***OLS, FE AND RE*** reg cshare pshare oshare lnhhinc common hers cohab duration , r cl(pp) xtreg cshare pshare oshare lnhhinc common hers cohab duration , fe est store fxd xtreg cshare pshare oshare lnhhinc common hers cohab duration , re hausman fxd . **FE LOGIT ESTIMATES** xtlogit childsup pshare lnhhinc cohab oshare common hers duration, fe est store lfxd xtlogit childsup pshare lnhhinc cohab oshare common hers duration, re nolog hausman lfxd ., eq(1:1) logit childsup pshare lnhhinc cohab oshare common hers duration hausman lfxd ., eq(1:1) ***PROBIT/TOBIT*** **CREATE WITHIN FATHER MEANS FOR PROBIT/TOBIT** egen mioshare=mean(oshare), by(pp) egen milnhhinc=mean(lnhhinc), by(pp) egen micohab=mean(cohab), by(pp) egen micommon=mean(common), by(pp) egen mihers=mean(hers), by(pp) egen miduration=mean(duration), by(pp) xtprobit childsup pshare oshare lnhhinc common hers cohab duration /* */ mipshare mioshare milnhhinc micommon mihers micohab miduration test mipshare milnhhinc micohab miduration mioshare micommon mihers xttobit cshare pshare oshare lnhhinc common hers cohab duration /* */ mipshare mioshare milnhhinc micommon mihers micohab miduration , ll(0) nolog test mipshare milnhhinc micohab miduration mioshare micommon mihers predict support sum cshare support exit ************************************************************************************************************************************************************