capture log close log using cda06a-count-rev.log, text replace // pgm: cda06a-count-rev.do // task: Review 6 - Count Models // project: CDA // author: your name // date: today's date * 1 setup version 10 set linesize 80 clear all macro drop _all * 2 load data use sci-review2, clear * 3 select variables and examine **make sure to look at the distribution of your outcome variable keep pub6 female phd enrol sum pub6 female phd enrol tab pub6 , m dotplot pub6 graph export cda06a-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(cda06a-count-rev-fig2.emf , replace) * 14 close log & exit do-file log close exit