/* Single-site count data model */ #delimit ; set mem 30m; set matsize 80; set logtype text; log using c:\klaus\apec64\spring_07\stata\logs\tc_single,replace; use c:\klaus\apec64\spring_07\stata\data\W3trips,replace; /* STEP 1: variable definitions and sample statistics*/ describe; sum; /* STEP 2: run simple Poisson model and examine marginal effects*/ poisson tripsW3 gender age fishyrs inc0000 tcW3; /* Step 3: predict trips at current situation (status quo), and examine the distribution of predictions */ predict lamdahat; sum lamdahat, det; /*STEP 4: derive & summarize seasonal welfare at status quo*/ gen cs =-(1/_b[tcW3])*lamdahat; sum cs, det; /* "det" means show details, such as median, percentiles etc */ gen cv =-(1/(_b[inc0000]/10000))*log(1+((_b[inc0000]/10000)/_b[tcW3])*lamdahat); sum cv, det; gen ev =(1/(_b[inc0000]/10000))*log(1-((_b[inc0000]/10000)/_b[tcW3])*lamdahat); sum ev, det; /* ************************************************************ */ /* Assume the policy scenario is "implement access fees of $5" */ /* ************************************************************ */ /*STEP 5: Predict visits under these fees*/ gen tc_5 = tcW3+5; /* add $5 to everybody's travel cost */ gen lamdahat5 = exp(_b[_cons]+ _b[gender]*gender +_b[age]*age + _b[fishyrs]*fishyrs + _b[inc0000]*inc0000 + _b[tcW3]*tc_5); /* note the new tc variable at the end! */ /* STEP 6: Compute the per-person welfare loss under the new fee */ gen cs5 = -(1/_b[tcW3])*(lamdahat-lamdahat5); sum cs5; gen cv5 = -(1/(_b[inc0000]/10000))*log(1+((_b[inc0000]/10000)/_b[tcW3])* (lamdahat-lamdahat5)); sum cv5; gen ev5 = (1/(_b[inc0000]/10000))*log(1-((_b[inc0000]/10000)/_b[tcW3])*(lamdahat-lamdahat5)); sum ev5; log close;