Replication package 122 · dataverse · 2022
· open the deposit
How the code gets from data to results
Replication Data for: Decision Weights for Experimental Asset Prices Based on Visual Salience
Code for: Decision Weights for Experimental Asset Prices Based on Visual Salience Review of Financial Studies 2022
2
scripts
3
input files
0
file hand-offs
2
merges
6
sample steps
26
estimations
1 · Data in — files the code reads and no script of the package writes
Other input files
3 files
$data_dir\study2.dtaStatastudy2.do:24
study2.do, line 24 use "$data_dir\study2.dta", clear${path}\fulldataset_study1.dtaStatastudy1.do:21
study1.do, line 21 use "${path}\fulldataset_study1.dta", clear${path}\weights.csvCSVstudy1.do:87
study1.do, line 87 import delimited using "${path}\weights.csv", clear case(lower) delimiters(",") varnames(1)
2 · The file pipeline — which script writes which file that a later script reads
2 scripts, in the order the README lists them (README.txt);
0 hand-offs through 0 intermediate files.
-
1.
study1.donamed in README.txt reads 2 input files · 2 merges · 21 estimations -
2.
study2.donamed in README.txt reads 1 input file · 5 estimations
3 · Merges — 2 joins, 2 followed by a check of the merge result
| Joins | How | On keys | Check that follows | Where |
|---|---|---|---|---|
fulldataset_study1_update ← linear_combinations |
merge m:1 | id |
drop if _merge == 2 |
study1.do:146study1.do, line 146
merge m:1 id using "${path}\linear_combinations.dta", update |
fulldataset_study1_update ← gamma_predictions |
merge m:1 | id |
drop if _merge == 2 |
study1.do:259study1.do, line 259
merge m:1 id using "${path}\gamma_predictions.dta", update |
4 · The sample — 6 keep/drop steps, 0 variables winsorized or trimmed
Filters, by kind
time period ×2
- drop if
time == 1study1.do:106
study1.do, line 106 drop if time == 1 //first price does not have any weight - drop if
time == 1study1.do:233
study1.do, line 233 drop if time == 1 //first price does not have any weight
value ranges ×1
- drop if
gamma > 100study1.do:328
study1.do, line 328 drop if gamma > 100
row position (_n, first / last row) ×1
- drop if
gamma > 100study1.do:300
study1.do, line 300 drop if gamma > 100
drops after a merge (_merge) ×2
- drop if
_merge == 2study1.do:147
study1.do, line 147 drop if _merge == 2 - drop if
_merge == 2study1.do:260
study1.do, line 260 drop if _merge == 2
Outliers
No winsorizing or trimming recorded.
5 · Key variables — what enters the models, and where the code builds it
| Variable | Used in models as | Built by |
|---|---|---|
inv |
outcome in 16 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
inv_std |
outcome in 5 | inv_std = std(inv) (egen std) study2.do:31study2.do, line 31
egen inv_std = std(inv) if t >=15 inv_std = round(inv_std,0.01) (replace) study2.do:86study2.do, line 86
replace inv_std = round(inv_std,0.01) if inv_std <= `ll'+0.01 inv_std = round(inv_std,0.01) (replace) study2.do:87study2.do, line 87
replace inv_std = round(inv_std,0.01) if inv_std >= `ul'-0.01 |
corr_VS |
outcome in 1, regressor in 6 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
corr_CPT |
outcome in 1, regressor in 4 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
corr_ST |
outcome in 1, regressor in 4 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
return |
outcome in 1, regressor in 3 | return = mu_up (gen) study2.do:55study2.do, line 55
gen return = mu_up if up == 1 return = mu_down (replace) study2.do:56study2.do, line 56
replace return = mu_down if up == 0 |
risky |
outcome in 1, regressor in 3 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
return_avg |
regressor in 11 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
sd |
regressor in 11 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
skew |
regressor in 11 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
path |
regressor in 8 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
mu_avg_std |
regressor in 5 | mu_avg_std = mu_std / t (gen) study2.do:41study2.do, line 41
gen mu_avg_std = mu_std / t |
vs_std |
regressor in 5 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
cpt_value_n |
regressor in 4 | cpt_value_n = . (gen) study2.do:59study2.do, line 59
gen cpt_value_n = . cpt_value_n = cpt_value_`i' (replace) study2.do:64study2.do, line 64
replace cpt_value_n = cpt_value_`i' if t == `i' |
exp |
regressor in 3 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
convexity |
regressor in 2 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
cpt_std |
regressor in 2 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
return_decile |
regressor in 2 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
st_std |
regressor in 2 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
value_VS |
regressor in 2 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
value_CPT |
regressor in 1 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
value_ST |
regressor in 1 | no statement builds it — a column of an input file, or made by a reshape/merge we do not trace |
6 · Models, by the table or figure they feed — 26 estimations, 0 traced into 0 exhibits
Estimations not traced to a table or figure · 26
| Command | Outcome | Regressors | Fixed effects | Standard errors | Where |
|---|---|---|---|---|---|
xtregpanel fe |
inv |
corr_VS
|
user_id | cluster: user_id | study1.do:37study1.do, line 37
xtreg inv corr_VS, robust cluster(user_id) fe //Naked model |
xtregpanel fe |
inv |
corr_VS return_avg sd skew path*
|
user_id | cluster: user_id | study1.do:39study1.do, line 39
xtreg inv corr_VS return_avg sd skew path*, robust cluster(user_id) fe //All statistical features as controls |
xtregpanel fe |
inv |
corr_VS return_avg sd skew path* corr_CPT corr_ST
|
user_id | cluster: user_id | study1.do:41study1.do, line 41
xtreg inv corr_VS return_avg sd skew path* corr_CPT corr_ST, robust cluster(user_id) fe //All statistical features plus CPT and ST as controls |
xttobittobit |
inv |
corr_VS return_avg sd skew path* corr_CPT corr_ST
|
— | default | study1.do:46study1.do, line 46
xttobit inv corr_VS return_avg sd skew path* corr_CPT corr_ST, ll(`ll') ul(`ul') //Tobit instead of OLS
as we read it (macros filled in / loop expanded):
xttobit inv corr_VS return_avg sd skew path* corr_CPT corr_ST, ll(round(r(min),0.000001)) ul(round(r(max),0.000001)) |
xtregpanel fe |
inv |
value_VS return_avg sd skew path* value_CPT value_ST
|
user_id | cluster: user_id | study1.do:48study1.do, line 48
xtreg inv value_VS return_avg sd skew path* value_CPT value_ST, robust cluster(user_id) fe //Value function instead of correlations |
xtregpanel fe |
inv |
corr_VS return risky
|
user_id | cluster: user_id | study1.do:58study1.do, line 58
xtreg inv corr_VS return risky, robust cluster(user_id) fe |
xtregpanel fe |
inv |
corr_VS return risky return_avg sd skew path* corr_CPT corr_ST
|
user_id | cluster: user_id | study1.do:60study1.do, line 60
xtreg inv corr_VS return risky return_avg sd skew path* corr_CPT corr_ST, robust cluster(user_id) fe //All statistical features plus CPT and ST as controls |
xtregpanel fe |
inv |
value_VS return risky return_avg sd skew path* corr_CPT corr_ST
|
user_id | cluster: user_id | study1.do:62study1.do, line 62
xtreg inv value_VS return risky return_avg sd skew path* corr_CPT corr_ST, robust cluster(user_id) fe //All statistical features plus CPT and ST as controls |
xtregpanel fe |
corr_VS |
return_avg sd skew
|
user_id | cluster: user_id | study1.do:72study1.do, line 72
xtreg corr_VS return_avg sd skew, robust cluster(user_id) fe //VS, R² 0.28% |
xtregpanel fe |
corr_CPT |
return_avg sd skew
|
user_id | cluster: user_id | study1.do:73study1.do, line 73
xtreg corr_CPT return_avg sd skew, robust cluster(user_id) fe //CPT, R² 87.98% |
xtregpanel fe |
corr_ST |
return_avg sd skew
|
user_id | cluster: user_id | study1.do:74study1.do, line 74
xtreg corr_ST return_avg sd skew, robust cluster(user_id) fe //ST, R² 66.71& |
xtregpanel fe |
inv |
vscptweights_`i'-1_c
|
user_id | cluster: user_id | study1.do:178study1.do, line 178
qui xtreg inv vscptweights_`j'_c, robust cluster(user_id) fe
as we read it (macros filled in / loop expanded):
qui xtreg inv vscptweights_`i'-1_c, robust cluster(user_id) fe |
xtregpanel fe |
inv |
vsstweights_`i'-1_c
|
user_id | cluster: user_id | study1.do:180study1.do, line 180
qui xtreg inv vsstweights_`j'_c, robust cluster(user_id) fe
as we read it (macros filled in / loop expanded):
qui xtreg inv vsstweights_`i'-1_c, robust cluster(user_id) fe |
xtregpanel fe |
inv |
vscptweights_`i'-1_v
|
user_id | cluster: user_id | study1.do:182study1.do, line 182
qui xtreg inv vscptweights_`j'_v, robust cluster(user_id) fe
as we read it (macros filled in / loop expanded):
qui xtreg inv vscptweights_`i'-1_v, robust cluster(user_id) fe |
xtregpanel fe |
inv |
vsstweights_`i'-1_v
|
user_id | cluster: user_id | study1.do:184study1.do, line 184
qui xtreg inv vsstweights_`j'_v, robust cluster(user_id) fe
as we read it (macros filled in / loop expanded):
qui xtreg inv vsstweights_`i'-1_v, robust cluster(user_id) fe |
xtregpanel fe |
inv |
vscptweights_`opt_w_cpt_v'_v
|
user_id | cluster: user_id | study1.do:208study1.do, line 208
xtreg inv vscptweights_`opt_w_cpt_v'_v, robust cluster(user_id) fe |
xtregpanel fe |
inv |
vsstweights_`opt_w_st_v'_v
|
user_id | cluster: user_id | study1.do:209study1.do, line 209
xtreg inv vsstweights_`opt_w_st_v'_v, robust cluster(user_id) fe |
xtregpanel fe |
inv |
vscptweights_`opt_w_cpt_v'_v return_avg sd skew path*
|
user_id | cluster: user_id | study1.do:210study1.do, line 210
xtreg inv vscptweights_`opt_w_cpt_v'_v return_avg sd skew path*, robust cluster(user_id) fe |
xtregpanel fe |
inv |
vsstweights_`opt_w_st_v'_v return_avg sd skew path*
|
user_id | cluster: user_id | study1.do:211study1.do, line 211
xtreg inv vsstweights_`opt_w_st_v'_v return_avg sd skew path*, robust cluster(user_id) fe |
xtregpanel fe |
return |
vs_return_`i' return_decile convexity
|
user_id | cluster: user_id | study1.do:286study1.do, line 286
qui xtreg return vs_return_`i' return_decile convexity, robust cluster(user_id) fe |
xtregpanel fe |
risky |
vs_risk_`i' return_decile convexity
|
user_id | cluster: user_id | study1.do:314study1.do, line 314
qui xtreg risky vs_risk_`i' return_decile convexity, robust cluster(user_id) fe |
xtregpanel fe |
inv_std |
vs_std mu_avg_std
|
user_id | cluster: user_id | study2.do:74study2.do, line 74
xtreg inv_std vs_std mu_avg_std, robust cluster(user_id) fe |
xtregpanel fe |
inv_std |
vs_std cpt_value_n mu_avg_std
|
user_id | cluster: user_id | study2.do:76study2.do, line 76
xtreg inv_std vs_std cpt_value_n mu_avg_std, robust cluster(user_id) fe |
xtregpanel fe |
inv_std |
vs_std exp* mu_avg_std cpt_value_n
|
user_id | cluster: user_id | study2.do:78study2.do, line 78
xtreg inv_std vs_std exp* mu_avg_std cpt_value_n, robust cluster(user_id) fe |
xtregpanel fe |
inv_std |
vs_std cpt_std st_std exp* mu_avg_std cpt_value_n
|
user_id | cluster: user_id | study2.do:80study2.do, line 80
xtreg inv_std vs_std cpt_std st_std exp* mu_avg_std cpt_value_n, robust cluster(user_id) fe |
xttobittobit |
inv_std |
vs_std cpt_std st_std exp* mu_avg_std cpt_value_n
|
— | default | study2.do:88study2.do, line 88
xttobit inv_std vs_std cpt_std st_std exp* mu_avg_std cpt_value_n, ll(`ll') ul(`ul')
as we read it (macros filled in / loop expanded):
xttobit inv_std vs_std cpt_std st_std exp* mu_avg_std cpt_value_n, ll(round(r(min),0.01)) ul(round(r(max),0.01)) |
Tables and figures the code writes:
Table 3 · Table 4 · Table 5 · Figure 3 · Figure 3 · Figure 4 · Figure 4
Table3.tex study1.do:50
study1.do, line 50
esttab A1 A2 A3 A4 A5 using "${path}\Table3.tex", se label starlevels(* 0.1 ** 0.05 *** 0.01) replace r2 sfmt(%9.4f)
Table4.tex study2.do:90
study2.do, line 90
esttab A1 A2 A3 A4 A5 using "$table_dir\Table4.tex", se label starlevels(* 0.1 ** 0.05 *** 0.01) replace r2 sfmt(%9.4f)
Table5.tex study1.do:64
study1.do, line 64
esttab A1 A2 A3 using "${path}\Table5.tex", se label starlevels(* 0.1 ** 0.05 *** 0.01) replace r2 sfmt(%9.4f)
Figure3_left.png study1.do:201
study1.do, line 201
graph export "${path}\Figure3_left.png", width(3000) replace
Figure3_right.png study1.do:204
study1.do, line 204
graph export "${path}\Figure3_right.png", width(3000) replace
Figure4_left.png study1.do:303
study1.do, line 303
graph export "${path}\Figure4_left.png", width(3000) replace
Figure4_right.png study1.do:331
study1.do, line 331
graph export "${path}\Figure4_right.png", width(3000) replace
7 · Figures: how each is drawn — 4 figures in the code (command, layers, options, the file it is saved to)
line 4
| command | layers | variables | options | saved as | where |
|---|---|---|---|---|---|
twowayline
|
line |
y r2_cpt_v
x w
|
xtitle Weight on visual salience (in %) · ytitle R² |
Figure 3Figure3_left.png |
study1.do:200study1.do, line 200
twoway line r2_cpt_v w, xtitle("Weight on visual salience (in %)", size(vlarge)) ytitle("R²", size(vlarge)) xlab(0 (20) 100, labs(vlarge)) ylab(0.07 (0.001) 0.074, labs(vlarge)) |
twowayline
|
line |
y r2_st_v
x w
|
xtitle Weight on visual salience (in %) · ytitle R² |
Figure 3Figure3_right.png |
study1.do:203study1.do, line 203
twoway line r2_st_v w, xtitle("Weight on visual salience (in %)", size(vlarge)) ytitle("R²", size(vlarge)) xlab(0 (20) 100, labs(vlarge)) ylab(0.03 (0.01) 0.08, labs(vlarge)) |
twowayline
|
line |
y r2
x gamma
|
xtitle Gamma · ytitle R² |
Figure 4Figure4_left.png |
study1.do:302study1.do, line 302
twoway line r2 gamma, xtitle("Gamma", size(vlarge)) ytitle("R²", size(vlarge)) xlab(0 (0.2) 1, labs(vlarge)) ylab(0.181 (0.001) 0.184, labs(vlarge)) |
twowayline
|
line |
y r2
x gamma
|
xtitle Gamma · ytitle R² |
Figure 4Figure4_right.png |
study1.do:330study1.do, line 330
twoway line r2 gamma, xtitle("Gamma", size(vlarge)) ytitle("R²", size(vlarge)) xlab(0 (0.2) 1, labs(vlarge)) ylab(0.1776 (0.0003) 0.1786, labs(vlarge)) |