capture log close log using icda03a-testing-rev, replace text // program: icda03a-testing-rev.do // task: Review 3 - Testing & Fit // project: ICPSR CDA // author: your name \ today's date // #1 // program setup version 10 clear all set linesize 80 matrix drop _all // #2 // Load data use icpsr_scireview3, clear // #3 // Examine data, select variables, drop missing, and verify describe keep faculty female fellow phd mcit3 mnas misschk dropmiss, obs summarize tab1 faculty female fellow phd mcit mnas // #4 // Compute a z-test logit faculty female fellow phd mcit3 mnas, nolog // #5 // Single coefficient Wald test test female // #6 // Multiple coefficients Wald test test mcit3 mnas // #7 // Equal coefficients Wald test test mcit3 = mnas // #8 // The LR test - store the estimation results logit faculty female fellow phd mcit3 mnas eststo base // #9 // Single coefficient LR test logit faculty fellow phd mcit3 mnas eststo nofemale lrtest base nofemale // #10 // Multiple coefficient LR test logit faculty female fellow phd eststo nomcit3mnas lrtest base nomcit3mnas // #11 // LR test all coefficients are zero logit faculty eststo intercept lrtest base intercept // #12 // Fit statistics quietly logit faculty female fellow phd mcit3 mnas fitstat, save quietly logit faculty female fellow phd fitstat, dif // #13 // Plot Cook's distance quietly logit faculty female fellow phd mcit3 mnas predict cook, dbeta sort phd gen index = _n twoway scatter cook index, ysize(1) xsize(2) /// xlabel(0(100)300) ylabel(0(.2)1., grid) /// xscale(range(0, 300)) yscale(range(0, 1.)) /// xtitle("Observation Number") /// msymbol(none) mlabel(index) mlabposition(0) graph export icda03a-testing-rev-fig1.emf, replace // #14 // Close log file and exit do file log close exit