-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment.do
69 lines (51 loc) · 2.54 KB
/
payment.do
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
clear
set more off
import delimited "/home/eugenio/Dropbox/Inequality_Abhijit/Data/eugenio/all_apps_wide-2021-04-30.csv", varnames(1)
rename public_goods10playertotal_earnin total_earning
rename instructions1playerbelief_poor belief_poor1
rename instructions1playerbelief_rich belief_rich1
rename public_goods10playerbelief_poor belief_poor2
rename public_goods10playerbelief_rich belief_rich2
rename public_goods1groupendowment endowment
rename public_goods*playercontribution contribution*
egen total_contribution = rowtotal(contribution*)
gen average_contribution = total_contribution/10
rename instructions1playerprolific_id prolific_id
rename *1p*no_group no_group
drop if endowment==.
gen random1 = runiform(0,1)
gen random2 = runiform(0,1)
bys endowment: egen mean_contr = mean(average_contribution)
gen mean_contr_rich = mean_contr if endowment==80
sort mean_contr_rich
replace mean_contr_rich = mean_contr_rich[_n-1] if mean_contr_rich==.
gen mean_contr_poor = mean_contr if endowment==20
sort mean_contr_poor
replace mean_contr_poor = mean_contr_poor[_n-1] if mean_contr_poor==.
gen diff_belief_rich1 = abs(belief_rich1 - mean_contr_rich)
gen diff_belief_poor1 = abs(belief_poor1 - mean_contr_poor)
gen diff_belief_rich2 = abs(belief_rich2 - mean_contr_rich)
gen diff_belief_poor2 = abs(belief_poor2 - mean_contr_poor)
** T5
/*gen tokens_belief1 = 0*/
/*replace tokens_belief1 = 50 if random1>0.5&abs(belief_rich1 - mean_contr_rich)<1*/
/*replace tokens_belief1 = 50 if random1<=0.5&abs(belief_poor1 - mean_contr_poor)<1*/
/*gen tokens_belief2 = 0*/
/*replace tokens_belief2 = 50 if random2>0.5&abs(belief_rich2 - mean_contr_rich)<1*/
/*replace tokens_belief2 = 50 if random2<=0.5&abs(belief_poor2 - mean_contr_poor)<1*/
** T2
/*gen tokens_belief1 = 0*/
/*replace tokens_belief1 = 50 if abs(belief_rich1 - mean_contr_rich)<1*/
/*gen tokens_belief2 = 0*/
/*replace tokens_belief2 = 50 if abs(belief_rich2 - mean_contr_rich)<1*/
** T1
gen tokens_belief1 = 0
replace tokens_belief1 = 50 if abs(belief_poor1 - mean_contr_poor)<1
gen tokens_belief2 = 0
replace tokens_belief2 = 50 if abs(belief_poor2 - mean_contr_poor)<1
gen final_earning = total_earning + tokens_belief2 + tokens_belief1
gen final_earning_money = final_earning/400
tostring final_earning_money, force format(%7.2f) gen(money)
replace money = prolific_id + "," + money
export delimited money using "/home/eugenio/Dropbox/Inequality_Abhijit/Data/RawData/payments/payment_ineq_session5.csv", replace
import delimited using "/home/eugenio/Dropbox/Inequality_Abhijit/Data/RawData/payments/payment_ineq_session3.csv"