* cda08a-review8.do - CDA Lab Guide 8: Models for Count Outcomes - 23May2007 capture log close set more off estimates clear * 1 open the log log using cda08a-review8.log, replace text version 9.2 set scheme s2mono * 2 load and clean the data use science3, clear drop if pub6>=. | female>=. | phd>=. | enrol>=. sum pub6 female phd enrol * 3 estimate the Poisson regression model poisson pub6 female phd enrol, nolog * 4 factor change and standardized coefficients listcoef, help * 5 marginal and discrete change prchange * 6 predicted rate and probabilities prvalue, x(female=0) rest(mean) prvalue, x(female=1) rest(mean) * 7 predicted probabilites in sample prcounts prm, plot max(9) sum prm* * 8 nbrm nbreg pub6 female phd enrol, nolog * 9 predicted probabilities in the sample prcounts nbr, plot max(9) sum nbr* * 10 plot predicted and sample probabilities scatter nbrobeq nbrpreq prmpreq nbrval, /// c(l l l) ytitle("Probability(y=k)") graph export cda08a-review8-fig1.emf, replace * 11 zip zip pub6 female phd enrol, inf(female phd enrol) nolog * 12 factor change, discrete change, and marginal effects listcoef, help prchange, rest(mean) * 13 zinb zinb pub6 female phd enrol, inf(female phd enrol) nolog * 14 factor change, discrete change, and marginal effects listcoef, help prchange, rest(mean) * 15 Close up log close exit