capture log close log using icda06a-count-rev, replace text // program: icda06a-count-rev.do // task: Review 6 - Count Models // 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 **make sure to look at the distribution of your outcome variable describe keep pub6 female phd enrol misschk dropmiss, obs summarize tab1 pub6 female phd enrol dotplot pub6 graph export icda06a-count-rev-fig1.emf , replace // #4 // estimate the poisson regression model poisson pub6 female phd enrol, nolog // #5 // factor change and standardized coefficients listcoef, help // #6 // marginal and discrete change prchange , rest(mean) // #7 // predicted rate and probabilities quietly prvalue, x(female=0) rest(mean) save prvalue, x(female=1) rest(mean) dif // #8 // nbrm nbreg pub6 female phd enrol, // #9 // zip zip pub6 female phd enrol, inf(phd) // #10 // zinb zinb pub6 female phd enrol, inf(phd) // #11 // factor change listcoef, help // #12 // predicted probabilities quietly prvalue, x(phd=1) rest(mean) save prvalue, x(phd=4) rest(mean) diff // #13 // compare models using countfit countfit pub6 female phd enrol, inf(phd) /// graph(icda06a-count-rev-fig2.emf , replace) // #14 // close log file and exit do file log close exit