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49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
*** FIGURES FOR Carrera, Royer, Stehr, Sydnor, and Taubinsky (2021) ***********
*******************************************************************************

*** Initial set-up ***
clear
set more off

*** Set directories for data and output ***
cd "$main/Output"
/* Note: all figures will output to the working directory. Uses a program from

   master_do_file_for_analysis.do */


*** (uniform_range.pdf) *******************************************************

set obs 500

*** Generate benefit values ***
gen b = _n/500

*** Generate commitment contract demand regions for each beta ***
forvalues beta = 1(1)500 {
	local B = `beta'/500
	gen bindingcommit`beta' = ( ((2*b-1)/(2*(b^2))) > `B'*(1-.5*`B') )
}

*** Reshape data for graphing ***
reshape long bindingcommit, i(b) j(B)
replace B = B/500

*** Produce Figure 1 ***
twoway contour bindingcommit B b if B >= .75 & B <= .95, levels(2) /*

*/ ccolors(red blue) xlabel(0(.1)1) ylabel(.75(.05).95) /*

*/ xtitle("Benefit (share of time beneficial)") ytitle("Perceived short-run discount factor") /*

*/ graphr(color(white) fcolor(white)) bgcolor(white) plotregion(margin(zero)) clegend(off)

*** Export figure
graph export uniformrange.pdf, replace
* with descriptive text superimposed in the paper


*** Load and clean experimental data ******************************************

*** Load dataset ***
use "$main/Data/cleaned_commitment_study_data", clear

*** Variable Creation & Cleaning Steps ***
*** Create an ID variable for use when reshaping long 
gen id = _n

*** Generate info treatment indicators
gen first_info = type_of_info=="1-onlygraph" 
gen new_info = type_of_info=="2-graphplus" 
gen control_info = (new_info == 0 & first_info == 0) 

*** Generate wave indicators
gen wave1 = (wave == "fall") 
gen wave2 = (wave == "winter")
gen wave3 = (wave == "spring")

*** Define anticommitment/commitment variables for each threshold
gen anticommit8 = q170 ==2 if q170<.
gen commit8 = q169 ==2 if q169<.
gen anticommit12 = chose_anticommit11
gen commit12 = chose_commit12
gen anticommit16 = q296==2 if q296<.
gen commit16 = q295 ==2 if q295<.

*** Restrict sample to those exogenously assigned incentives
keep if flag_low_wtp == 0 & flag_exclude_exog == 0


*** (wtp_ev_tcbench.pdf) ******************************************************

*** Generate additional variables 
*** Expected value of earnings based on subjective "days" estimate for frequency of visits
gen ev1 = days_1
gen ev2 = days_2*2
gen ev3 = days_3*3
gen ev5 = days_5*5
gen ev7 = days_7*7
gen ev12 = days_12*12
	
*** Generate values for the $0 incentive
gen wtp0 = 0
gen ev0 = 0

*** Estimate means with 95% confidence intervals
mat data = J(7, 7, .) // initialize matrix for storing values
loc row = 1
foreach p in 0 1 2 3 5 7 12 {

	* Input incentive in first column
	mat data[`row', 1] = `p'
	
	* Input means & CI bounds of WTP in next three columns
	ci means wtp`p'
	mat data[`row', 2] = r(mean)
	mat data[`row', 3] = r(lb)
	mat data[`row', 4] = r(ub)
	
	* Input means & CI bounds of expected earnings in last three columns
	ci mean ev`p'
	mat data[`row', 5] = r(mean)
	mat data[`row', 6] = r(lb)
	mat data[`row', 7] = r(ub)
	
	loc ++row // increment row
	}

*** Use data stored in matrix
preserve
clear
svmat data
ren (data*) (incentive wtp wtplb wtpub ev evlb evub)

*** Store certain statistics ***
* Average expected earnings under $1 incentive
sum ev if incentive == 1 // EV equals exp. visits under this incentive
loc avgexp : di %4.2f r(mean)
latex_write avgexpincone `avgexp' numbers
* Average WTP for $1 incentive
sum wtp if incentive == 1
loc avgwtp : di %4.2f r(mean)
latex_write avgwtpincone `avgwtp' numbers
* Difference
loc diff : di %4.2f `avgwtp'-`avgexp'
latex_write avgdiffincone `diff' numbers

*** Produce figure ***
graph twoway (connected ev incentive, lc(black) msymbol(none) mc(none) lp(dash)) /*

*/ (rcap evub evlb incentive, lc(black) lw(*.5) msize(*2.25)) /*

*/ (connected wtp incentive, lc(cranberry) mlc(cranberry) mc(none) msymbol(circle) msize(vsmall)) /*

*/ (rcap wtpub wtplb incentive, lc(cranberry) lw(*.5) msize(*2.25)), /*

*/ xtitle("Per-visit incentive ($)", height(6)) ylabel(0(25)225, angle(0)) xlabel(1(1)12) /*

*/ graphr(color(white) fcolor(white)) bgcolor(white) plotregion(margin(zero)) /*

*/ ytitle("$", height(6)) legend(order(1 3) label(1 "Avg. subjective expected earnings") label(3 "Avg. WTP for that incentive") rows(3)) 

*** Export figure
graph export wtp_ev_tcbench.pdf, replace
restore


*** (deltas.pdf) **************************************************************

*** Generate additional variables ***
preserve
*** Better measures of Commitment as per proposition
/*** These are the amounts, per attendance, by which a person "overpays" for 

the increase in incentive. Second-order approximation */
gen delta1=(wtp1) - (days_1+days_0)/2
gen delta2 = (wtp2-wtp1) - (days_2+days_1)/2
gen delta3=(wtp3-wtp2) - (days_3+days_2)/2
gen delta5=(wtp5-wtp3)/(5-3) - (days_5+days_3)/2
gen delta7=(wtp7-wtp5)/(7-5) - (days_7+days_5)/2
gen delta12=(wtp12-wtp7)/(12-7) - (days_12+days_7)/2

gen avg_delta = (delta1 + delta2+delta3 + delta5 + delta7 + delta12)/6
gen avg_delta_ex1 = (delta2+delta3 + delta5 + delta7 + delta12)/5

// DELTA MEASURES DIFFERENCES FROM TC BENCHMARK
*** Run the regressions and store results with model names
quietly reg avg_delta, robust
est store m1
loc avgbcp = _b[_cons]
loc avg : di %4.2f `avgbcp'
latex_write avgbcp `avg' numbers

quietly reg avg_delta_ex1, robust
est store m2
loc avgbcpex1 = _b[_cons]
loc avg : di %4.2f `avgbcpex1'
latex_write avgbcpexone `avg' numbers

*** Produce figure: average delta with CI's for the info-control group ***
coefplot (m1, aseq(Average across incentives))/*

*/ (m2, aseq(Average excluding $1 incentive)) /*

*/, xline(0) xlabel(-1(.5)2.5) legend(off) mc(black) offset(0) ciopts(lc(black) /*

*/ recast(rcap) lp(dash)) grid(none) aseq swap graphr(fcolor(white) color(white)) /*

*/ xtitle("Behavior change premium ($)", height(6)) plotregion(margin(zero))

*** Export figure
graph export deltas.pdf, replace
restore


*** (overconfidence.pdf) **********************************************

*** Obtain coefficients for plot ***
* Generate placeholder
forval k = 0/12 {
	gen var`k' = .
	label variable var`k' `k'
	}

* Generate estimates
forval k = 0(1)12 {
	
	replace var`k' = 10
	reg var`k' var`k', nocons
	eststo m_v_`k'

	if `k' != 4 & `k' != 6 & `k' != 8 & `k' != 9 & `k' != 10 & `k' != 11{
		replace var`k' = (flag_exclude_exog==0&flag_low_wtp==0)
		reg days_`k' var`k', robust nocons
		est store m_days`k'_all
		}

	if `k' != 1 & `k' != 3 & `k' != 12 & `k' != 4 & `k' != 6 & `k' != 8 & `k' != 9 & `k' != 10 & `k' != 11{
		replace var`k' = (incentive == `k' &flag_exclude_exog==0 ///
				&flag_low_wtp==0)
		reg visits var`k' if incentive == `k', robust nocons
		est store m_visits`k'_given

		* Store number of observations
		if `k' == 0 loc num "zero"
		else if `k' == 2 loc num "two"
		else if `k' == 5 loc num "five"
		else loc num "seven"
		latex_write incentive`num'obs `e(N)' numbers
		}
}

*** Produce figure: Overconfidence ***
*** Beliefs vs reality
coefplot (m_v_*, offset(0) m(none) lp(none)) /*

*/ (m_days0_all m_days1_all m_days2_all m_days3_all m_days5_all m_days7_all m_days12_all, offset(0) recast(connected) msize(small) mc(black) lp(dash) lc(black) ciopts(lc(black) recast(rcap) lp(solid)) )/*

*/ (m_visits0_given m_visits2_given m_visits5_given m_visits7_given, offset(0) recast(connected) msize(small) m(square) mc(red) lc(red) ciopts(lc(red) recast(rcap) lp(dash)) ) /*

*/, vertical plotregion(margin(zero)) xlabel(1 "0" 2 "1" 3 "2" 4 "3" 5 "4" 6 "5" 7 "6" 8 "7" 9 "8" 10 "9" 11 "10" 12 "11" 13 "12") /*

*/ graphr(color(white) fcolor(white)) bgcolor(white) xtitle("Per-visit incentive ($)", height(6)) ytitle("Visits", height(6))/*

*/ ylabel(0(5)22, angle(0)) legend(order(4 6) label(4 "Average expected visits") label(6 "Average realized visits"))  legend(rows(2))

*** Export figure
graph export overconfidence.pdf, replace


*** (overconfidence_treatment.pdf) ********************************************

*** Obtain coefficients for plots ***
foreach cdtn in "wave1 == 1" "(wave2 == 1 | wave3 == 1)"{

	if "`cdtn'" == "wave1 == 1"{
		loc treat "first_info"
		loc name "1"
		loc tlab "basic"
		loc excl "5"
		loc result5_c ""
		loc result5_t ""
		}
	else{
		loc treat "new_info"
		loc name "23"
		loc tlab "enhanced"
		loc excl "100" 
		loc result5_c "m_visits5_given_c"
		loc result5_t "m_visits5_given_t"
		}

	* Generate estimates
	forval k = 0(1)12 {
		
		replace var`k' = 10
		reg var`k' var`k', nocons
		eststo m_v_`k'

		* Information treatment
		if `k' != 4 & `k' != 6 & `k' != 8 & `k' != 9 & `k' != 10 & `k' != 11{
			replace var`k' = (flag_exclude_exog==0&flag_low_wtp==0& ///
				`cdtn'&`treat'==1)
			reg days_`k' var`k' if `cdtn'&`treat'==1, robust nocons
			est store m_days`k'_all_t
			}

		if `k' != 1 & `k' != 3 & `k' != 4 & `k' != 6 & `k' != 8 & `k' != 9 & `k' != 10 & `k' != 11 & `k' != 12 & `k' != `excl'{
			replace var`k' = (incentive == `k' &flag_exclude_exog==0 ///
					&flag_low_wtp==0&`cdtn'&`treat'==1)
			reg visits var`k' if incentive == `k' & `cdtn'&`treat'==1, ///
				robust nocons
			est store m_visits`k'_given_t
			
			* Store number of observations
			loc treatobs = e(N)
			
			}
			
		* Information control
		if `k' != 4 & `k' != 6 & `k' != 8 & `k' != 9 & `k' != 10 & `k' != 11{
			replace var`k' = (flag_exclude_exog==0&flag_low_wtp==0& ///
				`cdtn'&`treat'!=1)
			reg days_`k' var`k' if `cdtn'&`treat'!=1, robust nocons
			est store m_days`k'_all_c
			}

		if `k' != 1 & `k' != 3 & `k' != 4 & `k' != 6 & `k' != 8 & `k' != 9 & `k' != 10 & `k' != 11 & `k' != 12 & `k' != `excl'{
			replace var`k' = (incentive == `k' &flag_exclude_exog==0 ///
					&flag_low_wtp==0&`cdtn'&`treat'!=1)
			reg visits var`k' if incentive == `k' & `cdtn'&`treat'!=1, ///
				robust nocons
			est store m_visits`k'_given_c
			
			* Store number of observations
			if `k' == 0 loc num "zero"
			else if `k' == 2 loc num "two"
			else if `k' == 5 loc num "five"
			else loc num "seven"
			loc bothobs = e(N) + `treatobs'
			latex_write incentive`num'obs`tlab' `bothobs' numbers
			
			}
			
		}
		
	* Store total observations used
	sum var0 if `cdtn'&`treat'==1
	latex_write obs`tlab'treat `r(N)' numbers
	sum var0 if `cdtn'&`treat'!=1
	latex_write obs`tlab'control `r(N)' numbers
		
	*** Produce figure: Overconfidence ***
	local jig = .1
	*** Beliefs vs reality
	coefplot (m_v_*, offset(0) m(none) lp(none)) /*

	*/ (m_days0_all_c m_days1_all_c m_days2_all_c m_days3_all_c m_days5_all_c m_days7_all_c m_days12_all_c, offset(-`jig') recast(connected) msize(small) mc(black) lp(dash) lc(black) ciopts(lc(black) recast(rcap) lp(solid)) )/*

	*/ (m_visits0_given_c m_visits2_given_c `result5_c' m_visits7_given_c, offset(-`jig') recast(connected) msize(small) m(square) mc(black) lc(black) lp(solid) ciopts(lc(black) recast(rcap) lp(dash)) ) /*

	*/ (m_days0_all_t m_days1_all_t m_days2_all_t m_days3_all_t m_days5_all_t m_days7_all_t m_days12_all_t, offset(`jig') recast(connected) m(Oh) msize(small) mc(blue) lp(dash) lc(blue) ciopts(lc(blue) recast(rcap) lp(solid)) )/*

	*/ (m_visits0_given_t m_visits2_given_t `result5_t' m_visits7_given_t, offset(`jig') recast(connected) msize(small) m(Sh) mc(blue) lc(blue) lp(solid) ciopts(lc(blue) recast(rcap) lp(dash)) ) /*

	*/, vertical plotregion(margin(zero)) xlabel(1 "0" 2 "1" 3 "2" 4 "3" 5 "4" 6 "5" 7 "6" 8 "7" 9 "8" 10 "9" 11 "10" 12 "11" 13 "12") /*

	*/ graphr(color(white) fcolor(white)) bgcolor(white) xtitle("Per-visit incentive ($)", height(6)) ytitle("Visits", height(6))/*

	*/ ylabel(0(5)22, angle(0)) legend(order(4 6 8 10) label(4 "Average expected visits, information control") label(6 "Average realized visits, information control") label(8 "Average expected visits, `tlab' information treatment") label(10 "Average realized visits, `tlab' information treatment"))  legend(rows(4))

	*** Export figure
	graph export overconfidence_treatment_wave`name'.pdf, replace
	eststo clear
			
	}


*** (exp_actual_under_incentive.pdf) ******************************************

*** Expected attendance w/incentive given vs. actual attendance w/incentive
* Generate variable for expected attendace w/incentive given
gen days_exp = .
foreach i in 0 1 2 3 5 7{
	replace days_exp = days_`i' if incentive == `i'
	}	

* Plot with 45-degree line
preserve
binscatter visits days_exp, ///
	ytitle(Actual attendance, height(6)) ///
	xtitle(Expected attendance under assigned incentive, height(6)) ///
	xlab(0(5)30) ylab(0(5)30, angle(0)) plotregion(margin(zero)) ///
	graphregion(color(white)) savedata(binned) replace
clear
do binned
graph addplot function y = x, range(0 30) lpattern(dash) lcolor(gs13) ///
	xlab(0(5)30) ylab(0(5)30, angle(0)) plotregion(margin(zero))
graph export "exp_actual_under_incentive.pdf", replace
restore

* Remove temporary files
cap erase "binned.csv"
cap erase "binned.do" 
	

*** (wtp_exp_attendance.pdf) **************************************************

preserve
* Reshape to graph each incentive level separately
reshape long wtp days_, i(id) j(incentive_level)

* Store average increase in attendance per dollar of incentive
reg days_ incentive_level, clus(id)
loc incr = _b[incentive_level]
loc avg : di %4.2f `incr'
latex_write incrattinc `avg' numbers
loc stderr : di %4.3f _se[incentive_level]
latex_write incrattincse `stderr' numbers

* Store behavior change premium per dollar of incentive
loc bcpinc : di %4.2f `avgbcp'/`incr'
latex_write avgbcpinc `bcpinc' numbers
loc bcpincex1 : di %4.2f `avgbcpex1'/`incr'
latex_write avgbcpexoneinc `bcpincex1' numbers

* Produce plot
binscatter wtp days_ if incentive_level != 0, by(incentive_level) ///
	ytitle(WTP for incentive ($), height(6)) ///
	xtitle(Expected attendance, height(6)) ///
	xlab(0(5)30) ylab(0(50)300, angle(0)) ///
	legend(order(1 "1" 2 "2" 3 "3" 4 "5" 5 "7" 6 "12") subtitle(Per-visit incentive ($), size(medsmall)) rows(1)) ///
	graphregion(color(white)) plotregion(margin(zero))
	graph export "wtp_exp_attendance.pdf", replace
	
restore


*** Load and clean daily experimental data ************************************

*** Load dataset ***
use "$main/Data/cleaned_commitment_study_daily_data", clear

*** Variable Creation & Cleaning Steps ***
*** Generate info treatment indicators
gen first_info = type_of_info=="1-onlygraph" 
gen new_info = type_of_info=="2-graphplus" 
gen control_info = (new_info == 0 & first_info == 0) 

*** Generate wave indicators
gen wave1 = (wave == "fall") 
gen wave2 = (wave == "winter")
gen wave3 = (wave == "spring")

*** Define anticommitment/commitment variables for each threshold
gen anticommit8 = q170 ==2 if q170<.
gen commit8 = q169 ==2 if q169<.
gen anticommit12 = chose_anticommit11
gen commit12 = chose_commit12
gen anticommit16 = q296==2 if q296<.
gen commit16 = q295 ==2 if q295<.

*** Restrict sample to those exogenously assigned incentives
keep if flag_low_wtp == 0 & flag_exclude_exog == 0	


*** (daily_att_likelihood.pdf) ************************************************
		
preserve

* Generate variables and restrict data
keep if commit12 == 1
gen got_incentive = 1 if treatment == "threshold80_12"
replace got_incentive = 0 if treatment == "control"
keep if !missing(got_incentive)
gen incentive_day = day*got_incentive

* For trendline of increase in likelihood of attendance
reg attended day got_incentive incentive_day wave2 wave3, clus(id)
loc slope = _b[incentive_day]
loc intercept = _b[got_incentive]

* Average increase in likelihood of attendance from the contract each day
reg attended ibn.day ibn.day#c.got_incentive, clus(id) nocons

* Produce plot
coefplot, nolabel vertical keep(*#c.got_incentive) yline(0) omitted baselevels ///
	ciopts(recast(rcap) lp(dash) lw(thin)) xlab(0(2)28) xtitle("Day", height(6)) ///
	ylab(-.2(.1).5, angle(0)) ytitle("Change in likelihood of going to the gym", height(4)) ///
	graphregion(color(white)) bgcolor(white) plotregion(margin(zero))
graph addplot function y = `slope'*x + `intercept', range(1 28) ///
	lw(medthick) lp(longdash) lcolor(ebblue*.7) ///
	xlab(0(2)28) ylab(-.2(.1).5, angle(0)) plotregion(margin(zero))
	graph export "daily_att_likelihood.pdf", replace	

restore