-
Notifications
You must be signed in to change notification settings - Fork 2
/
psweight_example_ado.log
5634 lines (5305 loc) · 246 KB
/
psweight_example_ado.log
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
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
----------------------------------------------------------------------------------------------------------------------------------------------------------------
name: psweight_example_ado
log: C:\Users\kkranker\Documents\Stata\psweight\code-psweight\psweight_example_ado.log
log type: text
opened on: 5 Nov 2019, 22:29:40
.
. di as txt "Current user: `c(username)'" _n "Environment: `c(os)' `c(machine_type)' `: environment computername'" _n "Stata: `c(stata_version)'" cond(c(stata_v
> ersion)==c(version),""," (set to version `c(version)')") _n "Date: " c(current_date) " " c(current_time)
Current user: KKranker
Environment: Windows PC (64-bit x86-64) KKRANKER
Stata: 16
Date: 5 Nov 2019 22:29:40
. desc, short
Contains data from C:\Users\kkranker\Documents\Stata\Multiple-Equation-Models\simple_cattaneo_data.dta
obs: 4,642 Cattaneo (2010) study on the effect of maternal smoking on birth weight
vars: 20 8 Apr 2015 05:07
Sorted by:
Note: Dataset has changed since last saved.
. local varlist : copy local varlist_orig
. summ `treatvar' `varlist' `tousevar' `wgtvar' `depvarlist'
Variable | Obs Mean Std. Dev. Min Max
-------------+---------------------------------------------------------
treat | 4,642 .1861267 .3892508 0 1
x1 | 4,642 .6996984 .4584385 0 1
|
x2 |
0 | 4,642 .9659629 .1813439 0 1
1 | 4,642 .0340371 .1813439 0 1
|
x3 |
0 | 4,642 .9465748 .2249042 0 1
-------------+---------------------------------------------------------
1 | 4,642 .0534252 .2249042 0 1
|
x4 | 4,642 .4379578 .4961893 0 1
x5 | 4,642 26.50452 5.619026 13 45
x6 | 4,642 12.68957 2.520661 0 17
x7 | 4,642 6.540069 3.359167 1 12
-------------+---------------------------------------------------------
x90 | 4,642 -.0031039 1.020177 -4.107368 3.325766
x91 | 4,642 -.0212069 1.008708 -4.16458 3.503644
x92 | 4,642 .0076449 1.004589 -3.449011 3.959166
x93 | 4,642 .0049339 1.004513 -4.274254 3.777972
x94 | 4,642 .0124264 .9818583 -3.659006 3.658309
-------------+---------------------------------------------------------
x95 | 4,642 .0044283 1.010194 -3.41615 3.724456
touse | 4,642 .1077122 .31005 0 1
wgt | 4,642 1.993316 .4062602 .6638338 3.540576
y1 | 4,642 3361.68 578.8196 340 5500
y1_binary | 4,642 .9396812 .2381022 0 1
. if (trim("`depvarlist'") != "") local depvaropt depvarlist(`depvarlist')
. ereturn clear
. return clear
.
. // balance before matching
. psweight balanceonly `treatvar' `varlist' if `tousevar', ntable
-------------------------------------------------------------------------------
| mean_T mean_C diff std_diff sd_pool var_ratio
-------------+-----------------------------------------------------------------
x1 | .4673913 .75 -.2826087 -.6149214 .4595851 1.338962
|
x2 |
0 | (empty)
1 | .0108696 .0269608 -.0160912 -.1050325 .1532023 .4133173
|
x3 |
0 | (empty)
1 | .0217391 .0441176 -.0223785 -.1140856 .1961554 .5085817
|
x4 | .4347826 .495098 -.0603154 -.1205719 .5002444 .9914484
x5 | 25.46739 26.56863 -1.101236 -.1896219 5.807538 .8589874
x6 | 11.86957 13.15931 -1.289749 -.5792408 2.226619 .4958356
x7 | 6.858696 6.696078 .1626172 .0485796 3.347437 1.160037
x90 | .0972024 -.048508 .1457105 .1481119 .9837861 .9289414
x91 | -.0890157 -.0077434 -.0812723 -.0817633 .9939954 .8791918
x92 | .0453787 -.0227801 .0681588 .0671946 1.014349 1.090179
x93 | .0865687 .0403853 .0461833 .0471721 .9790382 .8926169
x94 | -.1299173 .0160559 -.1459732 -.1488088 .9809449 .8686432
x95 | -.0807251 -.0658282 -.0148969 -.0150884 .9873048 .8285405
-------------------------------------------------------------------------------
Mean standardized diff. = -0.12754
Mean absolute standardized diff. = 0.17540
Maximum absolute standardized diff. = 0.61492
New variables created: _weight _weight_mtch _pscore _treated
-------------------------------------------------------
| Treatment Control Total
----------------------+--------------------------------
Number of rows | 92 408 500
Sum of sample weights | 92 408 500
Sum of weights | 92 408 500
-------------------------------------------------------
. ereturn list
macros:
e(cmd) : "psweight"
e(cmdline) : "psweight balanceonly treat x1 i.x2 i.x3 x4 x5 x6 x7 x9* if touse, ntable"
e(subcmd) : "balanceonly"
e(tmvarlist) : "x1 0b.x2 1.x2 0b.x3 1.x3 x4 x5 x6 x7 x90 x91 x92 x93 x94 x95"
e(tvar) : "treat"
e(stat) : "n/a"
. return list
scalars:
r(sum_w_0) = 408
r(sum_w_1) = 92
r(sum_w) = 500
r(sum_sw_0) = 408
r(sum_sw_1) = 92
r(sum_sw) = 500
r(N0_raw) = 408
r(N1_raw) = 92
r(N_raw) = 500
r(max_asd) = .6149214017045797
r(mean_asd) = .1753994534212237
r(mean_sd) = -.1275443258377829
r(k_omitted) = 2
macros:
r(varlist) : "treat x1 0b.x2 1.x2 0b.x3 1.x3 x4 x5 x6 x7 x90 x91 x92 x93 x94 x95"
matrices:
r(N_table) : 3 x 3
r(stddiff) : 1 x 15
r(diff) : 1 x 15
r(bal) : 15 x 6
r(varratio) : 1 x 15
.
. psweight balanceonly `treatvar' `varlist' if `tousevar' [iw=`wgtvar']
-------------------------------------------------------------------------------
| mean_T mean_C diff std_diff sd_pool var_ratio
-------------+-----------------------------------------------------------------
x1 | .4512231 .7470371 -.295814 -.6408853 .4615709 1.316024
|
x2 |
0 | (empty)
1 | .0114039 .0270527 -.0156488 -.101817 .1536956 .4301765
|
x3 |
0 | (empty)
1 | .0240637 .0427955 -.0187318 -.0962824 .1945504 .5757804
|
x4 | .4218861 .4976147 -.0757286 -.1514604 .4999897 .9798375
x5 | 25.44699 26.4983 -1.051311 -.181681 5.786576 .858714
x6 | 11.84757 13.15616 -1.308591 -.5865399 2.231034 .5205072
x7 | 7.015422 6.717714 .2977072 .0885763 3.361025 1.149851
x90 | .0839738 -.0392197 .1231936 .1243171 .9909619 .9265459
x91 | -.0648837 -.0073142 -.0575695 -.0586888 .9809269 .8980782
x92 | .0575388 -.0253504 .0828891 .0822314 1.007999 1.068619
x93 | .1016523 .0464178 .0552345 .0565711 .9763727 .9263536
x94 | -.1252265 .0045953 -.1298217 -.1327548 .9779064 .8528771
x95 | -.1044649 -.0695904 -.0348746 -.0353142 .9875497 .8141756
-------------------------------------------------------------------------------
Mean standardized diff. = -0.12567
Mean absolute standardized diff. = 0.17978
Maximum absolute standardized diff. = 0.64089
New variables created: _weight _weight_mtch _pscore _treated
. psweight balanceonly `treatvar' `varlist' if `tousevar', mweight(`wgtvar') ate
Balance:
-------------------------------------------------------------------------------
| mean_T mean_C diff std_diff sd_pool var_ratio
-------------+-----------------------------------------------------------------
x1 | .4512231 .7470371 -.295814 -.6408853 .4615709 1.316024
|
x2 |
0 | (empty)
1 | .0114039 .0270527 -.0156488 -.101817 .1536956 .4301765
|
x3 |
0 | (empty)
1 | .0240637 .0427955 -.0187318 -.0962824 .1945504 .5757804
|
x4 | .4218861 .4976147 -.0757286 -.1514604 .4999897 .9798375
x5 | 25.44699 26.4983 -1.051311 -.181681 5.786576 .858714
x6 | 11.84757 13.15616 -1.308591 -.5865399 2.231034 .5205072
x7 | 7.015422 6.717714 .2977072 .0885763 3.361025 1.149851
x90 | .0839738 -.0392197 .1231936 .1243171 .9909619 .9265459
x91 | -.0648837 -.0073142 -.0575695 -.0586888 .9809269 .8980782
x92 | .0575388 -.0253504 .0828891 .0822314 1.007999 1.068619
x93 | .1016523 .0464178 .0552345 .0565711 .9763727 .9263536
x94 | -.1252265 .0045953 -.1298217 -.1327548 .9779064 .8528771
x95 | -.1044649 -.0695904 -.0348746 -.0353142 .9875497 .8141756
-------------------------------------------------------------------------------
Mean standardized diff. = -0.12567
Mean absolute standardized diff. = 0.17978
Maximum absolute standardized diff. = 0.64089
C.V. of matching weights: = 0.20180
S.D. of matching weights: = 0.39656
Skewness of matching weights: = 0.00210
Kurtosis of matching weights: = 0.00549
Maximum matching weight: = 3.23664
New variables created: _weight _weight_mtch _pscore _treated
.
. // * UNWEIGHTED DATA EXAMPLES *
.
. // Replicate CBPS
. cbps `treatvar' `varlist' if `tousevar' , ate logit optimization_technique("nr") evaluator_type("gf1")
Iteration 0: f(p) = .00647386
Iteration 1: f(p) = .00451406
Iteration 2: f(p) = .0005336
Iteration 3: f(p) = .00001373
Iteration 4: f(p) = 2.637e-08
Iteration 5: f(p) = 6.777e-13
Iteration 6: f(p) = 1.066e-21
------------------------------------------------------------------------------
treat | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
treat |
x1 | -1.441064 .5046768 -2.86 0.004 -2.430213 -.4519161
1.x2 | -2.548784 3.501511 -0.73 0.467 -9.41162 4.314051
1.x3 | -1.02318 2.005094 -0.51 0.610 -4.953091 2.906732
x4 | -.2320966 .5678014 -0.41 0.683 -1.344967 .8807737
x5 | .0736983 .042799 1.72 0.085 -.0101862 .1575829
x6 | -.4863391 .1923869 -2.53 0.011 -.8634106 -.1092676
x7 | .0655415 .0720901 0.91 0.363 -.0757525 .2068354
x90 | .0303861 .203675 0.15 0.881 -.3688096 .4295819
x91 | -.0236437 .2499136 -0.09 0.925 -.5134655 .466178
x92 | .2014652 .2092517 0.96 0.336 -.2086606 .6115911
x93 | -.0067202 .2511949 -0.03 0.979 -.4990531 .4856126
x94 | -.3662317 .2431817 -1.51 0.132 -.842859 .1103956
x95 | -.0080118 .2531324 -0.03 0.975 -.5041423 .4881187
_cons | 3.127763 1.826429 1.71 0.087 -.4519713 6.707497
------------------------------------------------------------------------------
. ereturn clear
. return clear
.
. psweight cbps `treatvar' `varlist' if `tousevar' , ate pooledvariance `depvaropt' ntable
Step 1 (initial values from logit model):
initial: f(p) = -346.57359
alternative: f(p) = -283.03849
rescale: f(p) = -247.46401
Iteration 0: f(p) = -247.46401
Iteration 1: f(p) = -223.85141
Iteration 2: f(p) = -211.21543
Iteration 3: f(p) = -211.17754
Iteration 4: f(p) = -211.17753
Step 2 (CBPS) :
Iteration 0: f(p) = 2.590e-08
Iteration 1: f(p) = 2.548e-08 (backed up)
Iteration 2: f(p) = 1.980e-08
Iteration 3: f(p) = 1.652e-08
Iteration 4: f(p) = 1.627e-08
Iteration 5: f(p) = 1.540e-08
Iteration 6: f(p) = 1.451e-08
Iteration 7: f(p) = 1.377e-08
Iteration 8: f(p) = 1.290e-08
Iteration 9: f(p) = 1.195e-08
Iteration 10: f(p) = 1.168e-08
Iteration 11: f(p) = 1.075e-08
Iteration 12: f(p) = 1.026e-08
Iteration 13: f(p) = 1.005e-08
Iteration 14: f(p) = 9.509e-09
Iteration 15: f(p) = 9.074e-09
Iteration 16: f(p) = 6.361e-09
Iteration 17: f(p) = 2.702e-09
Iteration 18: f(p) = 2.272e-09
Iteration 19: f(p) = 1.867e-09
Iteration 20: f(p) = 1.339e-09
Iteration 21: f(p) = 1.242e-09
Iteration 22: f(p) = 1.149e-09
Iteration 23: f(p) = 9.784e-10
Iteration 24: f(p) = 9.420e-10
Iteration 25: f(p) = 9.360e-10
Iteration 26: f(p) = 9.200e-10
Iteration 27: f(p) = 9.147e-10
Iteration 28: f(p) = 9.058e-10
Iteration 29: f(p) = 7.129e-10
Iteration 30: f(p) = 3.744e-10
Iteration 31: f(p) = 2.987e-10
Iteration 32: f(p) = 2.963e-10
Iteration 33: f(p) = 2.653e-10
Iteration 34: f(p) = 9.786e-11
Iteration 35: f(p) = 7.971e-12
Iteration 36: f(p) = 7.291e-13
Iteration 37: f(p) = 7.440e-15
Iteration 38: f(p) = 1.955e-16
Iteration 39: f(p) = 1.491e-19
Propensity score model coefficients Number of obs = 500
Propensity score reweigting
Loss = CBPS (just identified)
------------------------------------------------------------------------------
treat | Coef.
-------------+----------------------------------------------------------------
x1 | -1.441064
1.x2 | -2.548779
1.x3 | -1.023181
x4 | -.2320959
x5 | .0736984
x6 | -.4863391
x7 | .0655414
x90 | .0303861
x91 | -.0236438
x92 | .201465
x93 | -.0067204
x94 | -.3662318
x95 | -.0080117
_cons | 3.127762
------------------------------------------------------------------------------
New variables created: _weight _weight_mtch _pscore _treated
-------------------------------------------------------
| Treatment Control Total
----------------------+--------------------------------
Number of rows | 92 408 500
Sum of sample weights | 92 408 500
Sum of weights | 92 408 500
-------------------------------------------------------
. ereturn list
scalars:
e(N) = 500
macros:
e(cmd) : "psweight"
e(cmdline) : "psweight cbps treat x1 i.x2 i.x3 x4 x5 x6 x7 x9* if touse , ate pooledvariance depvarlist(y1 y1_binary) ntable"
e(subcmd) : "cbps"
e(depvarlist) : "y1 y1_binary"
e(tmvarlist) : "x1 0b.x2 1.x2 0b.x3 1.x3 x4 x5 x6 x7 x90 x91 x92 x93 x94 x95"
e(tvar) : "treat"
e(variance) : "pooledvariance"
e(stat) : "ate"
e(properties) : "b"
e(depvar) : "treat"
matrices:
e(b) : 1 x 16
functions:
e(sample)
. return list
scalars:
r(sum_w_0) = 408
r(sum_w_1) = 92
r(sum_w) = 500
r(sum_sw_0) = 408
r(sum_sw_1) = 92
r(sum_sw) = 500
r(N0_raw) = 408
r(N1_raw) = 92
r(N_raw) = 500
macros:
r(mcmethod) : "noadjust"
matrices:
r(N_table) : 3 x 3
r(table) : 1 x 16
.
. psweight call balanceresults()
Balance:
-------------------------------------------------------------------------------
| mean_T mean_C diff std_diff sd_pool var_ratio
-------------+-----------------------------------------------------------------
x1 | .6750468 .6750468 -3.26e-08 -6.96e-08 .4688264 1.008511
|
x2 |
0 | (empty)
1 | .0219356 .0219357 -9.38e-08 -6.39e-07 .1466203 1.008507
|
x3 |
0 | (empty)
1 | .0370067 .0370067 3.80e-08 2.01e-07 .1889672 1.008512
|
x4 | .4861037 .4861037 -9.12e-09 -1.82e-08 .5003074 1.008511
x5 | 26.25386 26.25386 -4.03e-08 -6.43e-09 6.268993 .6747771
x6 | 12.63471 12.63471 5.66e-08 2.41e-08 2.343236 .5637226
x7 | 6.724952 6.724952 3.56e-07 1.06e-07 3.360602 1.190087
x90 | -.0592247 -.0592246 -9.89e-08 -9.48e-08 1.042785 1.206643
x91 | .0116974 .0116973 1.21e-07 1.23e-07 .9810721 .9436962
x92 | -.0041245 -.0041245 8.24e-08 8.08e-08 1.020036 1.339887
x93 | .044381 .0443809 1.41e-07 1.45e-07 .9681889 .8469645
x94 | -.0856687 -.0856689 1.86e-07 1.83e-07 1.015864 .7767334
x95 | -.0859155 -.0859154 -8.61e-08 -8.82e-08 .9766877 .8347645
-------------------------------------------------------------------------------
Mean standardized diff. = -0.00000
Mean absolute standardized diff. = 0.00000
Maximum absolute standardized diff. = 0.00000
C.V. of matching weights: = 0.52754
S.D. of matching weights: = 0.52754
Skewness of matching weights: = 0.21587
Kurtosis of matching weights: = 0.08607
Maximum matching weight: = 6.90640
Prognostic scores:
------------------------------------------------------------------------
| mean_yhat_T mean_yhat_C diff std_diff mean_y_C
-------------+----------------------------------------------------------
y1 | 3444.163 3444.163 2.17e-06 1.42e-08 3444.163
y1_binary | .9544751 .9544751 1.31e-09 2.90e-08 .9544751
------------------------------------------------------------------------
Note: The std_diff column does not account for the standard error of the linear predictions.
. ereturn list
scalars:
e(N) = 500
macros:
e(cmd) : "psweight"
e(cmdline) : "psweight call balanceresults()"
e(subcmd) : "call"
e(depvarlist) : "y1 y1_binary"
e(tmvarlist) : "x1 0b.x2 1.x2 0b.x3 1.x3 x4 x5 x6 x7 x90 x91 x92 x93 x94 x95"
e(tvar) : "treat"
e(variance) : "pooledvariance"
e(stat) : "ate"
e(properties) : "b"
e(depvar) : "treat"
matrices:
e(b) : 1 x 16
functions:
e(sample)
. return list
scalars:
r(wgt_max) = 6.906403316122208
r(wgt_kurtosis) = .0860730631906134
r(wgt_skewness) = .2158749482118905
r(wgt_sd) = .5275373894533257
r(wgt_cv) = .5275373894533257
r(max_asd) = 6.39460380840e-07
r(mean_asd) = 1.36893718545e-07
r(mean_sd) = -4.14074536359e-09
matrices:
r(progdiff) : 2 x 5
r(stddiff) : 1 x 15
r(diff) : 1 x 15
r(bal) : 15 x 6
r(varratio) : 1 x 15
. psweight // test replay
------------------------------------------------------------------------------
treat | Coef.
-------------+----------------------------------------------------------------
x1 | -1.441064
1.x2 | -2.548779
1.x3 | -1.023181
x4 | -.2320959
x5 | .0736984
x6 | -.4863391
x7 | .0655414
x90 | .0303861
x91 | -.0236438
x92 | .201465
x93 | -.0067204
x94 | -.3662318
x95 | -.0080117
_cons | 3.127762
------------------------------------------------------------------------------
.
. cbps `treatvar' `varlist' if `tousevar' , ate over logit optimization_technique("nr") evaluator_type("gf1")
Iteration 0: f(p) = .02441999 (not concave)
Iteration 1: f(p) = .020112
Iteration 2: f(p) = .01484746
Iteration 3: f(p) = .0142955
Iteration 4: f(p) = .01428412
Iteration 5: f(p) = .01428407
Iteration 6: f(p) = .01428407
------------------------------------------------------------------------------
treat | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
treat |
x1 | -1.074574 .2572873 -4.18 0.000 -1.578848 -.5703
1.x2 | -1.732571 .847337 -2.04 0.041 -3.393321 -.0718214
1.x3 | -.535995 .6259896 -0.86 0.392 -1.762912 .6909221
x4 | -.2389831 .2458124 -0.97 0.331 -.7207666 .2428004
x5 | .0484453 .0243181 1.99 0.046 .0007828 .0961078
x6 | -.2519975 .0459113 -5.49 0.000 -.3419819 -.162013
x7 | .0081703 .0322545 0.25 0.800 -.0550474 .0713879
x90 | .120204 .1075227 1.12 0.264 -.0905366 .3309445
x91 | -.1467757 .1099013 -1.34 0.182 -.3621782 .0686269
x92 | .1315867 .1151671 1.14 0.253 -.0941367 .3573101
x93 | .086207 .1113523 0.77 0.439 -.1320395 .3044534
x94 | -.1702521 .103099 -1.65 0.099 -.3723225 .0318183
x95 | .0217906 .112224 0.19 0.846 -.1981643 .2417456
_cons | 1.206345 .6074599 1.99 0.047 .015746 2.396945
------------------------------------------------------------------------------
J test for overidentifying restrictions: P(chisq>7.142, 14) = 0.929
. psweight cbpsoid `treatvar' `varlist' if `tousevar' , ate pooledvariance `depvaropt'
Step 1 (initial values from logit model):
initial: f(p) = -346.57359
alternative: f(p) = -283.03849
rescale: f(p) = -247.46401
Iteration 0: f(p) = -247.46401
Iteration 1: f(p) = -223.85141
Iteration 2: f(p) = -211.21543
Iteration 3: f(p) = -211.17754
Iteration 4: f(p) = -211.17753
Step 2 (CBPS) :
Iteration 0: f(p) = 9.768e-08
Iteration 1: f(p) = 9.599e-08 (backed up)
Iteration 2: f(p) = 7.672e-08
Iteration 3: f(p) = 6.399e-08
Iteration 4: f(p) = 6.304e-08
Iteration 5: f(p) = 6.026e-08
Iteration 6: f(p) = 5.854e-08
Iteration 7: f(p) = 5.801e-08
Iteration 8: f(p) = 5.780e-08
Iteration 9: f(p) = 5.775e-08
Iteration 10: f(p) = 5.764e-08
Iteration 11: f(p) = 5.743e-08
Iteration 12: f(p) = 5.722e-08
Iteration 13: f(p) = 5.718e-08
Iteration 14: f(p) = 5.716e-08
Iteration 15: f(p) = 5.715e-08
Iteration 16: f(p) = 5.715e-08
Iteration 17: f(p) = 5.715e-08
Iteration 18: f(p) = 5.715e-08
Iteration 19: f(p) = 5.714e-08
Iteration 20: f(p) = 5.714e-08
Iteration 21: f(p) = 5.714e-08
Iteration 22: f(p) = 5.714e-08
Iteration 23: f(p) = 5.714e-08
Iteration 24: f(p) = 5.714e-08
Iteration 25: f(p) = 5.714e-08
Iteration 26: f(p) = 5.714e-08
Iteration 27: f(p) = 5.714e-08
Propensity score model coefficients Number of obs = 500
Propensity score reweigting
Loss = CBPS (over identified)
------------------------------------------------------------------------------
treat | Coef.
-------------+----------------------------------------------------------------
x1 | -1.074574
1.x2 | -1.732572
1.x3 | -.5359934
x4 | -.2389832
x5 | .0484453
x6 | -.2519976
x7 | .0081703
x90 | .120204
x91 | -.1467759
x92 | .1315865
x93 | .0862071
x94 | -.170252
x95 | .0217913
_cons | 1.206346
------------------------------------------------------------------------------
New variables created: _weight _weight_mtch _pscore _treated
. psweight call balanceresults()
Balance:
-------------------------------------------------------------------------------
| mean_T mean_C diff std_diff sd_pool var_ratio
-------------+-----------------------------------------------------------------
x1 | .6406563 .7027892 -.0621329 -.1343716 .4623962 1.111543
|
x2 |
0 | (empty)
1 | .0157701 .0233767 -.0076066 -.0518321 .1467555 .6856468
|
x3 |
0 | (empty)
1 | .0248069 .0398362 -.0150293 -.0794677 .1891246 .6378531
|
x4 | .4886895 .4862356 .0024538 .0049045 .5003233 1.008759
x5 | 25.82556 26.34781 -.5222466 -.087499 5.968599 .75999
x6 | 12.33004 12.9064 -.5763636 -.2576162 2.237296 .5881094
x7 | 6.884519 6.669732 .2147874 .0639212 3.360189 1.180429
x90 | -.0713185 -.0265029 -.0448156 -.0441807 1.014371 1.157748
x91 | .0200092 -.022611 .0426201 .0430283 .9905145 .9174008
x92 | .0040224 -.0083768 .0123991 .0121514 1.020391 1.200576
x93 | .022949 .0551791 -.0322301 -.03319 .9710768 .8891007
x94 | -.1215951 -.0231316 -.0984635 -.0994522 .990058 .8143466
x95 | -.095014 -.0715949 -.0234192 -.0239414 .9781896 .8041465
-------------------------------------------------------------------------------
Mean standardized diff. = -0.05289
Mean absolute standardized diff. = 0.07197
Maximum absolute standardized diff. = 0.25762
C.V. of matching weights: = 0.29590
S.D. of matching weights: = 0.29590
Skewness of matching weights: = 0.15745
Kurtosis of matching weights: = 0.06543
Maximum matching weight: = 4.20459
Prognostic scores:
------------------------------------------------------------------------
| mean_yhat_T mean_yhat_C diff std_diff mean_y_C
-------------+----------------------------------------------------------
y1 | 3443.444 3453.946 -10.50206 -.0757772 3453.946
y1_binary | .9509072 .9588221 -.0079149 -.1916554 .9588221
------------------------------------------------------------------------
Note: The std_diff column does not account for the standard error of the linear predictions.
.
. cbps `treatvar' `varlist' if `tousevar' , att logit optimization_technique("nr") evaluator_type("gf1")
Iteration 0: f(p) = .00197031
Iteration 1: f(p) = .00006892
Iteration 2: f(p) = 1.777e-07
Iteration 3: f(p) = 2.570e-12
Iteration 4: f(p) = 6.940e-22
------------------------------------------------------------------------------
treat | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
treat |
x1 | -1.339291 .3615444 -3.70 0.000 -2.047905 -.6306769
1.x2 | -1.525175 1.19071 -1.28 0.200 -3.858923 .8085728
1.x3 | -.5996277 .8424377 -0.71 0.477 -2.250775 1.05152
x4 | -.3183658 .3103113 -1.03 0.305 -.9265647 .2898331
x5 | .0587883 .02835 2.07 0.038 .0032234 .1143533
x6 | -.2435676 .0675718 -3.60 0.000 -.3760059 -.1111292
x7 | .0341034 .0400884 0.85 0.395 -.0444685 .1126752
x90 | .158599 .1286436 1.23 0.218 -.0935378 .4107357
x91 | -.1617619 .131618 -1.23 0.219 -.4197284 .0962045
x92 | .1391156 .1358437 1.02 0.306 -.1271333 .4053644
x93 | .0571151 .134574 0.42 0.671 -.2066451 .3208752
x94 | -.1175052 .1193236 -0.98 0.325 -.3513752 .1163649
x95 | .011505 .1383574 0.08 0.934 -.2596705 .2826805
_cons | .782858 .962964 0.81 0.416 -1.104517 2.670233
------------------------------------------------------------------------------
. psweight cbps `treatvar' `varlist' if `tousevar' , atet pooledvariance `depvaropt'
Step 1 (initial values from logit model):
initial: f(p) = -346.57359
alternative: f(p) = -283.03849
rescale: f(p) = -247.46401
Iteration 0: f(p) = -247.46401
Iteration 1: f(p) = -223.85141
Iteration 2: f(p) = -211.21543
Iteration 3: f(p) = -211.17754
Iteration 4: f(p) = -211.17753
Step 2 (CBPS) :
Iteration 0: f(p) = 7.881e-09
Iteration 1: f(p) = 7.799e-09 (backed up)
Iteration 2: f(p) = 7.301e-09
Iteration 3: f(p) = 5.045e-09
Iteration 4: f(p) = 4.162e-09
Iteration 5: f(p) = 3.700e-09
Iteration 6: f(p) = 3.063e-09
Iteration 7: f(p) = 2.655e-09
Iteration 8: f(p) = 2.353e-09
Iteration 9: f(p) = 2.232e-09
Iteration 10: f(p) = 1.928e-09
Iteration 11: f(p) = 1.687e-09
Iteration 12: f(p) = 1.155e-09
Iteration 13: f(p) = 8.603e-10
Iteration 14: f(p) = 7.496e-10
Iteration 15: f(p) = 4.771e-10
Iteration 16: f(p) = 2.778e-10
Iteration 17: f(p) = 7.348e-11
Iteration 18: f(p) = 4.499e-11
Iteration 19: f(p) = 4.379e-11
Iteration 20: f(p) = 3.501e-11
Iteration 21: f(p) = 2.719e-11
Iteration 22: f(p) = 5.991e-12
Iteration 23: f(p) = 1.225e-12
Iteration 24: f(p) = 1.153e-12
Iteration 25: f(p) = 1.081e-12
Iteration 26: f(p) = 8.074e-13
Iteration 27: f(p) = 5.560e-13
Iteration 28: f(p) = 1.140e-13
Iteration 29: f(p) = 2.312e-15
Iteration 30: f(p) = 4.524e-18
Iteration 31: f(p) = 2.979e-20
Propensity score model coefficients Number of obs = 500
Propensity score reweigting
Loss = CBPS (just identified)
------------------------------------------------------------------------------
treat | Coef.
-------------+----------------------------------------------------------------
x1 | -1.339291
1.x2 | -1.525175
1.x3 | -.5996277
x4 | -.3183657
x5 | .0587884
x6 | -.2435675
x7 | .0341033
x90 | .158599
x91 | -.161762
x92 | .1391156
x93 | .0571151
x94 | -.1175052
x95 | .0115051
_cons | .7828573
------------------------------------------------------------------------------
New variables created: _weight _weight_mtch _pscore _treated
. psweight call balanceresults()
Balance:
-------------------------------------------------------------------------------
| mean_T mean_C diff std_diff sd_pool var_ratio
-------------+-----------------------------------------------------------------
x1 | .4673913 .4673913 3.89e-08 7.79e-08 .4994352 1.008511
|
x2 |
0 | (empty)
1 | .0108696 .0108696 -6.52e-09 -6.28e-08 .1037929 1.00851
|
x3 |
0 | (empty)
1 | .0217391 .0217391 -4.28e-09 -2.93e-08 .1459766 1.008511
|
x4 | .4347826 .4347826 3.07e-09 6.18e-09 .4962249 1.008511
x5 | 25.46739 25.46739 -3.12e-07 -4.68e-08 6.664728 .6195799
x6 | 11.86957 11.86957 -9.83e-08 -4.81e-08 2.043536 .5669465
x7 | 6.858696 6.858695 1.84e-07 5.48e-08 3.363971 1.145237
x90 | .0972024 .0972025 -2.95e-08 -2.89e-08 1.021603 .845302
x91 | -.0890157 -.0890157 6.46e-09 6.76e-09 .9556678 .9654928
x92 | .0453787 .0453787 -3.77e-08 -3.78e-08 .9971707 1.136731
x93 | .0865687 .0865687 -2.71e-08 -2.85e-08 .95074 .9577068
x94 | -.1299173 -.1299173 1.47e-08 1.43e-08 1.02511 .7795321
x95 | -.0807251 -.080725 -9.60e-08 -1.00e-07 .9586344 .8888006
-------------------------------------------------------------------------------
Mean standardized diff. = -0.00000
Mean absolute standardized diff. = 0.00000
Maximum absolute standardized diff. = 0.00000
C.V. of matching weights: = 0.98844
S.D. of matching weights: = 0.98844
Skewness of matching weights: = 0.11001
Kurtosis of matching weights: = 0.02254
Maximum matching weight: = 7.03226
Prognostic scores:
------------------------------------------------------------------------
| mean_yhat_T mean_yhat_C diff std_diff mean_y_C
-------------+----------------------------------------------------------
y1 | 3424.753 3424.753 -2.51e-06 -1.51e-08 3424.753
y1_binary | .9470393 .9470393 -3.24e-09 -6.07e-08 .9470393
------------------------------------------------------------------------
Note: The std_diff column does not account for the standard error of the linear predictions.
.
. cbps `treatvar' `varlist' if `tousevar' , att over logit optimization_technique("nr") evaluator_type("gf1")
Iteration 0: f(p) = .04521356
Iteration 1: f(p) = .03210384
Iteration 2: f(p) = .0303286
Iteration 3: f(p) = .0302734
Iteration 4: f(p) = .03027339
Iteration 5: f(p) = .03027339
------------------------------------------------------------------------------
treat | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
treat |
x1 | -1.171988 .2187737 -5.36 0.000 -1.600776 -.7431991
1.x2 | -1.909814 .6607307 -2.89 0.004 -3.204822 -.6148052
1.x3 | -.4402667 .7269474 -0.61 0.545 -1.865057 .984524
x4 | -.3130788 .2251092 -1.39 0.164 -.7542848 .1281272
x5 | .0503881 .0191417 2.63 0.008 .0128711 .0879051
x6 | -.2393185 .0575186 -4.16 0.000 -.352053 -.1265841
x7 | .0261168 .0311563 0.84 0.402 -.0349484 .0871821
x90 | .1425533 .1007579 1.41 0.157 -.0549285 .3400351
x91 | -.1282785 .1127153 -1.14 0.255 -.3491964 .0926393
x92 | .1073 .1112316 0.96 0.335 -.1107099 .3253099
x93 | .0527165 .1101053 0.48 0.632 -.1630859 .2685189
x94 | -.1248021 .0971592 -1.28 0.199 -.3152305 .0656263
x95 | .0220743 .1115296 0.20 0.843 -.1965196 .2406683
_cons | .9132207 .6048419 1.51 0.131 -.2722476 2.098689
------------------------------------------------------------------------------
J test for overidentifying restrictions: P(chisq>15.137, 14) = 0.369
. psweight cbpsoid `treatvar' `varlist' if `tousevar' , atet pooledvariance `depvaropt'
Step 1 (initial values from logit model):
initial: f(p) = -346.57359
alternative: f(p) = -283.03849
rescale: f(p) = -247.46401
Iteration 0: f(p) = -247.46401
Iteration 1: f(p) = -223.85141
Iteration 2: f(p) = -211.21543
Iteration 3: f(p) = -211.17754
Iteration 4: f(p) = -211.17753
Step 2 (CBPS) :
Iteration 0: f(p) = 1.809e-07
Iteration 1: f(p) = 1.775e-07 (backed up)
Iteration 2: f(p) = 1.749e-07
Iteration 3: f(p) = 1.665e-07
Iteration 4: f(p) = 1.593e-07
Iteration 5: f(p) = 1.436e-07
Iteration 6: f(p) = 1.400e-07
Iteration 7: f(p) = 1.356e-07
Iteration 8: f(p) = 1.328e-07
Iteration 9: f(p) = 1.272e-07
Iteration 10: f(p) = 1.231e-07
Iteration 11: f(p) = 1.224e-07
Iteration 12: f(p) = 1.220e-07
Iteration 13: f(p) = 1.219e-07
Iteration 14: f(p) = 1.218e-07
Iteration 15: f(p) = 1.217e-07
Iteration 16: f(p) = 1.213e-07
Iteration 17: f(p) = 1.212e-07
Iteration 18: f(p) = 1.212e-07
Iteration 19: f(p) = 1.212e-07
Iteration 20: f(p) = 1.211e-07
Iteration 21: f(p) = 1.211e-07
Iteration 22: f(p) = 1.211e-07
Iteration 23: f(p) = 1.211e-07
Iteration 24: f(p) = 1.211e-07
Iteration 25: f(p) = 1.211e-07
Propensity score model coefficients Number of obs = 500
Propensity score reweigting
Loss = CBPS (over identified)
------------------------------------------------------------------------------
treat | Coef.
-------------+----------------------------------------------------------------
x1 | -1.171988
1.x2 | -1.909811
1.x3 | -.4402665
x4 | -.3130787
x5 | .0503881
x6 | -.2393185
x7 | .0261168
x90 | .1425533
x91 | -.1282785
x92 | .1073
x93 | .0527165
x94 | -.1248021
x95 | .0220743
_cons | .9132204
------------------------------------------------------------------------------
New variables created: _weight _weight_mtch _pscore _treated
. psweight call balanceresults()
Balance:
-------------------------------------------------------------------------------
| mean_T mean_C diff std_diff sd_pool var_ratio
-------------+-----------------------------------------------------------------
x1 | .4673913 .4923282 -.0249369 -.0498389 .5003503 1.004458
|
x2 |
0 | (empty)
1 | .0108696 .0074884 .0033811 .0376593 .0897825 1.458884
|
x3 |
0 | (empty)
1 | .0217391 .023711 -.0019719 -.0130452 .151158 .9265073
|
x4 | .4347826 .438673 -.0038904 -.0078335 .4966326 1.006495
x5 | 25.46739 25.45801 .0093786 .0014149 6.628535 .6273162
x6 | 11.86957 11.89491 -.0253428 -.0123238 2.0564 .559006
x7 | 6.858696 6.790863 .0678325 .020134 3.36906 1.140985
x90 | .0972024 .0826851 .0145173 .014215 1.021263 .8460037
x91 | -.0890157 -.0671192 -.0218965 -.0227622 .9619657 .9503048
x92 | .0453787 .0235132 .0218655 .0219385 .9966695 1.138269
x93 | .0865687 .0849356 .001633 .0017143 .9526181 .9531308
x94 | -.1299173 -.1339674 .0040502 .0039553 1.023979 .7815571
x95 | -.0807251 -.0745052 -.0062199 -.0064787 .9600495 .8856706
-------------------------------------------------------------------------------
Mean standardized diff. = -0.00087
Mean absolute standardized diff. = 0.01641
Maximum absolute standardized diff. = 0.04984
C.V. of matching weights: = 0.91559
S.D. of matching weights: = 0.91559
Skewness of matching weights: = 0.10408
Kurtosis of matching weights: = 0.02134
Maximum matching weight: = 6.68335
Prognostic scores:
------------------------------------------------------------------------
| mean_yhat_T mean_yhat_C diff std_diff mean_y_C
-------------+----------------------------------------------------------
y1 | 3424.722 3428.063 -3.341103 -.0202642 3428.063
y1_binary | .9470466 .9484255 -.0013789 -.0265328 .9484255
------------------------------------------------------------------------
Note: The std_diff column does not account for the standard error of the linear predictions.
.
. // After calling psweight, the data is stored in a class instance named psweight_ado_most_recent
. // You can print any of the public functions or variables to the screen with psweight call. For example:
. psweight call diff()
1 2 3 4 5 6 7 8 9 10
+-------------------------------------------------------------------------------------------------------------------------------------------------------
1 | -.0249369238 0 .003381148 0 -.001971892 -.0038903597 .0093785822 -.0253427544 .0678325325 .014517298
+-------------------------------------------------------------------------------------------------------------------------------------------------------
11 12 13 14 15
----------------------------------------------------------------------------+
1 -.0218964943 .0218654581 .001633036 .0040501691 -.0062199121 |
----------------------------------------------------------------------------+
. psweight call balancetable()
-------------------------------------------------------------------------------
| mean_T mean_C diff std_diff sd_pool var_ratio
-------------+-----------------------------------------------------------------
x1 | .4673913 .4923282 -.0249369 -.0498389 .5003503 1.004458
|
x2 |
0 | (empty)
1 | .0108696 .0074884 .0033811 .0376593 .0897825 1.458884
|
x3 |
0 | (empty)
1 | .0217391 .023711 -.0019719 -.0130452 .151158 .9265073
|
x4 | .4347826 .438673 -.0038904 -.0078335 .4966326 1.006495
x5 | 25.46739 25.45801 .0093786 .0014149 6.628535 .6273162
x6 | 11.86957 11.89491 -.0253428 -.0123238 2.0564 .559006
x7 | 6.858696 6.790863 .0678325 .020134 3.36906 1.140985
x90 | .0972024 .0826851 .0145173 .014215 1.021263 .8460037
x91 | -.0890157 -.0671192 -.0218965 -.0227622 .9619657 .9503048
x92 | .0453787 .0235132 .0218655 .0219385 .9966695 1.138269
x93 | .0865687 .0849356 .001633 .0017143 .9526181 .9531308
x94 | -.1299173 -.1339674 .0040502 .0039553 1.023979 .7815571
x95 | -.0807251 -.0745052 -.0062199 -.0064787 .9600495 .8856706
-------------------------------------------------------------------------------
Mean standardized diff. = -0.00087
Mean absolute standardized diff. = 0.01641
Maximum absolute standardized diff. = 0.04984
1 2 3 4 5 6
+-------------------------------------------------------------------------------------------+
1 | .4673913043 .4923282281 -.0249369238 -.0498389338 .5003502664 1.004458062 |
2 | 0 0 0 . 0 . |
3 | .0108695652 .0074884172 .003381148 .03765934 .089782455 1.458884137 |
4 | 0 0 0 . 0 . |
5 | .0217391304 .0237110224 -.001971892 -.0130452337 .1511580419 .9265073401 |
6 | .4347826087 .4386729684 -.0038903597 -.0078334758 .4966326326 1.00649479 |
7 | 25.4673913 25.45801272 .0093785822 .00141488 6.628535351 .6273161762 |
8 | 11.86956522 11.89490797 -.0253427544 -.0123238431 2.056400288 .5590060148 |
9 | 6.858695652 6.79086312 .0678325325 .0201339645 3.369059905 1.140985233 |
10 | .0972024365 .0826851385 .014517298 .0142150498 1.02126255 .8460036629 |
11 | -.0890156845 -.0671191901 -.0218964943 -.02276224 .9619657066 .9503048114 |
12 | .0453786792 .0235132211 .0218654581 .0219385247 .9966694861 1.138268864 |
13 | .0865686693 .0849356333 .001633036 .001714261 .9526180869 .9531308488 |
14 | -.1299172593 -.1339674285 .0040501691 .0039553232 1.023979301 .781557113 |
15 | -.0807250915 -.0745051794 -.0062199121 -.0064787409 .9600495159 .8856705724 |
+-------------------------------------------------------------------------------------------+
.
. // Other objective functions
. psweight mean_sd_sq `treatvar' `varlist' if `tousevar' , atet treatvariance difficult nonrtolerance `depvaropt'
Step 1 (initial values from logit model):
initial: f(p) = -346.57359
alternative: f(p) = -283.03849
rescale: f(p) = -247.46401
Iteration 0: f(p) = -247.46401
Iteration 1: f(p) = -223.85141
Iteration 2: f(p) = -211.21543
Iteration 3: f(p) = -211.17754
Iteration 4: f(p) = -211.17753
Step 2 (CBPS) :
numerical derivatives are approximate
flat or discontinuous region encountered
Iteration 0: f(p) = .00032638
numerical derivatives are approximate
flat or discontinuous region encountered
Iteration 1: f(p) = 8.089e-06
numerical derivatives are approximate
flat or discontinuous region encountered
Iteration 2: f(p) = 5.298e-09
numerical derivatives are approximate
flat or discontinuous region encountered
Iteration 3: f(p) = 1.467e-13
numerical derivatives are approximate
flat or discontinuous region encountered
Iteration 4: f(p) = 2.414e-21
Propensity score model coefficients Number of obs = 500
Propensity score reweigting
Loss = mean(stddiff())^2
------------------------------------------------------------------------------
treat | Coef.
-------------+----------------------------------------------------------------
x1 | -1.206443
1.x2 | -1.628676
1.x3 | -.5803099
x4 | -.2832337
x5 | .0694163
x6 | -.2787869
x7 | .0283209
x90 | .1446874
x91 | -.1322013
x92 | .1288213
x93 | .06336
x94 | -.1645468
x95 | .0190735
_cons | 1.37953