version 12 * DISCLAIMER: The following code is provided as is and should be used at your own risk. * No user support is available. * * Nigel Rice, 2007, Last updated 12 January 2012 * * * This program relates to the material described in Chapter 8 of the book * Jones, A.M., Rice, N., Bago d'Uva, T. & Balia, S. (2012) * "Applied Health Economics. Second Edition", London: Routledge. * To run this do-file (main file) in Stata the user must: * 1) Store the ancilliary do-file “hausman_alt.do” in the same * directory as the main file. * PRELIMINARIES clear all set trace off set more off program drop _all * Alter the following command to match the folder that you are using: cd "c:\My Documents\Routledge book\2nd edition\programs\" capture log close log using "AHE_2ed_Ch8.log", replace use "AHE_2ed_Ch_8.dta", clear *Descriptive Statistics* drop if male ~= 1 /* Analysis for Men */ summ wage lnwage age exp jbsize SouthW London Midland NorthW NorthE Scot Wales covmem covnon jobpriv ljtrain widow divsep nvrmar kids04 white deg ocse alevel hndct hlghq1 sahex sahgd prof manag skllnm skllm jobpt *-------------------------------------------------------------------------------------- *Section 8.3: Empirical model and Estimation* clonevar y=lnwage global xvars "age agesqrd exp expsqrd jbsize covmem covnon jobpriv ljtrain widow divsep nvrmar kids04 hlghq1 sahex sahgd prof manag skllnm skllm white deg SouthW London Midland NorthW NorthE Scot Wales yr9293 yr9394 yr9495 yr9596" global xvars_fe "exp expsqrd jbsize covmem covnon jobpriv ljtrain widow divsep nvrmar kids04 hlghq1 sahex sahgd prof manag skllnm skllm SouthW London Midland NorthW NorthE Scot Wales yr9293 yr9394 yr9495 yr9596" regress y $xvars sort pid wavenum /*Random effects specification with grouping across individuals*/ xtset pid wavenum xtreg y $xvars , re estimates store raneff /*Fixed effects specification with grouping across individuals*/ xtreg y $xvars_fe , fe estimates store fixeff hausman fixeff raneff /*Alternative to Hausmann test*/ global depvar y global varlist "agesqrd exp expsqrd jbsize covmem covnon jobpriv ljtrain widow divsep nvrmar kids04 hlghq1 sahex sahgd prof manag skllnm skllm SouthW London Midland NorthW NorthE Scot Wales" global id "pid" do "hausman_alt.do" /*Hausmann and Taylor estimator: Instrumental variables*/ xthtaylor y $xvars , endog(hlghq1 sahex sahgd prof /// manag skllnm skllm deg) estimates store htest hausman fixeff htest /*Amemiya and MaCurdy estimator*/ xthtaylor y $xvars , endog(hlghq1 sahex sahgd prof /// manag skllnm skllm deg) amacurdy estimates store amtest hausman fixeff amtest log close