---------------------------------------------------------------------------------------------------- log: c:\klaus\apec64\spring_07\stata\logs\tc_multiple.log log type: text opened on: 16 Feb 2007, 12:37:16 . use c:\klaus\apec64\spring_07\stata\data\multi_sites3,replace; . /* STEP 1: variable definitions and sample statistics*/ > > describe; Contains data from c:\klaus\apec64\spring_07\stata\data\multi_sites3.dta obs: 1,617 vars: 18 16 Feb 2007 12:31 size: 145,530 (99.5% of memory free) ------------------------------------------------------------------------------- storage display value variable name type format label variable label ------------------------------------------------------------------------------- survey_id str6 %6s original survey ID site byte %9.0g fishing site fishyrs double %10.0g years of fishing flyfish double %10.0g flyfish 1=flyfish gender double %10.0g gender gender age double %10.0g age income double %10.0g income in dollars (category midpoint) tc double %10.0g travel cost visits float %9.0g trips in 2004 and 2005 inc0000 float %9.0g income in 10,000 dollars runid float %9.0g running id personid float %9.0g group(survey_id) s3 byte %8.0g site== 3.0000 s4 byte %8.0g site== 4.0000 s5 byte %8.0g site== 5.0000 tc3 float %9.0g tc4 float %9.0g tc5 float %9.0g ------------------------------------------------------------------------------- Sorted by: survey_id site . sum; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- survey_id | 0 site | 1617 4 .8167492 3 5 fishyrs | 1617 38.08163 16.24764 1 81 flyfish | 1617 .5213358 .4996991 0 1 gender | 1617 .1502783 .3574545 0 1 -------------+-------------------------------------------------------- age | 1617 51.84972 13.75885 18 89 income | 1617 82940.63 59409.64 10000 350000 tc | 1617 69.06278 48.60371 4.835596 417.3629 visits | 1617 .8998145 4.026811 0 80 inc0000 | 1617 8.294063 5.940964 1 35 -------------+-------------------------------------------------------- runid | 1617 809 466.932 1 1617 personid | 1617 270 155.6438 1 539 s3 | 1617 .3333333 .4715504 0 1 s4 | 1617 .3333333 .4715504 0 1 s5 | 1617 .3333333 .4715504 0 1 -------------+-------------------------------------------------------- tc3 | 1617 17.92067 39.45178 0 417.3629 tc4 | 1617 27.03842 45.73924 0 371.9904 tc5 | 1617 24.1037 43.03713 0 387.1554 . table site, c(sum visits) row; ----------------------- fishing | site | sum(visits) ----------+------------ 3 | 640 4 | 331 5 | 484 | Total | 1455 ----------------------- . /* get total visits by site plus a row total*/ > sort site; . by site: tab visits; ---------------------------------------------------------------------------------------------------- -> site = 3 trips in | 2004 and | 2005 | Freq. Percent Cum. ------------+----------------------------------- 0 | 457 84.79 84.79 1 | 14 2.60 87.38 2 | 15 2.78 90.17 3 | 8 1.48 91.65 4 | 12 2.23 93.88 5 | 5 0.93 94.81 6 | 5 0.93 95.73 7 | 4 0.74 96.47 8 | 2 0.37 96.85 9 | 2 0.37 97.22 10 | 4 0.74 97.96 14 | 2 0.37 98.33 16 | 1 0.19 98.52 20 | 2 0.37 98.89 25 | 1 0.19 99.07 30 | 1 0.19 99.26 40 | 1 0.19 99.44 48 | 1 0.19 99.63 60 | 1 0.19 99.81 80 | 1 0.19 100.00 ------------+----------------------------------- Total | 539 100.00 ---------------------------------------------------------------------------------------------------- -> site = 4 trips in | 2004 and | 2005 | Freq. Percent Cum. ------------+----------------------------------- 0 | 478 88.68 88.68 1 | 17 3.15 91.84 2 | 12 2.23 94.06 3 | 2 0.37 94.43 4 | 5 0.93 95.36 5 | 5 0.93 96.29 6 | 4 0.74 97.03 7 | 4 0.74 97.77 8 | 3 0.56 98.33 9 | 2 0.37 98.70 10 | 1 0.19 98.89 12 | 1 0.19 99.07 16 | 1 0.19 99.26 20 | 1 0.19 99.44 22 | 1 0.19 99.63 30 | 1 0.19 99.81 35 | 1 0.19 100.00 ------------+----------------------------------- Total | 539 100.00 ---------------------------------------------------------------------------------------------------- -> site = 5 trips in | 2004 and | 2005 | Freq. Percent Cum. ------------+----------------------------------- 0 | 444 82.37 82.37 1 | 21 3.90 86.27 2 | 16 2.97 89.24 3 | 8 1.48 90.72 4 | 11 2.04 92.76 5 | 5 0.93 93.69 6 | 5 0.93 94.62 7 | 7 1.30 95.92 8 | 5 0.93 96.85 9 | 3 0.56 97.40 10 | 6 1.11 98.52 11 | 2 0.37 98.89 13 | 1 0.19 99.07 14 | 1 0.19 99.26 15 | 1 0.19 99.44 16 | 1 0.19 99.63 22 | 1 0.19 99.81 30 | 1 0.19 100.00 ------------+----------------------------------- Total | 539 100.00 . by site: sum visits; ---------------------------------------------------------------------------------------------------- -> site = 3 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- visits | 539 1.187384 5.727076 0 80 ---------------------------------------------------------------------------------------------------- -> site = 4 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- visits | 539 .6141002 2.823077 0 35 ---------------------------------------------------------------------------------------------------- -> site = 5 Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- visits | 539 .8979592 2.787848 0 30 . /* STEP 2: run multi-site Poisson model and examine marginal effects*/ > > poisson visits s3 s4 s5 gender age fishyrs flyfish tc3 tc4 tc5 inc0000, nocon; Iteration 0: log likelihood = -3839.0873 Iteration 1: log likelihood = -3365.9613 Iteration 2: log likelihood = -3315.2401 Iteration 3: log likelihood = -3313.4147 Iteration 4: log likelihood = -3313.4118 Iteration 5: log likelihood = -3313.4118 Poisson regression Number of obs = 1617 Wald chi2(11) = 1733.28 Log likelihood = -3313.4118 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ visits | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- s3 | 4.580847 .1403289 32.64 0.000 4.305808 4.855887 s4 | 1.632003 .1879302 8.68 0.000 1.263666 2.000339 s5 | 2.727472 .1680099 16.23 0.000 2.398178 3.056765 gender | -.6560347 .1082671 -6.06 0.000 -.8682343 -.443835 age | -.0285686 .003059 -9.34 0.000 -.0345643 -.022573 fishyrs | .0078577 .0029256 2.69 0.007 .0021236 .0135918 flyfish | .4777333 .0570868 8.37 0.000 .3658452 .5896214 tc3 | -.0870648 .0038452 -22.64 0.000 -.0946012 -.0795283 tc4 | -.0131424 .002212 -5.94 0.000 -.017478 -.0088069 tc5 | -.0274122 .0023234 -11.80 0.000 -.0319659 -.0228584 inc0000 | -.0308953 .0056156 -5.50 0.000 -.0419016 -.0198889 ------------------------------------------------------------------------------ . /* note: "nocon" means "run the model without a general constant term (intercept); since we alread > y have site-specific intercepts, this would cause a "dummy-trap" error */ > > /* Step 3a: for each site, predict trips at current situation (status quo), and examine the distri > bution of predictions */ > /* note: because we need to use different coefficients for S and tc for each site, we can't just u > se "predict" anymore... */ > > gen lhat3 = exp(_b[s3]*s3+ _b[gender]*gender +_b[age]*age + _b[fishyrs]*fishyrs + _b[flyfish]*flyf > ish + _b[inc0000]*inc0000 + _b[tc3]*tc3); . /* note: this created lhat3 for all observations, but only those for site=3 are meaningful & will > be used below */ > gen lhat4 = exp(_b[s4]*s4+ _b[gender]*gender +_b[age]*age + _b[fishyrs]*fishyrs + _b[flyfish]*flyf > ish + _b[inc0000]*inc0000 + _b[tc4]*tc4); . /* same for site=4*/ > gen lhat5 = exp(_b[s5]*s5+ _b[gender]*gender +_b[age]*age + _b[fishyrs]*fishyrs + _b[flyfish]*flyf > ish + _b[inc0000]*inc0000 + _b[tc5]*tc5); . /*same for site=5*/ > > sum lhat3 if site==3; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- lhat3 | 539 1.187384 2.205861 1.76e-15 33.45128 . /* so now we're only considering site3-stuff */ > sum lhat4 if site==4; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- lhat4 | 539 .6141002 .4088812 .0042081 2.635601 . /* same for site 4 */ > sum lhat5 if site==5; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- lhat5 | 539 .8979592 .7908713 .0000411 5.42801 . /* same for site 5 */ > > /*STEP 3b: summarize trips for entire system*/ > gen lhat =.; (1617 missing values generated) . /*first, generate just missing values */ > replace lhat=lhat3 if site==3; (539 real changes made) . /* then replace them with site-specific lhat values*/ > replace lhat=lhat4 if site==4; (539 real changes made) . replace lhat=lhat5 if site==5; (539 real changes made) . sum lhat; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- lhat | 1617 .8998145 1.39235 1.76e-15 33.45128 . /*STEP 4a: derive & summarize seasonal welfare at status quo for each site*/ > /* note: focus on CS since income effect is negative, which complicates use of CV, EV */ > gen cs3 =-(1/_b[tc3])*lhat3; . /* this creates cs3 for all observations, but only those corresponding for site 3 are meaningful > & will be used below */ > gen cs4 =-(1/_b[tc4])*lhat4; . /* same for site 4*/ > gen cs5 =-(1/_b[tc5])*lhat5; . /* same for site 5*/ > > sum cs3 if site==3; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cs3 | 539 13.63794 25.33586 2.03e-14 384.2114 . /* so now we're only considering site3-stuff */ > sum cs4 if site==4; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cs4 | 539 46.72655 31.11155 .3201909 200.5415 . /* same for site 4 */ > sum cs5 if site==5; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cs5 | 539 32.75768 28.8511 .0014998 198.0146 . /* same for site 5 */ > > /*STEP 4b: derive & summarize seasonal welfare for entire system*/ > gen cs =.; (1617 missing values generated) . /*first, generate just missing values */ > replace cs=cs3 if site==3; (539 real changes made) . /* then replace them with site-specific cs values*/ > replace cs=cs4 if site==4; (539 real changes made) . replace cs=cs5 if site==5; (539 real changes made) . sum cs; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cs | 1617 31.04072 31.57736 2.03e-14 384.2114 . /* ************************************************************************** */ > /* Assume the policy scenario is "implement access fees of $5 at all 3 sites" */ > /* ************************************************************************* */ > > /*STEP 5a: Create new travel cost variables and predict visits under these fees*/ > gen tc3_new = tc3+5; . /* add $5 to everybody's travel cost for each site*/ > gen tc4_new = tc4+5; . gen tc5_new = tc5+5; . gen lhat3_new = exp(_b[s3]*s3+ _b[gender]*gender +_b[age]*age + _b[fishyrs]*fishyrs + _b[flyfish]* > flyfish + _b[inc0000]*inc0000 + _b[tc3]*tc3_new); . gen lhat4_new = exp(_b[s4]*s4+ _b[gender]*gender +_b[age]*age + _b[fishyrs]*fishyrs + _b[flyfish]* > flyfish + _b[inc0000]*inc0000 + _b[tc4]*tc4_new); . gen lhat5_new = exp(_b[s5]*s5+ _b[gender]*gender +_b[age]*age + _b[fishyrs]*fishyrs + _b[flyfish]* > flyfish + _b[inc0000]*inc0000 + _b[tc5]*tc5_new); . sum lhat3_new if site==3; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- lhat3_new | 539 .7683029 1.427313 1.14e-15 21.64482 . /* so now we're only considering site3-stuff */ > sum lhat4_new if site==4; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- lhat4_new | 539 .5750437 .3828766 .0039405 2.467978 . /* same for site 4 */ > sum lhat5_new if site==5; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- lhat5_new | 539 .782946 .6895743 .0000358 4.732774 . /* same for site 5 */ > > /*STEP 5b: summarize trips for entire system under new fees*/ > gen lhat_new =.; (1617 missing values generated) . /*first, generate just missing values */ > replace lhat_new=lhat3_new if site==3; (539 real changes made) . /* then replace them with site-specific lhat values*/ > replace lhat_new=lhat4_new if site==4; (539 real changes made) . replace lhat_new=lhat5_new if site==5; (539 real changes made) . sum lhat_new; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- lhat_new | 1617 .7087642 .9456894 1.14e-15 21.64482 . /* STEP 6a: Compute the per-person welfare loss under the new fee for each site*/ > gen cs3_new =-(1/_b[tc3])*(lhat3-lhat3_new); . gen cs4_new =-(1/_b[tc4])*(lhat4-lhat4_new); . /* same for site 4*/ > gen cs5_new =-(1/_b[tc5])*(lhat5-lhat5_new); . /* same for site 5*/ > > sum cs3_new if site==3; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cs3_new | 539 4.813442 8.942166 7.15e-15 135.6055 . sum cs4_new if site==4; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cs4_new | 539 2.97179 1.978683 .020364 12.75435 . sum cs5_new if site==5; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cs5_new | 539 4.195697 3.695331 .0001921 25.36228 . /*STEP 6b: derive & summarize seasonal welfare for entire system under the new fees*/ > gen cs_new =.; (1617 missing values generated) . /*first, generate just missing values */ > replace cs_new = cs3_new if site==3; (539 real changes made) . /* then replace them with site-specific cs values*/ > replace cs_new=cs4_new if site==4; (539 real changes made) . replace cs_new=cs5_new if site==5; (539 real changes made) . sum cs_new; Variable | Obs Mean Std. Dev. Min Max -------------+-------------------------------------------------------- cs_new | 1617 3.993643 5.749505 7.15e-15 135.6055 . log close; log: c:\klaus\apec64\spring_07\stata\logs\tc_multiple.log log type: text closed on: 16 Feb 2007, 12:37:17 ----------------------------------------------------------------------------------------------------