File size: 28,332 Bytes
3209e11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/jonasradbruch/Dropbox/PhD/channels_defaults/Interventions and Cognitive Spillovers/Final_Documents/ReplicationPackage/EmpiricalAnalysis/out/Randomization_Check.lo
> g
  log type:  text
 opened on:   4 Nov 2021, 09:55:52

. 
. 
. use "${PATH_IN_DATA}/formatted_data_replication.dta", clear

. keep if round==1
(16,948 observations deleted)

. 
. 
. set scheme s1color_black_gray

. 
. **********************************
. * Little program to convert matrix
. **********************************
. 
. cap program drop convert

. program define convert, eclass
  1.     matrix list `1'
  2.     ereturn  scalar N=.
  3.     ereturn matrix mean `1'
  4.     ereturn local estimates_title="p-values"
  5. end

. 
. 
. 
. * Generate variables specifallcy needed for balancing table
. 
. egen ability_load_std_1=std(ability_load) if original_lab==1
(329 missing values generated)

. egen ability_task_std_1=std(ability_task) if original_lab==1
(329 missing values generated)

. 
. egen ability_load_std=std(ability_load) if original_lab==0
(563 missing values generated)

. egen ability_task_std=std(ability_task) if original_lab==0
(563 missing values generated)

. 
. replace ability_load_std=ability_load_std_1 if original_lab==1
(563 real changes made)

. replace ability_task_std=ability_task_std_1 if original_lab==1
(563 real changes made)

. drop ability_load_std_1 ability_task_std_1

. 
. label var ability_task_std "Ability Decision Task (std.)"

. label var ability_load_std "Ability Background Task (std.)"

. 
. bysort Treatment_Environment Treatment_Incentives: gen obs=_N

. label var obs "N"

. 
. 
. cap drop treatment_id

. egen treatment_id=group(Treatment_Environment Treatment_Incentives )

. 
. 
. 
. * Write Balancing table; Different parts are appended after creating results via tabstat
. 
. qui file open table_out using `"${PATH_OUT}/tableO_1.tex"', write replace

. file write table_out "   \begin{tabular}{l*{13}{c}}" _n

. file write table_out "\toprule" _n

. file close table_out

. 
. estimates clear

. 
. bysort Treatment_Environment: eststo: estpost tabstat ability_load_std ability_task_std  q_age q_gender economist perc_multitasking_2 perc_multitasking_1, by(Treatment_Incentives) 
> nototal   statistics(mean sd) columns(statistics) listwise

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Baseline}

Summary statistics: mean sd
     for variables: ability_load_std ability_task_std q_age q_gender economist perc_multitasking_2 perc_multitasking_1
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
ability_l~td | -.0829961   1.051323 
ability_ta~d | -.0271519   1.126178 
       q_age |  23.75524   5.527418 
    q_gender |  .5804196   .4952249 
   economist |  .1258741   .3328734 
perc_multi~2 |  54.97203    18.9729 
perc_multi~1 |   3.06993   .7750543 
-------------+----------------------
20           |                      
ability_l~td |  .1080402   .8993562 
ability_ta~d |  .0730191   1.024882 
       q_age |  23.74419   4.440576 
    q_gender |  .5116279   .5057805 
   economist |  .1162791    .324353 
perc_multi~2 |  50.44186   19.22462 
perc_multi~1 |   3.27907   .7661152 
-------------+----------------------
40           |                      
ability_l~td |  .0771499   1.191024 
ability_ta~d |  .2113969   .7026106 
       q_age |  22.77778   3.622731 
    q_gender |  .6111111   .5016313 
   economist |  .1666667   .3834825 
perc_multi~2 |  51.94444   20.39744 
perc_multi~1 |       3.5   1.043185 
-------------+----------------------
Ample        |                      
ability_l~td |  .1600329   .8664755 
ability_ta~d |  .0808109   1.015158 
       q_age |  23.12766    4.29612 
    q_gender |  .5851064   .4953455 
   economist |  .1808511   .3869585 
perc_multi~2 |  58.59574    18.3949 
perc_multi~1 |  2.776596   .7641744 
(est1 stored)

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Directed Attention}

Summary statistics: mean sd
     for variables: ability_load_std ability_task_std q_age q_gender economist perc_multitasking_2 perc_multitasking_1
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
ability_l~td |  .0077178   1.034096 
ability_ta~d | -.1013208   .9314255 
       q_age |   24.3931   5.080322 
    q_gender |  .5448276   .4997126 
   economist |  .1586207   .3665883 
perc_multi~2 |  51.30345   20.69095 
perc_multi~1 |  3.234483   .8417392 
-------------+----------------------
20           |                      
ability_l~td | -.0953546   .8044514 
ability_ta~d |  .0859819    .958236 
       q_age |  23.14286   3.764866 
    q_gender |  .5952381   .4967958 
   economist |  .1428571   .3541688 
perc_multi~2 |  52.64286   18.76403 
perc_multi~1 |  3.142857   .7513055 
-------------+----------------------
40           |                      
ability_l~td |  .2767103   .9146411 
ability_ta~d |  .2062629   .7104906 
       q_age |  25.63158   10.92505 
    q_gender |  .3684211   .4955946 
   economist |  .1052632   .3153018 
perc_multi~2 |  62.78947   20.63863 
perc_multi~1 |  2.789474    .976328 
-------------+----------------------
Ample        |                      
ability_l~td | -.1081175   .9676196 
ability_ta~d |  .1208537   .9243445 
       q_age |  23.32979   3.535954 
    q_gender |  .6170213   .4887197 
   economist |  .1276596   .3354997 
perc_multi~2 |   61.6383   18.29381 
perc_multi~1 |  2.659574   .8237495 
(est2 stored)

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Forced Choice}

Summary statistics: mean sd
     for variables: ability_load_std ability_task_std q_age q_gender economist perc_multitasking_2 perc_multitasking_1
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
ability_l~td |  -.007574   .9835673 
ability_ta~d | -.0145027   1.011907 
       q_age |  23.69565   4.370787 
    q_gender |  .5144928   .5016107 
   economist |   .173913   .3804155 
perc_multi~2 |  53.42754   19.04466 
perc_multi~1 |  3.181159   .7372815 
-------------+----------------------
20           |                      
ability_l~td |  .2824302   .8280313 
ability_ta~d |  .2309059   .7403143 
       q_age |    23.625   4.661284 
    q_gender |       .65   .4830459 
   economist |        .1   .3038218 
perc_multi~2 |    56.425    21.2046 
perc_multi~1 |     3.075   .7970297 
-------------+----------------------
40           |                      
ability_l~td | -.1740166   1.230358 
ability_ta~d |  -.471418   1.273798 
       q_age |      22.8    3.13889 
    q_gender |       .65   .4893605 
   economist |        .1   .3077935 
perc_multi~2 |     59.35   13.65081 
perc_multi~1 |      3.35   .6708204 
-------------+----------------------
Ample        |                      
ability_l~td | -.0853061   1.137883 
ability_ta~d | -.1319161   1.045988 
       q_age |  24.73958   6.090968 
    q_gender |  .5520833   .4998903 
   economist |    .15625   .3649982 
perc_multi~2 |  57.51042   18.36873 
perc_multi~1 |  2.635417   .6508261 
(est3 stored)

. 
. * copy mean matrix such that p-values vector has the correct length etc.
. matrix p_values=e(mean)

. local i=0

. foreach var of varlist ability_load_std ability_task_std  q_age q_gender economist perc_multitasking_2 perc_multitasking_1 {
  2.     local i=1+`i'
  3.     kwallis `var' , by(treatment_id)
  4.     local p=chi2tail(`r(df)',`r(chi2_adj)')
  5.     matrix p_values[1,`i']=`p'
  6. }

Kruskal-Wallis equality-of-populations rank test

  +---------------------------+
  | treatm~d | Obs | Rank Sum |
  |----------+-----+----------|
  |        1 | 143 | 61428.00 |
  |        2 |  43 | 19871.00 |
  |        3 |  18 |  8593.50 |
  |        4 |  94 | 44705.50 |
  |        5 | 145 | 65500.50 |
  |----------+-----+----------|
  |        6 |  42 | 17802.50 |
  |        7 |  19 |  9984.00 |
  |        8 |  94 | 38621.50 |
  |        9 | 138 | 60830.50 |
  |       10 |  40 | 20974.50 |
  |----------+-----+----------|
  |       11 |  20 |  8295.00 |
  |       12 |  96 | 41671.50 |
  +---------------------------+

chi-squared =    10.448 with 11 d.f.
probability =     0.4906

chi-squared with ties =    10.569 with 11 d.f.
probability =     0.4801

Kruskal-Wallis equality-of-populations rank test

  +---------------------------+
  | treatm~d | Obs | Rank Sum |
  |----------+-----+----------|
  |        1 | 143 | 64730.00 |
  |        2 |  43 | 20658.00 |
  |        3 |  18 |  8965.00 |
  |        4 |  94 | 43585.00 |
  |        5 | 145 | 59360.00 |
  |----------+-----+----------|
  |        6 |  42 | 19860.50 |
  |        7 |  19 |  9316.50 |
  |        8 |  94 | 44307.50 |
  |        9 | 138 | 61030.00 |
  |       10 |  40 | 19581.00 |
  |----------+-----+----------|
  |       11 |  20 |  7125.50 |
  |       12 |  96 | 39759.00 |
  +---------------------------+

chi-squared =    11.959 with 11 d.f.
probability =     0.3667

chi-squared with ties =    12.163 with 11 d.f.
probability =     0.3515

Kruskal-Wallis equality-of-populations rank test

  +---------------------------+
  | treatm~d | Obs | Rank Sum |
  |----------+-----+----------|
  |        1 | 143 | 60712.00 |
  |        2 |  43 | 19325.50 |
  |        3 |  18 |  6986.50 |
  |        4 |  94 | 38487.50 |
  |        5 | 145 | 69592.00 |
  |----------+-----+----------|
  |        6 |  42 | 17176.50 |
  |        7 |  19 |  8922.50 |
  |        8 |  94 | 41730.00 |
  |        9 | 138 | 61793.00 |
  |       10 |  40 | 17457.50 |
  |----------+-----+----------|
  |       11 |  20 |  8221.50 |
  |       12 |  96 | 47873.50 |
  +---------------------------+

chi-squared =    11.789 with 11 d.f.
probability =     0.3797

chi-squared with ties =    11.905 with 11 d.f.
probability =     0.3708

Kruskal-Wallis equality-of-populations rank test

  +---------------------------+
  | treatm~d | Obs | Rank Sum |
  |----------+-----+----------|
  |        1 | 143 | 64903.00 |
  |        2 |  43 | 18197.00 |
  |        3 |  18 |  8416.00 |
  |        4 |  94 | 42860.00 |
  |        5 | 145 | 63509.00 |
  |----------+-----+----------|
  |        6 |  42 | 19340.00 |
  |        7 |  19 |  6827.00 |
  |        8 |  94 | 44198.00 |
  |        9 | 138 | 58576.00 |
  |       10 |  40 | 19396.00 |
  |----------+-----+----------|
  |       11 |  20 |  9698.00 |
  |       12 |  96 | 42358.00 |
  +---------------------------+

chi-squared =     6.351 with 11 d.f.
probability =     0.8490

chi-squared with ties =     8.608 with 11 d.f.
probability =     0.6580

Kruskal-Wallis equality-of-populations rank test

  +---------------------------+
  | treatm~d | Obs | Rank Sum |
  |----------+-----+----------|
  |        1 | 143 | 62511.00 |
  |        2 |  43 | 18613.00 |
  |        3 |  18 |  8196.00 |
  |        4 |  94 | 43396.00 |
  |        5 | 145 | 65503.00 |
  |----------+-----+----------|
  |        6 |  42 | 18678.00 |
  |        7 |  19 |  8131.00 |
  |        8 |  94 | 41166.00 |
  |        9 | 138 | 63282.00 |
  |       10 |  40 | 17024.00 |
  |----------+-----+----------|
  |       11 |  20 |  8512.00 |
  |       12 |  96 | 43266.00 |
  +---------------------------+

chi-squared =     1.643 with 11 d.f.
probability =     0.9994

chi-squared with ties =     4.371 with 11 d.f.
probability =     0.9578

Kruskal-Wallis equality-of-populations rank test

  +---------------------------+
  | treatm~d | Obs | Rank Sum |
  |----------+-----+----------|
  |        1 | 143 | 62255.00 |
  |        2 |  43 | 16477.50 |
  |        3 |  18 |  7250.00 |
  |        4 |  94 | 45948.00 |
  |        5 | 145 | 57597.00 |
  |----------+-----+----------|
  |        6 |  42 | 17288.00 |
  |        7 |  19 | 10329.50 |
  |        8 |  94 | 49523.00 |
  |        9 | 138 | 57357.50 |
  |       10 |  40 | 18723.00 |
  |----------+-----+----------|
  |       11 |  20 | 10136.50 |
  |       12 |  96 | 45393.00 |
  +---------------------------+

chi-squared =    28.195 with 11 d.f.
probability =     0.0030

chi-squared with ties =    28.334 with 11 d.f.
probability =     0.0029

Kruskal-Wallis equality-of-populations rank test

  +---------------------------+
  | treatm~d | Obs | Rank Sum |
  |----------+-----+----------|
  |        1 | 143 | 66141.50 |
  |        2 |  43 | 22476.00 |
  |        3 |  18 | 10447.50 |
  |        4 |  94 | 35759.00 |
  |        5 | 145 | 73276.50 |
  |----------+-----+----------|
  |        6 |  42 | 20319.50 |
  |        7 |  19 |  7345.00 |
  |        8 |  94 | 32053.00 |
  |        9 | 138 | 68915.50 |
  |       10 |  40 | 18476.50 |
  |----------+-----+----------|
  |       11 |  20 | 11093.00 |
  |       12 |  96 | 31975.00 |
  +---------------------------+

chi-squared =    68.690 with 11 d.f.
probability =     0.0001

chi-squared with ties =    79.449 with 11 d.f.
probability =     0.0001

. 
. matrix p_values=p_values[1,1..7]

. matrix coleq p_values=p-value p-value p-value p-value p-value p-value

. 
. * Convert p-values to estimation result and store it
. convert p_values

p_values[1,7]
           p-value:      p-value:      p-value:      p-value:      p-value:      p-value:      p-value:
      ability_l~td  ability_ta~d         q_age      q_gender     economist  perc_multi~2  perc_multi~1
mean     .48007895     .35150558     .37080276      .6580305     .95777448     .00287702     1.886e-12

. eststo p_values

. 
. esttab est*  p_values using `"${PATH_OUT}/tableO_1.tex"', ///
>     main(mean %5.2f) aux(sd %5.2f) nostar unstack ///
>     noobs nonote label append booktabs compress  ///
>     nonumber  nomtitles frag ///
>     mgroups("\textsc{Baseline}" "\textsc{Directed Attention}" "\textsc{Forced Choice}" "Kruskal-Wallis" , ///
>     pattern(1 1 1 1) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) ///
> 
(output written to /Users/jonasradbruch/Dropbox/PhD/channels_defaults/Interventions and Cognitive Spillovers/Final_Documents/ReplicationPackage/EmpiricalAnalysis/out/tableO_1.tex)

. 
. 
. * As tabstat uses only observation with no missings, perform second part where only data from certain waves are available
. estimates clear

. bysort Treatment_Environment: eststo: estpost tabstat raven_score treatment_id, by(Treatment_Incentives) nototal   statistics(mean sd) columns(statistics) listwise

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Baseline}

Summary statistics: mean sd
     for variables: raven_score treatment_id
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
 raven_score |     6.125   1.481464 
treatment_id |         1          0 
-------------+----------------------
20           |                      
 raven_score |  5.976744   1.388531 
treatment_id |         2          0 
-------------+----------------------
40           |                      
 raven_score |  6.722222    1.48742 
treatment_id |         3          0 
-------------+----------------------
Ample        |                      
 raven_score |  6.086957   1.871732 
treatment_id |         4          0 
(est1 stored)

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Directed Attention}

Summary statistics: mean sd
     for variables: raven_score treatment_id
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
 raven_score |  6.173469   1.579674 
treatment_id |         5          0 
-------------+----------------------
20           |                      
 raven_score |  6.214286   1.881044 
treatment_id |         6          0 
-------------+----------------------
40           |                      
 raven_score |  6.842105   1.641922 
treatment_id |         7          0 
-------------+----------------------
Ample        |                      
 raven_score |  6.195652   1.627808 
treatment_id |         8          0 
(est2 stored)

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Forced Choice}

Summary statistics: mean sd
     for variables: raven_score treatment_id
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
 raven_score |  5.934066   1.533349 
treatment_id |         9          0 
-------------+----------------------
20           |                      
 raven_score |     6.475   1.518898 
treatment_id |        10          0 
-------------+----------------------
40           |                      
 raven_score |       6.3   1.838191 
treatment_id |        11          0 
-------------+----------------------
Ample        |                      
 raven_score |    6.0625   1.972214 
treatment_id |        12          0 
(est3 stored)

. 
. * copy mean matrix such that p-values vector has the correct length etc.
. matrix p_values=e(mean)

. local i=0

. foreach var of varlist raven_score treatment_id{
  2.     local i=1+`i'
  3.     kwallis `var' , by(treatment_id)
  4.     local p=chi2tail(`r(df)',`r(chi2_adj)')
  5.     matrix p_values[1,`i']=`p'
  6. }

Kruskal-Wallis equality-of-populations rank test

  +---------------------------+
  | treatm~d | Obs | Rank Sum |
  |----------+-----+----------|
  |        1 |  96 | 28235.00 |
  |        2 |  43 | 12149.50 |
  |        3 |  18 |  6393.50 |
  |        4 |  46 | 13863.00 |
  |        5 |  98 | 29883.00 |
  |----------+-----+----------|
  |        6 |  42 | 13495.50 |
  |        7 |  19 |  7402.00 |
  |        8 |  46 | 14270.50 |
  |        9 |  91 | 24656.50 |
  |       10 |  40 | 13312.00 |
  |----------+-----+----------|
  |       11 |  20 |  6197.00 |
  |       12 |  48 | 14670.50 |
  +---------------------------+

chi-squared =    11.825 with 11 d.f.
probability =     0.3769

chi-squared with ties =    12.277 with 11 d.f.
probability =     0.3432

Kruskal-Wallis equality-of-populations rank test

  +---------------------------+
  | treatm~d | Obs | Rank Sum |
  |----------+-----+----------|
  |        1 | 143 | 10296.00 |
  |        2 |  43 |  7095.00 |
  |        3 |  18 |  3519.00 |
  |        4 |  94 | 23641.00 |
  |        5 | 145 | 53795.00 |
  |----------+-----+----------|
  |        6 |  42 | 19509.00 |
  |        7 |  19 |  9405.00 |
  |        8 |  94 | 51841.00 |
  |        9 | 138 | 92115.00 |
  |       10 |  40 | 30260.00 |
  |----------+-----+----------|
  |       11 |  20 | 15730.00 |
  |       12 |  96 | 81072.00 |
  +---------------------------+

chi-squared =   876.708 with 11 d.f.
probability =     0.0001

chi-squared with ties =   891.000 with 11 d.f.
probability =     0.0001

. 
. matrix p_values=p_values[1,1..2]

. matrix coleq p_values=p-value p-value

. 
. * Convert p-values to estimation result and store it
. convert p_values

p_values[1,2]
           p-value:      p-value:
       raven_score  treatment_id
mean     .34319171     5.34e-184

. eststo p_values

. 
. esttab est*  p_values using `"${PATH_OUT}/tableO_1.tex"', ///
>     append frag  ///
>     drop(treatment_id) /// refcat(raven_score "\emph{2nd Wave only}", nolabel) nobaselevels ///
>     main(mean %5.2f) aux(sd %5.2f) nostar unstack ///
>     eqlabels(none) nolines ///
>     noobs nonote label  booktabs compress  ///
>     nomtitles nodepvar nonumber
(output written to /Users/jonasradbruch/Dropbox/PhD/channels_defaults/Interventions and Cognitive Spillovers/Final_Documents/ReplicationPackage/EmpiricalAnalysis/out/tableO_1.tex)

. 
. estimates clear

. bysort Treatment_Environment: eststo: estpost tabstat  original_lab treatment_id, by(Treatment_Incentives) nototal   statistics(mean sd) columns(statistics) listwise

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Baseline}

Summary statistics: mean sd
     for variables: original_lab treatment_id
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
original_lab |  .6573427   .4762662 
treatment_id |         1          0 
-------------+----------------------
20           |                      
original_lab |         0          0 
treatment_id |         2          0 
-------------+----------------------
40           |                      
original_lab |         0          0 
treatment_id |         3          0 
-------------+----------------------
Ample        |                      
original_lab |         1          0 
treatment_id |         4          0 
(est1 stored)

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Directed Attention}

Summary statistics: mean sd
     for variables: original_lab treatment_id
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
original_lab |   .662069   .4746445 
treatment_id |         5          0 
-------------+----------------------
20           |                      
original_lab |         0          0 
treatment_id |         6          0 
-------------+----------------------
40           |                      
original_lab |         0          0 
treatment_id |         7          0 
-------------+----------------------
Ample        |                      
original_lab |         1          0 
treatment_id |         8          0 
(est2 stored)

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Forced Choice}

Summary statistics: mean sd
     for variables: original_lab treatment_id
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
original_lab |  .6449275   .4802786 
treatment_id |         9          0 
-------------+----------------------
20           |                      
original_lab |         0          0 
treatment_id |        10          0 
-------------+----------------------
40           |                      
original_lab |         0          0 
treatment_id |        11          0 
-------------+----------------------
Ample        |                      
original_lab |         1          0 
treatment_id |        12          0 
(est3 stored)

. esttab est*   using `"${PATH_OUT}/tableO_1.tex"', ///
>     append frag  drop(treatment_id) ///
>     main(mean %4.0g)  nostar unstack ///
>     eqlabels(none) ///
>     noobs nonote label  booktabs compress  ///
>     nomtitles nodepvar nonumber
(output written to /Users/jonasradbruch/Dropbox/PhD/channels_defaults/Interventions and Cognitive Spillovers/Final_Documents/ReplicationPackage/EmpiricalAnalysis/out/tableO_1.tex)

. 
. estimates clear

. bysort Treatment_Environment: eststo: estpost tabstat obs  treatment_id, by(Treatment_Incentives) nototal   statistics(mean sd) columns(statistics) listwise

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Baseline}

Summary statistics: mean sd
     for variables: obs treatment_id
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
         obs |       143          0 
treatment_id |         1          0 
-------------+----------------------
20           |                      
         obs |        43          0 
treatment_id |         2          0 
-------------+----------------------
40           |                      
         obs |        18          0 
treatment_id |         3          0 
-------------+----------------------
Ample        |                      
         obs |        94          0 
treatment_id |         4          0 
(est1 stored)

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Directed Attention}

Summary statistics: mean sd
     for variables: obs treatment_id
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
         obs |       145          0 
treatment_id |         5          0 
-------------+----------------------
20           |                      
         obs |        42          0 
treatment_id |         6          0 
-------------+----------------------
40           |                      
         obs |        19          0 
treatment_id |         7          0 
-------------+----------------------
Ample        |                      
         obs |        94          0 
treatment_id |         8          0 
(est2 stored)

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> \textsc{Forced Choice}

Summary statistics: mean sd
     for variables: obs treatment_id
  by categories of: Treatment_Incentives

Treatment_In |   e(mean)      e(sd) 
-------------+----------------------
10           |                      
         obs |       138          0 
treatment_id |         9          0 
-------------+----------------------
20           |                      
         obs |        40          0 
treatment_id |        10          0 
-------------+----------------------
40           |                      
         obs |        20          0 
treatment_id |        11          0 
-------------+----------------------
Ample        |                      
         obs |        96          0 
treatment_id |        12          0 
(est3 stored)

. esttab est*   using `"${PATH_OUT}/tableO_1.tex"', ///
>     append frag  drop(treatment_id) ///
>     main(mean %5.0g)  nostar unstack ///
>     eqlabels(none) ///
>     noobs nonote label  booktabs compress  ///
>     nomtitles nodepvar nonumber
(output written to /Users/jonasradbruch/Dropbox/PhD/channels_defaults/Interventions and Cognitive Spillovers/Final_Documents/ReplicationPackage/EmpiricalAnalysis/out/tableO_1.tex)

. 
. qui file open table_out using `"${PATH_OUT}/tableO_1.tex"', write append

. file write table_out "\bottomrule" _n

. file write table_out "\end{tabular}" _n

. file close table_out

. 
. 
. 
. log close
      name:  <unnamed>
       log:  /Users/jonasradbruch/Dropbox/PhD/channels_defaults/Interventions and Cognitive Spillovers/Final_Documents/ReplicationPackage/EmpiricalAnalysis/out/Randomization_Check.lo
> g
  log type:  text
 closed on:   4 Nov 2021, 09:55:52
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------