1 2019 Full States MPC and Distributional Statistics by Marital, Kids, and Income Groups.

In the file here, we consider marital, kids and income groups, and summarize various statistics for each bin.

1.1 Test SNW_EVUVW19_JAEEMK Defaults Dense

VFI and Distribution

Call the function with defaults.

clear all;
st_solu_type = 'bisec_vec';
bl_save_csv = false;

% Solve the VFI Problem and get Value Function
% mp_params = snw_mp_param('default_dense');
% mp_params = snw_mp_param('default_docdense');
mp_params = snw_mp_param('default_moredense_a65zh133zs5_e2m2');
mp_controls = snw_mp_control('default_test');

% set Unemployment Related Variables
xi=0.5; % Proportional reduction in income due to unemployment (xi=0 refers to 0 labor income; xi=1 refers to no drop in labor income)
b=1; % Unemployment insurance replacement rate (b=0 refers to no UI benefits; b=1 refers to 100 percent labor income replacement)
TR=100/58056; % Value of a welfare check (can receive multiple checks). TO DO: Update with alternative values

mp_params('xi') = xi;
mp_params('b') = b;
mp_params('TR') = TR;

% Solve for Unemployment Values
mp_controls('bl_print_vfi') = false;
mp_controls('bl_print_vfi_verbose') = false;
mp_controls('bl_print_ds') = true;
mp_controls('bl_print_ds_verbose') = true;    
mp_controls('bl_print_precompute') = false;
mp_controls('bl_print_precompute_verbose') = false;
mp_controls('bl_print_a4chk') = false;
mp_controls('bl_print_a4chk_verbose') = false;
mp_controls('bl_print_evuvw20_jaeemk') = false;
mp_controls('bl_print_evuvw20_jaeemk_verbose') = false;
mp_controls('bl_print_evuvw19_jaeemk') = false;
mp_controls('bl_print_evuvw19_jaeemk_verbose') = false;

% Solve the Model to get V working and unemployed
[V_ss,ap_ss,cons_ss,mp_valpol_more_ss] = snw_vfi_main_bisec_vec(mp_params, mp_controls);

Completed SNW_VFI_MAIN_BISEC_VEC;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;time=802.1179

inc_VFI = mp_valpol_more_ss('inc_VFI');
spouse_inc_VFI = mp_valpol_more_ss('spouse_inc_VFI');
total_inc_VFI = inc_VFI + spouse_inc_VFI;
% tax during covid year
mp_params('a2_covidyr') = mp_params('a2_covidyr_manna_heaven');
% Solve unemployment
[V_unemp,~,cons_unemp,~] = snw_vfi_main_bisec_vec(mp_params, mp_controls, V_ss);

Completed SNW_VFI_MAIN_BISEC_VEC 1 Period Unemp Shock;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;time=786.0697

[Phi_true, Phi_adj, A_agg, Y_inc_agg, ~, mp_dsvfi_results] = snw_ds_main_vec(mp_params, mp_controls, ap_ss, cons_ss, mp_valpol_more_ss);

SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:1 of 82, time-this-age:1.074
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:2 of 82, time-this-age:20.5148
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:3 of 82, time-this-age:23.4908
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:4 of 82, time-this-age:28.525
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:5 of 82, time-this-age:33.2054
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:6 of 82, time-this-age:35.3197
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:7 of 82, time-this-age:37.5611
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:8 of 82, time-this-age:40.226
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:9 of 82, time-this-age:44.3653
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:10 of 82, time-this-age:48.3751
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:11 of 82, time-this-age:49.4182
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:12 of 82, time-this-age:50.6325
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:13 of 82, time-this-age:51.0802
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:14 of 82, time-this-age:52.1717
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:15 of 82, time-this-age:53.2068
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:16 of 82, time-this-age:53.6567
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:17 of 82, time-this-age:53.8811
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:18 of 82, time-this-age:55.0892
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:19 of 82, time-this-age:55.6717
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:20 of 82, time-this-age:56.2143
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:21 of 82, time-this-age:56.5704
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:22 of 82, time-this-age:57.0081
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:23 of 82, time-this-age:57.1682
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:24 of 82, time-this-age:57.3671
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:25 of 82, time-this-age:57.5453
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:26 of 82, time-this-age:57.8356
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:27 of 82, time-this-age:58.0491
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:28 of 82, time-this-age:57.9265
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:29 of 82, time-this-age:57.6332
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:30 of 82, time-this-age:58.1269
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:31 of 82, time-this-age:57.7606
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:32 of 82, time-this-age:57.5816
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:33 of 82, time-this-age:57.3361
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:34 of 82, time-this-age:57.7288
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:35 of 82, time-this-age:56.9154
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:36 of 82, time-this-age:57.2866
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:37 of 82, time-this-age:57.1634
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:38 of 82, time-this-age:57.0388
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:39 of 82, time-this-age:56.6859
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:40 of 82, time-this-age:56.7277
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:41 of 82, time-this-age:56.9976
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:42 of 82, time-this-age:56.6711
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:43 of 82, time-this-age:56.7355
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:44 of 82, time-this-age:56.6671
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:45 of 82, time-this-age:56.1114
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:46 of 82, time-this-age:55.9357
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:47 of 82, time-this-age:55.9514
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:48 of 82, time-this-age:55.4533
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:49 of 82, time-this-age:58.5505
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:50 of 82, time-this-age:59.402
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:51 of 82, time-this-age:59.5814
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:52 of 82, time-this-age:59.4987
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:53 of 82, time-this-age:59.3449
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:54 of 82, time-this-age:59.6498
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:55 of 82, time-this-age:59.3396
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:56 of 82, time-this-age:59.4903
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:57 of 82, time-this-age:59.4659
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:58 of 82, time-this-age:59.2382
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:59 of 82, time-this-age:58.2574
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:60 of 82, time-this-age:58.4884
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:61 of 82, time-this-age:58.2825
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:62 of 82, time-this-age:57.4508
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:63 of 82, time-this-age:56.9986
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:64 of 82, time-this-age:56.5337
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:65 of 82, time-this-age:55.94
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:66 of 82, time-this-age:54.1804
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:67 of 82, time-this-age:53.4807
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:68 of 82, time-this-age:52.222
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:69 of 82, time-this-age:51.6643
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:70 of 82, time-this-age:50.7393
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:71 of 82, time-this-age:49.5324
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:72 of 82, time-this-age:47.7517
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:73 of 82, time-this-age:45.9439
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:74 of 82, time-this-age:44.385
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:75 of 82, time-this-age:42.9
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:76 of 82, time-this-age:41.3804
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:77 of 82, time-this-age:35.089
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:78 of 82, time-this-age:33.9143
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:79 of 82, time-this-age:32.9597
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:80 of 82, time-this-age:26.3587
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:81 of 82, time-this-age:25.2198
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:82 of 82, time-this-age:22.8558
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:1 of 82, time-this-age:0.50074
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:2 of 82, time-this-age:0.078102
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:3 of 82, time-this-age:0.077705
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:4 of 82, time-this-age:0.077939
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:5 of 82, time-this-age:0.07796
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:6 of 82, time-this-age:0.078664
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:7 of 82, time-this-age:0.077012
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:8 of 82, time-this-age:0.077566
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:9 of 82, time-this-age:0.076968
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:10 of 82, time-this-age:0.076874
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:11 of 82, time-this-age:0.07674
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:12 of 82, time-this-age:0.07736
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:13 of 82, time-this-age:0.07804
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:14 of 82, time-this-age:0.077614
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:15 of 82, time-this-age:0.076794
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:16 of 82, time-this-age:0.077524
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:17 of 82, time-this-age:0.077125
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:18 of 82, time-this-age:0.076024
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:19 of 82, time-this-age:0.074863
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:20 of 82, time-this-age:0.07631
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:21 of 82, time-this-age:0.073418
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:22 of 82, time-this-age:0.073802
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:23 of 82, time-this-age:0.073525
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:24 of 82, time-this-age:0.073143
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:25 of 82, time-this-age:0.073793
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:26 of 82, time-this-age:0.073628
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:27 of 82, time-this-age:0.074547
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:28 of 82, time-this-age:0.074412
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:29 of 82, time-this-age:0.074226
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:30 of 82, time-this-age:0.073869
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:31 of 82, time-this-age:0.072886
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:32 of 82, time-this-age:0.074226
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:33 of 82, time-this-age:0.073236
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:34 of 82, time-this-age:0.074885
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:35 of 82, time-this-age:0.073514
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:36 of 82, time-this-age:0.073964
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:37 of 82, time-this-age:0.07539
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:38 of 82, time-this-age:0.073973
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:39 of 82, time-this-age:0.073071
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:40 of 82, time-this-age:0.073901
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:41 of 82, time-this-age:0.073413
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:42 of 82, time-this-age:0.074556
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:43 of 82, time-this-age:0.07319
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:44 of 82, time-this-age:0.073482
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:45 of 82, time-this-age:0.073433
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:46 of 82, time-this-age:0.073574
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:47 of 82, time-this-age:0.073129
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:48 of 82, time-this-age:0.073958
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:49 of 82, time-this-age:0.07419
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:50 of 82, time-this-age:0.07333
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:51 of 82, time-this-age:0.073146
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:52 of 82, time-this-age:0.07345
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:53 of 82, time-this-age:0.073098
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:54 of 82, time-this-age:0.073673
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:55 of 82, time-this-age:0.072706
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:56 of 82, time-this-age:0.073966
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:57 of 82, time-this-age:0.073423
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:58 of 82, time-this-age:0.073912
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:59 of 82, time-this-age:0.073841
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:60 of 82, time-this-age:0.073261
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:61 of 82, time-this-age:0.073155
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:62 of 82, time-this-age:0.074912
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:63 of 82, time-this-age:0.076206
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:64 of 82, time-this-age:0.073746
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:65 of 82, time-this-age:0.072696
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:66 of 82, time-this-age:0.073178
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:67 of 82, time-this-age:0.073645
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:68 of 82, time-this-age:0.073697
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:69 of 82, time-this-age:0.073477
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:70 of 82, time-this-age:0.075493
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:71 of 82, time-this-age:0.073607
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:72 of 82, time-this-age:0.073559
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:73 of 82, time-this-age:0.073002
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:74 of 82, time-this-age:0.073612
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:75 of 82, time-this-age:0.073039
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:76 of 82, time-this-age:0.073474
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:77 of 82, time-this-age:0.073582
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:78 of 82, time-this-age:0.076234
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:79 of 82, time-this-age:0.073668
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:80 of 82, time-this-age:0.073745
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:81 of 82, time-this-age:0.073108
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:82 of 82, time-this-age:0.072892
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:83 of 82, time-this-age:0.073316
SNW_DS_MAIN: Share of population with assets equal to upper bound on asset grid:6.0111e-06
SNW_DS_MAIN: Accidental bequests are thrown in the ocean
SNW_DS_MAIN_VEC tax and spend;it=1;err=0.0010205
SNW_DS_MAIN_VEC tax and spend;it=2;err=0.0008547
SNW_DS_MAIN_VEC tax and spend;it=3;err=0.0007159
SNW_DS_MAIN_VEC tax and spend;it=4;err=0.00059969
SNW_DS_MAIN_VEC tax and spend;it=5;err=0.00050237
SNW_DS_MAIN_VEC tax and spend;it=6;err=0.00042087
SNW_DS_MAIN_VEC tax and spend;it=7;err=0.00035261
SNW_DS_MAIN_VEC tax and spend;it=8;err=0.00029542
SNW_DS_MAIN_VEC tax and spend;it=9;err=0.00024752
SNW_DS_MAIN_VEC tax and spend;it=10;err=0.0002074
SNW_DS_MAIN_VEC tax and spend;it=11;err=0.00017378
SNW_DS_MAIN_VEC tax and spend;it=12;err=0.00014561
SNW_DS_MAIN_VEC tax and spend;it=13;err=0.00012201
SNW_DS_MAIN_VEC tax and spend;it=14;err=0.00010224
SNW_DS_MAIN_VEC tax and spend;it=15;err=8.567e-05
SNW_DS_MAIN_VEC: Number of a2-adjustments (for taxation) used to balance the government budget= 15
SNW_DS_MAIN_VEC: Old and updated value of a2=1.5286      1.5353
SNW_DS_MAIN_VEC: Aggregates: Cons., Gov. cons., Save, Assets, Income, Bequests 48.78871      11.35864      193.3932      197.8872      64.62739      2.559254
SNW_DS_MAIN_VEC: Resource constraint: C_t+A_{t+1}+G_t=A_t+Y_t 258.0346      258.0206
Completed SNW_DS_MAIN_VEC;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;time=4738.1988
pos = 19 ; key = mp_controls
  Map with properties:

        Count: 37
      KeyType: char
    ValueType: any

pos = 20 ; key = mp_params
  Map with properties:

        Count: 52
      KeyType: char
    ValueType: any

----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_dsvfi_results ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                        i     idx    ndim      numel       rowN      colN          sum          mean        std       coefvari       min         max  
                        __    ___    ____    __________    ____    _________    __________    ________    ________    ________    _________    _______

    SS_ss                1    11      6      7.1754e+07     83     8.645e+05    8.3556e+06     0.11645       0.134     1.1507             0    0.29263
    a_ss                 2    16      6      7.1754e+07     83     8.645e+05    2.4595e+09      34.277      39.128     1.1415             0        135
    ap_ss                3    17      6      7.1754e+07     83     8.645e+05    2.3245e+09      32.395      36.796     1.1359             0      163.7
    cons_ss              4    18      6      7.1754e+07     83     8.645e+05    3.5119e+08      4.8943      8.3291     1.7018      0.036717     141.66
    n_ss                 5    21      6      7.1754e+07     83     8.645e+05    2.5114e+08         3.5         1.5    0.42857             1          6
    tax_ss               6    22      6      7.1754e+07     83     8.645e+05    6.6049e+07      0.9205      1.1421     1.2408     0.0013912     12.983
    y_all_ss             7    23      6      7.1754e+07     83     8.645e+05    2.8219e+08      3.9327      4.5134     1.1477      0.038108     50.873
    y_head_earn_ss       8    24      6      7.1754e+07     83     8.645e+05     1.078e+08      1.5024      3.0473     2.0282             0     18.957
    y_head_inc_ss        9    25      6      7.1754e+07     83     8.645e+05    2.1454e+08        2.99      3.3769     1.1294      0.038108     24.357
    y_spouse_inc_ss     10    26      6      7.1754e+07     83     8.645e+05    6.7646e+07     0.94276       2.632     2.7918             0     26.627
    yshr_SS_ss          11    27      6      7.1754e+07     83     8.645e+05    1.0586e+07     0.14753     0.26985     1.8291             0          1
    yshr_interest_ss    12    28      6      7.1754e+07     83     8.645e+05    3.0079e+07      0.4192     0.34983    0.83451             0    0.99299
    yshr_nttxss_ss      13    29      6      7.1754e+07     83     8.645e+05    3.7387e+06    0.052104     0.30148     5.7861      -0.89184     0.2552
    yshr_tax_ss         14    30      6      7.1754e+07     83     8.645e+05    1.4324e+07     0.19963    0.045124    0.22604      0.036506     0.2552
    yshr_wage_ss        15    31      6      7.1754e+07     83     8.645e+05    3.1088e+07     0.43327     0.39448    0.91049             0          1

----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_dsvfi_results Scalars
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                          i     idx     value  
                          __    ___    ________

    A_agg                  1     1       193.39
    A_agg_perhh            2     2       4.2232
    Aprime_agg             3     3       197.89
    Aprime_agg_perhh       4     4       4.3213
    Bequests_aux           5     5       2.5593
    Bequests_aux_perhh     6     6     0.055887
    C_agg                  7     7       48.789
    C_agg_perhh            8     8       1.0654
    SS_spend               9     9       2.3908
    SS_spend_perhh        10    10     0.052208
    Tax_revenues          11    12       13.735
    Tax_revenues_perhh    12    13      0.29994
    Y_inc_agg             13    14       64.627
    Y_inc_agg_perhh       14    15       1.4113

xxx tb_outcomes: all stats xxx
     OriginalVariableNames         a_ss         ap_ss        cons_ss        n_ss         y_all       y_head_inc    y_head_earn    y_spouse_inc    yshr_interest    yshr_wage      yshr_SS       yshr_tax     yshr_nttxss
    ________________________    __________    __________    __________    _________    __________    __________    ___________    ____________    _____________    __________    __________    __________    ___________

    {'mean'                }        4.2232        4.3213        1.0654       2.3554        1.4635         1.105       0.88389         0.35847         0.12186         0.77533       0.10281       0.17862      0.075812 
    {'unweighted_sum'      }          2228    8.7064e+08    8.2948e+07           21    1.3652e+08    3.1435e+06         32128      7.9124e+05      6.2777e+06       1.457e+07         30336    4.6385e+06    4.6082e+06 
    {'sd'                  }        6.7417         6.779        0.6899       1.4375        1.4563       0.99938       0.92012         0.95484         0.16776         0.33761       0.23644      0.035097        0.2557 
    {'coefofvar'           }        1.5964        1.5687       0.64754      0.61029       0.99508       0.90439         1.041          2.6636          1.3766         0.43544        2.2998       0.19649        3.3728 
    {'gini'                }       0.68027       0.68124       0.33738       0.3128       0.44246       0.41709       0.52968         0.85254         0.66038         0.20542        0.9122       0.11198        1.3993 
    {'min'                 }             0             0      0.036717            1      0.038108      0.038108             0               0               0               0             0      0.036506      -0.89184 
    {'max'                 }           135         163.7        141.66            6        50.873        24.357        18.957          26.627         0.99299               1             1        0.2552        0.2552 
    {'pYis0'               }       0.12293       0.10299             0            0             0             0        0.2016         0.52499         0.12293         0.10584        0.7984             0             0 
    {'pYls0'               }             0             0             0            0             0             0             0               0               0               0             0             0       0.17859 
    {'pYgr0'               }       0.87707       0.89701             1            1             1             1        0.7984         0.47501         0.87707         0.89416        0.2016             1       0.82141 
    {'pYisMINY'            }       0.12293       0.10299    6.7731e-07      0.36005    6.7731e-07    9.6433e-07        0.2016         0.52499         0.12293         0.10584        0.7984    6.7731e-07     0.0057869 
    {'pYisMAXY'            }    6.0111e-06    1.6708e-12             0     0.041101    1.6708e-12    1.2498e-09    9.6423e-08      1.5271e-10               0         0.11507     0.0072286    1.6708e-12    1.6708e-12 
    {'p0_01'               }             0             0      0.067181            1       0.07102      0.067406             0               0               0               0             0      0.054635      -0.89184 
    {'p0_1'                }             0             0       0.10544            1       0.11346       0.10438             0               0               0               0             0      0.072312      -0.89184 
    {'p1'                  }             0             0       0.18623            1       0.20359       0.18135             0               0               0               0             0      0.098989      -0.88087 
    {'p5'                  }             0             0       0.27747            1       0.28173       0.25935             0               0               0               0             0       0.11552      -0.58083 
    {'p10'                 }             0             0       0.36103            1       0.35688       0.31385             0               0               0               0             0         0.128      -0.31656 
    {'p20'                 }      0.064373      0.068222       0.49773            1       0.50299       0.41607             0               0       0.0022716         0.64721             0       0.14628      0.086658 
    {'p25'                 }       0.11124       0.17983       0.56413            1       0.57911       0.47199        0.2822               0        0.005886         0.76954             0        0.1537       0.12787 
    {'p30'                 }       0.26367       0.37542       0.63091            1       0.65753        0.5291       0.37443               0        0.011635         0.83018             0       0.16028       0.14386 
    {'p40'                 }       0.68544       0.84816       0.77012            2       0.83048       0.65468       0.52595               0        0.027578         0.89954             0       0.17202       0.16367 
    {'p50'                 }        1.4131        1.5883       0.91942            2        1.0325       0.80051       0.68194               0        0.050747         0.94159             0       0.18238       0.17765 
    {'p60'                 }        2.5301        2.7569        1.0845            2        1.2817       0.98461       0.85365         0.10024        0.084629         0.96882             0       0.19201       0.18926 
    {'p70'                 }        4.1199        4.4885        1.2781            3         1.613        1.2238        1.0745          0.2647         0.13311         0.98651             0       0.20142        0.1999 
    {'p75'                 }        5.4836        5.7144        1.3935            3        1.8306        1.3805        1.2142         0.35915         0.16535         0.99291             0        0.2062       0.20516 
    {'p80'                 }        7.1191        7.2197        1.5293            4        2.1079        1.5773        1.3865         0.45942         0.20853          0.9972       0.08782        0.2112       0.21056 
    {'p90'                 }         12.56        12.096        1.9344            5        3.0419        2.2348        1.9544         0.88301         0.36559               1       0.46753       0.22255       0.22234 
    {'p95'                 }        16.875        17.457        2.3404            5        4.0251        2.9655        2.5615          1.9992         0.52026               1       0.70711       0.22966       0.22949 
    {'p99'                 }        30.548        31.377         3.384            6        6.8588        4.9807        4.2679          3.3614         0.71839               1       0.99128       0.23994       0.23983 
    {'p99_9'               }        56.953        56.953        5.2437            6        14.778        8.7476        7.3966          12.835         0.84802               1             1       0.24894       0.24894 
    {'p99_99'              }        90.439        88.534        7.4817            6        20.971        13.514        11.445          17.808         0.90327               1             1       0.25146       0.25146 
    {'fl_cov_a_ss'         }        45.451        45.439        3.3942      -1.4049        4.4679        3.8282        1.8477         0.63967         0.76424        -0.77528      0.011037      0.098159      0.087122 
    {'fl_cor_a_ss'         }             1       0.99423       0.72975     -0.14496       0.45507       0.56819       0.29785         0.09937         0.67572        -0.34062     0.0069239       0.41485      0.050539 
    {'fl_cov_ap_ss'        }        45.439        45.955        3.4956      -1.3685        5.3067        4.1045        2.1508          1.2022         0.71927        -0.68855     -0.030725       0.10896       0.13969 
    {'fl_cor_ap_ss'        }       0.99423             1       0.74743     -0.14043       0.53754       0.60585       0.34482         0.18573         0.63246        -0.30085     -0.019169       0.45797      0.080586 
    {'fl_cov_cons_ss'      }        3.3942        3.4956       0.47596      0.23909       0.76142       0.55948       0.42576         0.20194        0.037996      -0.0042957     -0.033701      0.018583      0.052284 
    {'fl_cor_cons_ss'      }       0.72975       0.74743             1      0.24109       0.75787       0.81146       0.67071         0.30656          0.3283       -0.018443       -0.2066       0.76748       0.29639 
    {'fl_cov_n_ss'         }       -1.4049       -1.3685       0.23909       2.0664       0.35987      0.092667       0.19287          0.2672       -0.066731         0.17055      -0.10382       0.01337       0.11719 
    {'fl_cor_n_ss'         }      -0.14496      -0.14043       0.24109            1       0.17191      0.064504       0.14582         0.19467        -0.27671         0.35142      -0.30546       0.26501       0.31882 
    {'fl_cov_y_all'        }        4.4679        5.3067       0.76142      0.35987        2.1208        1.1039       0.96246          1.0169      -0.0094215         0.10767      -0.09825      0.038535       0.13679 
    {'fl_cor_y_all'        }       0.45507       0.53754       0.75787      0.17191             1       0.75851       0.71827         0.73129       -0.038564         0.21899      -0.28534       0.75395       0.36733 
    {'fl_cov_y_head_inc'   }        3.8282        4.1045       0.55948     0.092667        1.1039       0.99877       0.87439         0.10516       0.0066643        0.062645      -0.06931      0.024519      0.093828 
    {'fl_cor_y_head_inc'   }       0.56819       0.60585       0.81146     0.064504       0.75851             1       0.95088         0.11021        0.039749         0.18567      -0.29332       0.69903       0.36717 
    {'fl_cov_y_head_earn'  }        1.8477        2.1508       0.42576      0.19287       0.96246       0.87439       0.84663        0.088075       -0.035351         0.12622      -0.09087      0.021869       0.11274 
    {'fl_cor_y_head_earn'  }       0.29785       0.34482       0.67071      0.14582       0.71827       0.95088             1         0.10025        -0.22902         0.40632      -0.41769        0.6772       0.47918 
    {'fl_cov_y_spouse_inc' }       0.63967        1.2022       0.20194       0.2672        1.0169       0.10516      0.088075         0.91171       -0.016086        0.045026      -0.02894      0.014017      0.042957 
    {'fl_cor_y_spouse_inc' }       0.09937       0.18573       0.30656      0.19467       0.73129       0.11021       0.10025               1        -0.10042         0.13968      -0.12819       0.41827       0.17595 
    {'fl_cov_yshr_interest'}       0.76424       0.71927      0.037996    -0.066731    -0.0094215     0.0066643     -0.035351       -0.016086        0.028144       -0.043111      0.014967    0.00011507     -0.014852 
    {'fl_cor_yshr_interest'}       0.67572       0.63246        0.3283     -0.27671     -0.038564      0.039749      -0.22902        -0.10042               1        -0.76116       0.37733      0.019543      -0.34623 
    {'fl_cov_yshr_wage'    }      -0.77528      -0.68855    -0.0042957      0.17055       0.10767      0.062645       0.12622        0.045026       -0.043111         0.11398     -0.070871     0.0040082      0.074879 
    {'fl_cor_yshr_wage'    }      -0.34062      -0.30085     -0.018443      0.35142       0.21899       0.18567       0.40632         0.13968        -0.76116               1      -0.88783       0.33827       0.86739 
    {'fl_cov_yshr_SS'      }      0.011037     -0.030725     -0.033701     -0.10382      -0.09825      -0.06931      -0.09087        -0.02894        0.014967       -0.070871      0.055904    -0.0041232     -0.060027 
    {'fl_cor_yshr_SS'      }     0.0069239     -0.019169       -0.2066     -0.30546      -0.28534      -0.29332      -0.41769        -0.12819         0.37733        -0.88783             1      -0.49688      -0.99288 
    {'fl_cov_yshr_tax'     }      0.098159       0.10896      0.018583      0.01337      0.038535      0.024519      0.021869        0.014017      0.00011507       0.0040082    -0.0041232     0.0012318      0.005355 
    {'fl_cor_yshr_tax'     }       0.41485       0.45797       0.76748      0.26501       0.75395       0.69903        0.6772         0.41827        0.019543         0.33827      -0.49688             1       0.59671 
    {'fl_cov_yshr_nttxss'  }      0.087122       0.13969      0.052284      0.11719       0.13679      0.093828       0.11274        0.042957       -0.014852        0.074879     -0.060027      0.005355      0.065382 
    {'fl_cor_yshr_nttxss'  }      0.050539      0.080586       0.29639      0.31882       0.36733       0.36717       0.47918         0.17595        -0.34623         0.86739      -0.99288       0.59671             1 
    {'fracByP0_01'         }             0             0    5.5188e-06      0.15286    4.2239e-06    5.3477e-06             0               0               0               0             0    2.7971e-05     -0.068076 
    {'fracByP0_1'          }             0             0    8.2593e-05      0.15286     6.444e-05     7.874e-05             0               0               0               0             0    0.00036227     -0.068076 
    {'fracByP1'            }             0             0     0.0013857      0.15286     0.0010994     0.0013164             0               0               0               0             0     0.0048673      -0.12468 
    {'fracByP5'            }             0             0      0.010292      0.15286     0.0079949     0.0098702             0               0               0               0             0      0.029443       -0.5241 
    {'fracByP10'           }             0             0      0.025341      0.15286      0.018888      0.023823             0               0               0               0             0      0.063581      -0.79929 
    {'fracByP20'           }    0.00074832    0.00060951      0.065753      0.15286      0.048269      0.055932             0               0      0.00062087        0.035718             0       0.14063      -0.95293 
    {'fracByP25'           }     0.0014123     0.0020285      0.090679      0.15286      0.066791      0.076089      0.011919               0       0.0022208        0.081977             0       0.18268      -0.87877 
    {'fracByP30'           }     0.0041719     0.0051595       0.11872      0.15286      0.087944      0.099825      0.030422               0       0.0057734         0.13373             0       0.22666      -0.78845 
    {'fracByP40'           }      0.016751       0.01877        0.1844      0.40183       0.13867       0.15374      0.081507               0        0.021422         0.24572             0       0.31976      -0.58481 
    {'fracByP50'           }      0.045326      0.046338       0.26358      0.40183       0.20207        0.2193       0.14969               0        0.052869         0.36465             0       0.41901      -0.35925 
    {'fracByP60'           }      0.095502      0.095716        0.3575      0.40183       0.28072       0.30011       0.23638        0.012691         0.10758         0.48798             0        0.5238      -0.11708 
    {'fracByP70'           }       0.17466       0.17847       0.46813      0.56321       0.37901        0.3977       0.34502        0.062539         0.19577         0.61416             0       0.63393       0.13963 
    {'fracByP75'           }       0.24517       0.23715       0.53078      0.56321       0.43771       0.45649       0.40974         0.10566          0.2569         0.67799             0       0.69099        0.2732 
    {'fracByP80'           }       0.32852       0.31134       0.59927      0.75407       0.50477       0.52324       0.48316         0.16286         0.33321         0.74217    0.00090541        0.7494       0.41028 
    {'fracByP90'           }       0.56651       0.52814       0.75975       0.8953       0.67658       0.69187       0.66809         0.32851         0.55755               1       0.28585        0.8707       0.69559 
    {'fracByP95'           }       0.70071        0.6954       0.85893       0.8953       0.79526       0.80738       0.79354         0.52587         0.73636               1       0.57012       0.93395       0.84448 
    {'fracByP99'           }       0.90524       0.90259       0.96084            1       0.93132       0.94047       0.93679         0.80938         0.93586               1       0.90292       0.98633       0.96779 
    {'fracByP99_9'         }       0.98567       0.98372       0.99419            1       0.98801       0.99026        0.9897         0.95807         0.99283               1             1        0.9986        0.9967 
    {'fracByP99_99'        }       0.99808        0.9976       0.99922            1       0.99841       0.99858       0.99851         0.99467         0.99929               1             1       0.99986       0.99967 

% Get Matrixes
cl_st_precompute_list = {'a', 'ar_z_ctr_amz', ...
    'inc', 'inc_unemp', 'spouse_inc', 'spouse_inc_unemp', 'ref_earn_wageind_grid',...
    'ap_idx_lower_ss', 'ap_idx_higher_ss', 'ap_idx_lower_weight_ss'};
mp_controls('bl_print_precompute_verbose') = false;
[mp_precompute_res] = snw_hh_precompute(mp_params, mp_controls, cl_st_precompute_list, ap_ss, Phi_true);

Wage quintile cutoffs=0.47017     0.71433      1.0293      1.5654
Completed SNW_HH_PRECOMPUTE;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;time cost=719.898

1.2 Solve for 2019 Evuvw With 0 and 1 Checks

% Call Function
welf_checks = 0;
[ev19_jaeemk_check0, ec19_jaeemk_check0, ev20_jaeemk_check0, ec20_jaeemk_check0] = snw_evuvw19_jaeemk_foc(...
    welf_checks, st_solu_type, mp_params, mp_controls, ...
    V_ss, ap_ss, cons_ss, V_unemp, cons_unemp, mp_precompute_res);

Completed SNW_A4CHK_WRK_BISEC_VEC;welf_checks=0;TR=0.0017225;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;time cost=111.3972
Completed SNW_A4CHK_UNEMP_BISEC_VEC;welf_checks=0;TR=0.0017225;xi=0.5;b=1;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;time cost=111.5538
Completed SNW_EVUVW20_JAEEMK;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;timeEUEC=14.2051
Completed SNW_EVUVW19_JAEEMK_FOC;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;time=23.2652

% Call Function
welf_checks = 1;
[ev19_jaeemk_check2, ec19_jaeemk_check2, ev20_jaeemk_check2, ec20_jaeemk_check2] = snw_evuvw19_jaeemk_foc(...
    welf_checks, st_solu_type, mp_params, mp_controls, ...
    V_ss, ap_ss, cons_ss, V_unemp, cons_unemp, mp_precompute_res);

Completed SNW_A4CHK_WRK_BISEC_VEC;welf_checks=1;TR=0.0017225;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;time cost=113.3588
Completed SNW_A4CHK_UNEMP_BISEC_VEC;welf_checks=1;TR=0.0017225;xi=0.5;b=1;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;time cost=113.1519
Completed SNW_EVUVW20_JAEEMK;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;timeEUEC=14.1367
Completed SNW_EVUVW19_JAEEMK_FOC;SNW_MP_PARAM=default_moredense_a65zh133zs5_e2m2;SNW_MP_CONTROL=default_test;time=23.3214

Differences between Checks in Expected Value and Expected Consumption

mn_V_U_gain_check = ev19_jaeemk_check2 - ev19_jaeemk_check0;
mn_MPC_C_gain_share_check = (ec19_jaeemk_check2 - ec19_jaeemk_check0)./(welf_checks*mp_params('TR'));

1.3 Additional Variables

Create additional Staet-Spac Arrays

% (n_jgrid,n_agrid,n_etagrid,n_educgrid,n_marriedgrid,n_kidsgrid);
% Children Array
ar_kids = (1:mp_params('n_kidsgrid')) - 1;
mn_kids = zeros(1,1,1,1,1,length(ar_kids));
mn_kids(1,1,1,1,1,:) = ar_kids;
kids_ss = repmat(mn_kids, [mp_params('n_jgrid'), mp_params('n_agrid'), mp_params('n_etagrid'), ...
    mp_params('n_educgrid'), mp_params('n_marriedgrid'), 1]);
% Marital Status Arrays
ar_marital = (1:mp_params('n_marriedgrid')) - 1;
mn_marital = zeros(1,1,1,1,length(ar_marital),1);
mn_marital(1,1,1,1,:,1) = ar_marital;
marital_ss = repmat(mn_marital, [mp_params('n_jgrid'), mp_params('n_agrid'), mp_params('n_etagrid'), ...
    mp_params('n_educgrid'), 1, mp_params('n_kidsgrid')]);
% Educational Status Arrays
ar_educ = (1:mp_params('n_educgrid')) - 1;
mn_educ = zeros(1,1,1,length(ar_educ),1,1);
mn_educ(1,1,1,:,1,1) = ar_educ;
educ_ss = repmat(mn_educ, [mp_params('n_jgrid'), mp_params('n_agrid'), mp_params('n_etagrid'), ...
    1, mp_params('n_marriedgrid'), mp_params('n_kidsgrid')]);
% Age Array
ar_age = (1:mp_params('n_jgrid')) + 18;
mn_age = zeros(length(ar_age),1,1,1,1,1);
mn_age(:,1,1,1,1,1) = ar_age;
age_ss = repmat(mn_age, [1, mp_params('n_agrid'), mp_params('n_etagrid'), ...
    mp_params('n_educgrid'), mp_params('n_marriedgrid'), mp_params('n_kidsgrid')]);

1.4 Adjust to Probability Mass Function

Phi_true_1 = Phi_true./sum(Phi_true,'all');

1.5 Age Bounds

% 1 = 18
min_age = 1

min_age = 1

% retirement, 46+18=64, the year prior to retirement year.
max_age = 46;

1.6 Scale Statistics to Thousands of Dollars

a_ss = mp_dsvfi_results('a_ss')*58.056;
ap_ss = mp_dsvfi_results('ap_ss')*58.056;
c_ss = mp_dsvfi_results('cons_ss')*58.056;
n_ss = mp_dsvfi_results('n_ss');
% household head + spousal (realized) income
y_all = mp_dsvfi_results('y_all_ss')*58.056;
y_head_inc = mp_dsvfi_results('y_head_inc_ss')*58.056;
y_spouse_inc = mp_dsvfi_results('y_spouse_inc_ss')*58.056;

yshr_wage = mp_dsvfi_results('yshr_wage_ss');
yshr_SS = mp_dsvfi_results('yshr_SS_ss');
yshr_nttxss = mp_dsvfi_results('yshr_nttxss_ss');

1.7 Distributional Statistics Overall All Ages

% construct input data
marital_grp = marital_ss(min_age:82, :, :, : ,: ,:);
y_all_grp = y_all(min_age:82, :, :, : ,: ,:);
age_ss_grp = age_ss(min_age:82, :, :, : ,: ,:);
educ_ss_grp = educ_ss(min_age:82, :, :, : ,: ,:);
a_ss_grp = a_ss(min_age:82, :, :, : ,: ,:);
ap_ss_grp = ap_ss(min_age:82, :, :, : ,: ,:);
mn_MPC_C_gain_share_check_grp = mn_MPC_C_gain_share_check(min_age:82, :, :, :, :, :);        
Phi_true_grp = Phi_true_1(min_age:82, :, :, : ,: ,:);
c_ss_grp = c_ss(min_age:82, :, :, : ,: ,:);
y_head_inc_grp = y_head_inc(min_age:82, :, :, : ,: ,:);
y_spouse_inc_grp = y_spouse_inc(min_age:82, :, :, : ,: ,:);
yshr_nttxss_grp = yshr_nttxss(min_age:82, :, :, : ,: ,:);    

mp_cl_ar_xyz_of_s = containers.Map('KeyType','char', 'ValueType','any');
mp_cl_ar_xyz_of_s('married') = {marital_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('y_all') = {y_all_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('age_ss') = {age_ss_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('educ_ss') = {educ_ss_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('a_ss') = {a_ss_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('ap_ss') = {ap_ss_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('MPC') = {mn_MPC_C_gain_share_check_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('Mass') = {Phi_true_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('c_ss') = {c_ss_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('y_head_inc') = {y_head_inc_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('y_spouse') = {y_spouse_inc_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('yshr_nttxss') = {yshr_nttxss_grp(:), zeros(1)};

mp_cl_ar_xyz_of_s('ar_st_y_name') = ["married", "y_all", "age_ss", "educ_ss", "a_ss", "ap_ss", "MPC", "Mass", "c_ss", "y_head_inc", "y_spouse", "yshr_nttxss"];

% controls
mp_support = containers.Map('KeyType','char', 'ValueType','any');
mp_support('ar_fl_percentiles') = [0.01 10 25 50 75 90 99.99];
mp_support('bl_display_final') = true;
mp_support('bl_display_detail') = false;    
mp_support('bl_display_drvm2outcomes') = false;  
mp_support('bl_display_drvstats') = false;
mp_support('bl_display_drvm2covcor') = false;

% Call Function     
mp_cl_mt_xyz_of_s = ff_simu_stats(Phi_true_grp(:)/sum(Phi_true_grp,'all'), mp_cl_ar_xyz_of_s, mp_support);

xxx tb_outcomes: all stats xxx
    OriginalVariableNames       married         y_all         age_ss        educ_ss         a_ss           ap_ss           MPC           Mass           c_ss        y_head_inc      y_spouse      yshr_nttxss
    ______________________    ___________    ___________    __________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________

    {'mean'              }        0.47501         84.974        47.129          0.303         245.22         250.91        0.18727     1.9841e-06          61.86          64.16         20.813       0.07592 
    {'unweighted_sum'    }              1     7.9255e+09          4879              1     1.2935e+05     5.0546e+10     1.8485e+06        0.98729     4.8085e+09      1.825e+08     4.5934e+07    4.6085e+06 
    {'sd'                }        0.49938         84.549        19.231        0.45956         391.42         393.58        0.25754     5.3069e-06         40.052         58.021         55.437       0.25553 
    {'coefofvar'         }         1.0513          0.995       0.40805         1.5167         1.5962         1.5686         1.3752         2.6748        0.64747        0.90432         2.6635        3.3658 
    {'gini'              }        0.36718        0.44243       0.23101        0.61588        0.68023        0.68119        0.57786        0.73436        0.33734        0.41705        0.85253        1.3962 
    {'min'               }              0         2.2124            19              0              0              0    -1.6475e-08              0         2.1316         2.2124              0      -0.89184 
    {'max'               }              1         2953.5           100              1         7837.6         9503.9              1     8.3083e-05         4783.3         1414.1         1545.8        0.2552 
    {'pYis0'             }        0.52499              0             0          0.697        0.12285        0.10286              0              0              0              0        0.52499             0 
    {'pYls0'             }              0              0             0              0              0              0     3.9375e-07              0              0              0              0       0.17848 
    {'pYgr0'             }        0.47501              1             1          0.303        0.87715        0.89714              1              1              1              1        0.47501       0.82152 
    {'pYisMINY'          }        0.52499      6.774e-07       0.02184          0.697        0.12285        0.10286      1.328e-09              0      6.774e-07     9.6447e-07        0.52499     0.0057376 
    {'pYisMAXY'          }        0.47501      1.671e-12    0.00020326          0.303     6.0119e-06      1.671e-12     1.1385e-07     8.3095e-05              0     1.2499e-09     1.5274e-10     1.671e-12 
    {'p0_01'             }              0         4.1232            19              0              0              0       0.033841     4.2956e-11         3.8982         3.9133              0      -0.89184 
    {'p10'               }              0         20.726            23              0              0              0       0.045323     6.3589e-08         20.964         18.221              0      -0.31517 
    {'p25'               }              0         33.631            31              0          6.458          10.46       0.051343     2.0079e-07         32.759         27.413              0        0.1279 
    {'p50'               }              0         59.948            45              0          82.04         92.227       0.067566     5.9135e-07         53.386         46.475              0       0.17765 
    {'p75'               }              1         106.28            62              1         318.35          331.8        0.16151     1.6521e-06         80.905         80.156         20.852       0.20517 
    {'p90'               }              1         176.61            75              1         729.18         702.23        0.57603     4.3211e-06         112.31         129.77         51.289       0.22234 
    {'p99_99'            }              1         1217.5           100              1         5250.6         5140.2              1     8.2932e-05         434.37         784.55         1033.9       0.25146 
    {'fl_cov_married'    }        0.24938         12.618    2.9987e-13       0.026842         31.201          31.93      -0.016733    -5.1035e-07         8.8909         1.6909         10.927      0.022689 
    {'fl_cor_married'    }              1        0.29884    3.1225e-14        0.11697        0.15962        0.16246       -0.13011       -0.19258        0.44452       0.058359         0.3947        0.1778 
    {'fl_cov_y_all'      }         12.618         7148.6       -105.85         6.7259          15059          17886        -6.6507    -7.3196e-05         2566.3         3720.9         3427.7         7.935 
    {'fl_cor_y_all'      }        0.29884              1     -0.065099         0.1731        0.45504        0.53751       -0.30544       -0.16313        0.75784        0.75849        0.73129       0.36727 
    {'fl_cov_age_ss'     }     2.9987e-13        -105.85        369.84     5.7371e-13           2902         2762.7        -1.2778     -2.691e-05         57.161        -73.542        -32.308       -3.2573 
    {'fl_cor_age_ss'     }     3.1225e-14      -0.065099             1     6.4916e-14        0.38553        0.36501         -0.258       -0.26368       0.074211      -0.065909      -0.030304      -0.66283 
    {'fl_cov_educ_ss'    }       0.026842         6.7259    5.7371e-13        0.21119          20.13         20.615      0.0049583    -2.0525e-07         4.6211         4.2898          2.436     0.0058708 
    {'fl_cor_educ_ss'    }        0.11697         0.1731    6.4916e-14              1        0.11191        0.11398       0.041894      -0.084158        0.25106        0.16088       0.095619      0.049993 
    {'fl_cov_a_ss'       }         31.201          15059          2902          20.13     1.5321e+05     1.5316e+05        -30.154    -0.00031586          11440          12903         2155.8        5.0323 
    {'fl_cor_a_ss'       }        0.15962        0.45504       0.38553        0.11191              1        0.99423       -0.29913       -0.15206        0.72974        0.56816        0.09935      0.050313 
    {'fl_cov_ap_ss'      }          31.93          17886        2762.7         20.615     1.5316e+05      1.549e+05        -31.209    -0.00032246          11782          13834         4052.1        8.0835 
    {'fl_cor_ap_ss'      }        0.16246        0.53751       0.36501        0.11398        0.99423              1        -0.3079       -0.15438        0.74742        0.60582        0.18572      0.080376 
    {'fl_cov_MPC'        }      -0.016733        -6.6507       -1.2778      0.0049583        -30.154        -31.209       0.066325     2.7047e-07        -4.0418        -4.6636        -1.9872    -0.0065946 
    {'fl_cor_MPC'        }       -0.13011       -0.30544        -0.258       0.041894       -0.29913        -0.3079              1        0.19789       -0.39185        -0.3121       -0.13919      -0.10021 
    {'fl_cov_Mass'       }    -5.1035e-07    -7.3196e-05    -2.691e-05    -2.0525e-07    -0.00031586    -0.00032246     2.7047e-07     2.8163e-11    -4.9115e-05    -4.3013e-05    -3.0183e-05    7.7154e-08 
    {'fl_cor_Mass'       }       -0.19258       -0.16313      -0.26368      -0.084158       -0.15206       -0.15438        0.19789              1       -0.23107       -0.13969       -0.10259      0.056894 
    {'fl_cov_c_ss'       }         8.8909         2566.3        57.161         4.6211          11440          11782        -4.0418    -4.9115e-05         1604.2         1885.7         680.64        3.0309 
    {'fl_cor_c_ss'       }        0.44452        0.75784      0.074211        0.25106        0.72974        0.74742       -0.39185       -0.23107              1        0.81145        0.30654       0.29615 
    {'fl_cov_y_head_inc' }         1.6909         3720.9       -73.542         4.2898          12903          13834        -4.6636    -4.3013e-05         1885.7         3366.5         354.41        5.4427 
    {'fl_cor_y_head_inc' }       0.058359        0.75849     -0.065909        0.16088        0.56816        0.60582        -0.3121       -0.13969        0.81145              1        0.11018        0.3671 
    {'fl_cov_y_spouse'   }         10.927         3427.7       -32.308          2.436         2155.8         4052.1        -1.9872    -3.0183e-05         680.64         354.41         3073.3        2.4923 
    {'fl_cor_y_spouse'   }         0.3947        0.73129     -0.030304       0.095619        0.09935        0.18572       -0.13919       -0.10259        0.30654        0.11018              1       0.17593 
    {'fl_cov_yshr_nttxss'}       0.022689          7.935       -3.2573      0.0058708         5.0323         8.0835     -0.0065946     7.7154e-08         3.0309         5.4427         2.4923      0.065297 
    {'fl_cor_yshr_nttxss'}         0.1778        0.36727      -0.66283       0.049993       0.050313       0.080376       -0.10021       0.056894        0.29615         0.3671        0.17593             1 
    {'fracByP0_01'       }              0      4.224e-06     0.0088049              0              0              0     1.5972e-05     1.1023e-09      5.507e-06     5.3478e-06              0       -0.0674 
    {'fracByP10'         }              0       0.018881      0.047593              0              0              0       0.022413      0.0014454       0.025367       0.023791              0      -0.79756 
    {'fracByP25'         }              0       0.066793       0.14054              0      0.0014119      0.0020335       0.061188       0.011146       0.090697       0.076105              0      -0.87606 
    {'fracByP50'         }              0        0.20209       0.34194              0       0.045325       0.046345        0.13867       0.058051         0.2636        0.21928              0      -0.35735 
    {'fracByP75'         }              1        0.43774       0.62344              1        0.24517         0.2372        0.27182        0.18642        0.53083        0.45651        0.10567       0.27424 
    {'fracByP90'         }              1         0.6766       0.82958              1        0.56651        0.52814        0.52971        0.38349        0.75976         0.6919        0.32852       0.69602 
    {'fracByP99_99'      }              1        0.99841             1              1        0.99808         0.9976        0.99953        0.99652        0.99922        0.99858        0.99467       0.99967 

tb_dist_stats_all = mp_cl_mt_xyz_of_s('tb_outcomes');

1.8 Distributional Statistics Overall 18 to 64

Statistics overall distributionally for 18 to 64 year olds.

% construct input data
marital_grp = marital_ss(min_age:max_age, :, :, : ,: ,:);
y_all_grp = y_all(min_age:max_age, :, :, : ,: ,:);
age_ss_grp = age_ss(min_age:max_age, :, :, : ,: ,:);
educ_ss_grp = educ_ss(min_age:max_age, :, :, : ,: ,:);
a_ss_grp = a_ss(min_age:max_age, :, :, : ,: ,:);
ap_ss_grp = ap_ss(min_age:max_age, :, :, : ,: ,:);
mn_MPC_C_gain_share_check_grp = mn_MPC_C_gain_share_check(min_age:max_age, :, :, :, :, :);        
Phi_true_grp = Phi_true_1(min_age:max_age, :, :, : ,: ,:);
c_ss_grp = c_ss(min_age:max_age, :, :, : ,: ,:);
y_head_inc_grp = y_head_inc(min_age:max_age, :, :, : ,: ,:);
y_spouse_inc_grp = y_spouse_inc(min_age:max_age, :, :, : ,: ,:);
yshr_nttxss_grp = yshr_nttxss(min_age:max_age, :, :, : ,: ,:);    

mp_cl_ar_xyz_of_s = containers.Map('KeyType','char', 'ValueType','any');
mp_cl_ar_xyz_of_s('married') = {marital_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('y_all') = {y_all_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('age_ss') = {age_ss_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('educ_ss') = {educ_ss_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('a_ss') = {a_ss_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('ap_ss') = {ap_ss_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('MPC') = {mn_MPC_C_gain_share_check_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('Mass') = {Phi_true_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('c_ss') = {c_ss_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('y_head_inc') = {y_head_inc_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('y_spouse') = {y_spouse_inc_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('yshr_nttxss') = {yshr_nttxss_grp(:), zeros(1)};

mp_cl_ar_xyz_of_s('ar_st_y_name') = ["married", "y_all", "age_ss", "educ_ss", "a_ss", "ap_ss", "MPC", "Mass", "c_ss", "y_head_inc", "y_spouse", "yshr_nttxss"];

% controls
mp_support = containers.Map('KeyType','char', 'ValueType','any');
mp_support('ar_fl_percentiles') = [0.01 10 25 50 75 90 99.99];
mp_support('bl_display_final') = true;
mp_support('bl_display_detail') = false;    
mp_support('bl_display_drvm2outcomes') = false;  
mp_support('bl_display_drvstats') = false;
mp_support('bl_display_drvm2covcor') = false;

% Call Function     
mp_cl_mt_xyz_of_s = ff_simu_stats(Phi_true_grp(:)/sum(Phi_true_grp,'all'), mp_cl_ar_xyz_of_s, mp_support);

xxx tb_outcomes: all stats xxx
    OriginalVariableNames       married         y_all         age_ss         educ_ss         a_ss           ap_ss           MPC           Mass           c_ss        y_head_inc      y_spouse      yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________

    {'mean'              }        0.47501         95.246         39.372          0.303          194.5         207.36        0.19755     2.2834e-06         62.557         71.987         23.259         0.1848
    {'unweighted_sum'    }              1     7.7487e+09           1909              1     1.2935e+05     4.9246e+10     1.5381e+06        0.77586     4.6649e+09     1.7831e+08     4.5048e+07     4.5174e+06
    {'sd'                }        0.49938         89.631         13.105        0.45956          344.5         357.54        0.27121     5.9287e-06         40.074         61.313         60.215       0.033404
    {'coefofvar'         }         1.0513        0.94104        0.33285         1.5167         1.7712         1.7243         1.3729         2.5964        0.64059        0.85172         2.5889        0.18076
    {'gini'              }        0.36718        0.42428        0.18859        0.61588        0.71579        0.71299        0.59507        0.74699        0.33442        0.40072        0.84805        0.10153
    {'min'               }              0         2.2124             19              0              0              0    -1.6475e-08              0         2.1316         2.2124              0       0.036506
    {'max'               }              1         2953.5             64              1         7837.6         9503.9              1     8.3083e-05         747.91         1414.1         1545.8         0.2552
    {'pYis0'             }        0.52499              0              0          0.697        0.14627        0.11928              0              0              0              0        0.52499              0
    {'pYls0'             }              0              0              0              0              0              0     5.0068e-07              0              0              0              0              0
    {'pYgr0'             }        0.47501              1              1          0.303        0.85373        0.88072              1              1              1              1        0.47501              1
    {'pYisMINY'          }        0.52499     8.6135e-07       0.027771          0.697        0.14627        0.11928     1.6886e-09              0     8.6135e-07     1.2264e-06        0.52499     8.6135e-07
    {'pYisMAXY'          }        0.47501     2.1248e-12       0.015675          0.303     5.4766e-06     2.1248e-12     1.4477e-07     0.00010566     1.7809e-13     1.5894e-09     1.9421e-10     2.1248e-12
    {'p0_01'             }              0         3.9581             19              0              0              0       0.033696     5.9414e-11         3.7473         3.7605              0        0.05326
    {'p10'               }              0         25.069             22              0              0              0       0.044281     6.5349e-08         21.594         21.048              0        0.13816
    {'p25'               }              0         40.654             28              0         3.7372         5.3737       0.049271     1.9828e-07         33.413         32.928              0         0.1635
    {'p50'               }              0          69.57             38              0         51.664         62.312       0.058636     6.0075e-07         54.147         54.534              0        0.18909
    {'p75'               }              1         119.76             50              1         239.18         253.34         0.1883     1.8451e-06         81.817         90.424         24.257        0.21046
    {'p90'               }              1          192.9             58              1         588.48         599.34         0.6567      5.117e-06          113.1         142.11          65.94        0.22493
    {'p99_99'            }              1         1249.3             64              1         4707.8         4953.6              1     8.3083e-05         434.57         811.39         1056.8        0.25162
    {'fl_cov_married'    }        0.24938         13.756      2.335e-13       0.026842          25.27         26.783      -0.017248    -6.2681e-07         8.9405         1.5449         12.211      0.0064334
    {'fl_cor_married'    }              1        0.30733     3.5679e-14        0.11697        0.14689        0.15001       -0.12735       -0.21171        0.44676       0.050457        0.40608        0.38567
    {'fl_cov_y_all'      }         13.756         8033.6         270.03         7.5617          17852          20993        -8.3845    -0.00010581         2911.4         4083.5         3950.1         2.2345
    {'fl_cor_y_all'      }        0.30733              1        0.22988        0.18358        0.57814        0.65507       -0.34491       -0.19912        0.81058        0.74307         0.7319        0.74633
    {'fl_cov_age_ss'     }      2.335e-13         270.03         171.75     4.3386e-15         2241.5         2328.9        -1.4685    -2.2759e-05          117.7         215.29         54.733        0.12412
    {'fl_cor_age_ss'     }     3.5679e-14        0.22988              1      7.204e-16        0.49648        0.49704       -0.41317       -0.29292        0.22412        0.26794       0.069359        0.28352
    {'fl_cov_educ_ss'    }       0.026842         7.5617     4.3386e-15        0.21119         15.478         16.562      0.0073384    -2.2235e-07         4.6429         4.8213         2.7405      0.0029398
    {'fl_cor_educ_ss'    }        0.11697        0.18358      7.204e-16              1       0.097766         0.1008       0.058877      -0.081609        0.25211        0.17111       0.099033         0.1915
    {'fl_cov_a_ss'       }          25.27          17852         2241.5         15.478     1.1868e+05     1.2238e+05        -27.859    -0.00031658         9782.9          15132         2719.5         5.7039
    {'fl_cor_a_ss'       }        0.14689        0.57814        0.49648       0.097766              1        0.99355       -0.29817         -0.155        0.70862        0.71641         0.1311        0.49565
    {'fl_cov_ap_ss'      }         26.783          20993         2328.9         16.562     1.2238e+05     1.2783e+05        -29.823    -0.00033582          10380          16080         4912.7         6.3243
    {'fl_cor_ap_ss'      }        0.15001        0.65507        0.49704         0.1008        0.99355              1       -0.30755       -0.15843        0.72447        0.73352        0.22819        0.52953
    {'fl_cov_MPC'        }      -0.017248        -8.3845        -1.4685      0.0073384        -27.859        -29.823       0.073557     3.3344e-07        -4.4514        -5.9094         -2.475     -0.0053199
    {'fl_cor_MPC'        }       -0.12735       -0.34491       -0.41317       0.058877       -0.29817       -0.30755              1        0.20737       -0.40957       -0.35537       -0.15155       -0.58721
    {'fl_cov_Mass'       }    -6.2681e-07    -0.00010581    -2.2759e-05    -2.2235e-07    -0.00031658    -0.00033582     3.3344e-07      3.515e-11    -6.1339e-05    -6.5126e-05    -4.0682e-05    -5.3846e-08
    {'fl_cor_Mass'       }       -0.21171       -0.19912       -0.29292      -0.081609         -0.155       -0.15843        0.20737              1       -0.25818       -0.17916       -0.11396       -0.27189
    {'fl_cov_c_ss'       }         8.9405         2911.4          117.7         4.6429         9782.9          10380        -4.4514    -6.1339e-05         1605.9         2138.9         772.55         1.0798
    {'fl_cor_c_ss'       }        0.44676        0.81058        0.22412        0.25211        0.70862        0.72447       -0.40957       -0.25818              1        0.87053        0.32016        0.80668
    {'fl_cov_y_head_inc' }         1.5449         4083.5         215.29         4.8213          15132          16080        -5.9094    -6.5126e-05         2138.9         3759.2         324.28         1.4119
    {'fl_cor_y_head_inc' }       0.050457        0.74307        0.26794        0.17111        0.71641        0.73352       -0.35537       -0.17916        0.87053              1       0.087835        0.68937
    {'fl_cov_y_spouse'   }         12.211         3950.1         54.733         2.7405         2719.5         4912.7         -2.475    -4.0682e-05         772.55         324.28         3625.8        0.82264
    {'fl_cor_y_spouse'   }        0.40608         0.7319       0.069359       0.099033         0.1311        0.22819       -0.15155       -0.11396        0.32016       0.087835              1        0.40898
    {'fl_cov_yshr_nttxss'}      0.0064334         2.2345        0.12412      0.0029398         5.7039         6.3243     -0.0053199    -5.3846e-08         1.0798         1.4119        0.82264      0.0011158
    {'fl_cor_yshr_nttxss'}        0.38567        0.74633        0.28352         0.1915        0.49565        0.52953       -0.58721       -0.27189        0.80668        0.68937        0.40898              1
    {'fracByP0_01'       }              0     3.6432e-06       0.013402              0              0              0     1.4581e-05      1.359e-09     5.2664e-06     4.5561e-06              0     2.6489e-05
    {'fracByP10'         }              0       0.018969       0.056893              0              0              0       0.020856      0.0013157       0.025532       0.021607              0        0.06427
    {'fracByP25'         }              0       0.070975        0.15748              0      0.0011356      0.0011893        0.05647      0.0097236       0.091767       0.078214              0        0.18782
    {'fracByP50'         }              0        0.21374        0.35932              0       0.034043       0.035591         0.1241       0.050408         0.2655        0.22841              0        0.42744
    {'fracByP75'         }              1        0.45357        0.64274              1        0.21343        0.20217        0.24718        0.17054        0.53312        0.47247        0.11516        0.69769
    {'fracByP90'         }              1        0.69054        0.84608              1        0.51495        0.48843        0.53985        0.37506        0.76159        0.70537        0.33181        0.87418
    {'fracByP99_99'      }              1        0.99855              1              1        0.99716        0.99719         0.9995              1        0.99923         0.9987        0.99515        0.99986

tb_dist_stats_all_18to64 = mp_cl_mt_xyz_of_s('tb_outcomes');

1.9 Distributional Statistics By Kids Count

Various statistics, including MPC (of the first check) by Children Count

it_row_ctr = 0;
for it_ctr=1:mp_params('n_kidsgrid')
    display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
    display(['kids =' num2str(ar_kids(it_ctr))]);
    display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
    
    % construct input data
    marital_grp = marital_ss(min_age:max_age, :, :, : ,: ,it_ctr);
    y_all_grp = y_all(min_age:max_age, :, :, : ,: ,it_ctr);
    age_ss_grp = age_ss(min_age:max_age, :, :, : ,: ,it_ctr);
    educ_ss_grp = educ_ss(min_age:max_age, :, :, : ,: ,it_ctr);
    a_ss_grp = a_ss(min_age:max_age, :, :, : ,: ,it_ctr);
    ap_ss_grp = ap_ss(min_age:max_age, :, :, : ,: ,it_ctr);
    mn_MPC_C_gain_share_check_grp = mn_MPC_C_gain_share_check(min_age:max_age, :, :, :, :, it_ctr);        
    Phi_true_grp = Phi_true_1(min_age:max_age, :, :, : ,: ,it_ctr);
    c_ss_grp = c_ss(min_age:max_age, :, :, : ,: ,it_ctr);
    y_head_inc_grp = y_head_inc(min_age:max_age, :, :, : ,: ,it_ctr);
    y_spouse_inc_grp = y_spouse_inc(min_age:max_age, :, :, : ,: ,it_ctr);
    yshr_nttxss_grp = yshr_nttxss(min_age:max_age, :, :, : ,: ,it_ctr);    
    
    mp_cl_ar_xyz_of_s = containers.Map('KeyType','char', 'ValueType','any');
    mp_cl_ar_xyz_of_s('married') = {marital_grp(:), zeros(1)};
    mp_cl_ar_xyz_of_s('y_all') = {y_all_grp(:), zeros(1)};
    mp_cl_ar_xyz_of_s('age_ss') = {age_ss_grp(:), zeros(1)};
    mp_cl_ar_xyz_of_s('educ_ss') = {educ_ss_grp(:), zeros(1)};
    mp_cl_ar_xyz_of_s('a_ss') = {a_ss_grp(:), zeros(1)};
    mp_cl_ar_xyz_of_s('ap_ss') = {ap_ss_grp(:), zeros(1)};
    mp_cl_ar_xyz_of_s('MPC') = {mn_MPC_C_gain_share_check_grp(:), zeros(1)};
    mp_cl_ar_xyz_of_s('Mass') = {Phi_true_grp(:), zeros(1)};
    mp_cl_ar_xyz_of_s('c_ss') = {c_ss_grp(:), zeros(1)};
    mp_cl_ar_xyz_of_s('y_head_inc') = {y_head_inc_grp(:), zeros(1)};
    mp_cl_ar_xyz_of_s('y_spouse') = {y_spouse_inc_grp(:), zeros(1)};
    mp_cl_ar_xyz_of_s('yshr_nttxss') = {yshr_nttxss_grp(:), zeros(1)};
    
    mp_cl_ar_xyz_of_s('ar_st_y_name') = ["married", "y_all", "age_ss", "educ_ss", "a_ss", "ap_ss", "MPC", "Mass", "c_ss", "y_head_inc", "y_spouse", "yshr_nttxss"];
    
    % controls
    mp_support = containers.Map('KeyType','char', 'ValueType','any');
    mp_support('ar_fl_percentiles') = [0.01 10 25 50 75 90 99.99];
    mp_support('bl_display_final') = true;
    mp_support('bl_display_detail') = false;    
    mp_support('bl_display_drvm2outcomes') = false;  
    mp_support('bl_display_drvstats') = false;
    mp_support('bl_display_drvm2covcor') = false;

    % Call Function     
    mp_cl_mt_xyz_of_s = ff_simu_stats(Phi_true_grp(:)/sum(Phi_true_grp,'all'), mp_cl_ar_xyz_of_s, mp_support);

    it_kids = ar_kids(it_ctr);
    
    tb_dist_stats = mp_cl_mt_xyz_of_s('tb_outcomes');
    
    fl_married_mean = tb_dist_stats{"married", "mean"};
    
    fl_age_mean = tb_dist_stats{"age_ss", "mean"};
    fl_age_p50 = tb_dist_stats{"age_ss", "p50"};
    
    fl_educ_mean = tb_dist_stats{"educ_ss", "mean"};
    
    fl_a_mean = tb_dist_stats{"a_ss", "mean"};
    fl_a_p50 = tb_dist_stats{"a_ss", "p50"};
    
    fl_ap_mean = tb_dist_stats{"ap_ss", "mean"};
    fl_ap_p50 = tb_dist_stats{"ap_ss", "p50"};
    
    fl_y_all_mean = tb_dist_stats{"y_all", "mean"};
    fl_y_all_p50 = tb_dist_stats{"y_all", "p50"};
    
    fl_mpc_mean = tb_dist_stats{"MPC", "mean"};
    fl_mpc_p50 = tb_dist_stats{"MPC", "p50"};
    
    fl_mass = tb_dist_stats{"Mass", "unweighted_sum"};
    
    fl_c_ss_mean = tb_dist_stats{"c_ss", "mean"};
    fl_c_ss_p50 = tb_dist_stats{"c_ss", "p50"};
    
    fl_y_head_inc_mean = tb_dist_stats{"y_head_inc", "mean"};
    fl_y_spouse_mean = tb_dist_stats{"y_spouse", "mean"};
                            
    ar_store_stats = [it_kids, fl_married_mean, ...
        fl_age_mean, fl_age_p50, fl_educ_mean, ...
        fl_a_mean, fl_a_p50, fl_ap_mean, fl_ap_p50, ...
        fl_y_all_mean, fl_y_all_p50, ...
        fl_mpc_mean, fl_mpc_p50, ...
        fl_mass, ...
        fl_c_ss_mean, fl_c_ss_p50, ...
        fl_y_head_inc_mean, fl_y_spouse_mean];
    
    it_row_ctr = it_row_ctr + 1;
    
    if (it_row_ctr>1)
        mt_store_stats_by_k = [mt_store_stats_by_k;ar_store_stats];
    else
        mt_store_stats_by_k = [ar_store_stats];
    end    
end

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
kids =0
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames       married         y_all         age_ss        educ_ss         a_ss           ap_ss           MPC           Mass           c_ss        y_head_inc      y_spouse      yshr_nttxss
    ______________________    ___________    ___________    ___________    __________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________

    {'mean'              }        0.34092         95.696          42.81       0.29837         267.84         285.19        0.13383     3.4909e-06         58.369         75.398         20.298       0.18397 
    {'unweighted_sum'    }              1     1.9045e+09           1909             1     1.2935e+05     1.0082e+10     2.6258e+05        0.37329     8.6163e+08     1.7831e+08     1.2273e+07    1.0341e+06 
    {'sd'                }        0.47402         93.188          14.55       0.45754         413.66         428.33        0.21405     7.9829e-06         39.409          64.38         61.976      0.034475 
    {'coefofvar'         }         1.3904        0.97379        0.33987        1.5335         1.5444         1.5019         1.5995         2.2868        0.67517        0.85387         3.0533       0.18739 
    {'gini'              }        0.56028        0.43559        0.18997       0.62263        0.66933        0.66565        0.56774         0.7175         0.3481        0.40435        0.90039       0.10542 
    {'min'               }              0         2.2124             19             0              0              0    -1.6475e-08              0         2.1316         2.2124              0      0.036506 
    {'max'               }              1         2953.5             64             1         7837.6         9503.9              1     8.3083e-05         535.22         1414.1         1545.8        0.2552 
    {'pYis0'             }        0.65908              0              0       0.70163        0.10437       0.066435              0              0              0              0        0.65908             0 
    {'pYls0'             }              0              0              0             0              0              0     9.6539e-07              0              0              0              0             0 
    {'pYgr0'             }        0.34092              1              1       0.29837        0.89563        0.93356              1              1              1              1        0.34092             1 
    {'pYisMINY'          }        0.65908     1.2783e-06       0.038791       0.70163        0.10437       0.066435     3.5069e-09              0     1.2783e-06     1.6608e-06        0.65908    1.2783e-06 
    {'pYisMAXY'          }        0.34092     4.4127e-12       0.029551       0.29837     1.0023e-05     4.4127e-12     1.6609e-05     0.00021943      1.854e-11     2.5408e-09     4.0334e-10    4.4127e-12 
    {'p0_01'             }              0         3.8399             19             0              0              0       0.033232     1.4043e-10         3.6392         3.6862              0      0.052258 
    {'p10'               }              0          23.75             21             0              0        0.66421         0.0419     1.2838e-07         19.988         21.412              0       0.13528 
    {'p25'               }              0         39.249             29             0         10.255         14.184       0.046157     3.9694e-07          29.91         34.104              0       0.16171 
    {'p50'               }              0         68.775             45             0         100.91         114.52       0.052728     1.1569e-06         48.681         57.134              0       0.18859 
    {'p75'               }              1         119.82             56             1         363.77         384.75       0.068748     3.0347e-06         76.619         95.271         18.379       0.21048 
    {'p90'               }              1         198.36             61             1         729.18          796.6        0.39144     6.9985e-06         108.41          149.7         41.653       0.22566 
    {'p99_99'            }              1         1317.3             64             1         5250.6         5453.7              1     8.3083e-05         430.12         837.19         1115.9       0.25193 
    {'fl_cov_married'    }        0.22469         15.781        0.41952      0.027901         47.935           50.8     -0.0040817    -6.3926e-07         9.1002         2.4027         13.378     0.0065704 
    {'fl_cor_married'    }              1        0.35725       0.060827       0.12864        0.24447        0.25021      -0.040228       -0.16893        0.48715       0.078733        0.45539       0.40207 
    {'fl_cov_y_all'      }         15.781           8684         314.15        6.9889          24515          28037        -5.3961    -0.00016151         3017.9         4493.9         4190.1        2.3727 
    {'fl_cor_y_all'      }        0.35725              1        0.23169       0.16391        0.63596        0.70243       -0.27052        -0.2171        0.82178        0.74906        0.72551       0.73855 
    {'fl_cov_age_ss'     }        0.41952         314.15          211.7      -0.40705         2895.3         2996.5        -1.3578    -4.6365e-05         137.75         256.65         57.502       0.15463 
    {'fl_cor_age_ss'     }       0.060827        0.23169              1     -0.061144        0.48104        0.48082       -0.43598       -0.39918        0.24023        0.27398       0.063767       0.30827 
    {'fl_cov_educ_ss'    }       0.027901         6.9889       -0.40705       0.20934         17.081         18.304       0.016362     -2.596e-07         4.0645          4.356         2.6329     0.0025679 
    {'fl_cor_educ_ss'    }        0.12864        0.16391      -0.061144             1       0.090246       0.093396        0.16707      -0.071073        0.22541        0.14788       0.092849        0.1628 
    {'fl_cov_a_ss'       }         47.935          24515         2895.3        17.081     1.7111e+05     1.7633e+05        -22.104    -0.00069632          13300          20579           3936        8.1118 
    {'fl_cor_a_ss'       }        0.24447        0.63596        0.48104      0.090246              1         0.9952       -0.24964       -0.21087        0.81588        0.77274        0.15353       0.56882 
    {'fl_cov_ap_ss'      }           50.8          28037         2996.5        18.304     1.7633e+05     1.8346e+05        -23.578    -0.00073734          14030          21776         6261.5        8.8272 
    {'fl_cor_ap_ss'      }        0.25021        0.70243        0.48082      0.093396         0.9952              1       -0.25716       -0.21564        0.83116        0.78968        0.23588       0.59779 
    {'fl_cov_MPC'        }     -0.0040817        -5.3961        -1.3578      0.016362        -22.104        -23.578       0.045818     4.4146e-07         -2.668        -4.1548        -1.2413    -0.0038689 
    {'fl_cor_MPC'        }      -0.040228       -0.27052       -0.43598       0.16707       -0.24964       -0.25716              1        0.25835       -0.31627       -0.30149      -0.093572      -0.52428 
    {'fl_cov_Mass'       }    -6.3926e-07    -0.00016151    -4.6365e-05    -2.596e-07    -0.00069632    -0.00073734     4.4146e-07     6.3727e-11    -8.1842e-05    -0.00010691    -5.4596e-05    -7.808e-08 
    {'fl_cor_Mass'       }       -0.16893        -0.2171       -0.39918     -0.071073       -0.21087       -0.21564        0.25835              1       -0.26015       -0.20802       -0.11035      -0.28371 
    {'fl_cov_c_ss'       }         9.1002         3017.9         137.75        4.0645          13300          14030         -2.668    -8.1842e-05         1553.1         2200.1         817.82          1.09 
    {'fl_cor_c_ss'       }        0.48715        0.82178        0.24023       0.22541        0.81588        0.83116       -0.31627       -0.26015              1        0.86716        0.33484       0.80232 
    {'fl_cov_y_head_inc' }         2.4027         4493.9         256.65         4.356          20579          21776        -4.1548    -0.00010691         2200.1         4144.8         349.14        1.5662 
    {'fl_cor_y_head_inc' }       0.078733        0.74906        0.27398       0.14788        0.77274        0.78968       -0.30149       -0.20802        0.86716              1       0.087503       0.70567 
    {'fl_cov_y_spouse'   }         13.378         4190.1         57.502        2.6329           3936         6261.5        -1.2413    -5.4596e-05         817.82         349.14           3841       0.80647 
    {'fl_cor_y_spouse'   }        0.45539        0.72551       0.063767      0.092849        0.15353        0.23588      -0.093572       -0.11035        0.33484       0.087503              1       0.37746 
    {'fl_cov_yshr_nttxss'}      0.0065704         2.3727        0.15463     0.0025679         8.1118         8.8272     -0.0038689     -7.808e-08           1.09         1.5662        0.80647     0.0011885 
    {'fl_cor_yshr_nttxss'}        0.40207        0.73855        0.30827        0.1628        0.56882        0.59779       -0.52428       -0.28371        0.80232        0.70567        0.37746             1 
    {'fracByP0_01'       }              0     3.5026e-06       0.017216             0              0              0     1.8817e-05     2.1229e-09     5.4622e-06     4.2765e-06              0    2.6011e-05 
    {'fracByP10'         }              0       0.017915       0.047317             0              0     2.9992e-05       0.029361      0.0017347       0.025679       0.020749              0      0.063096 
    {'fracByP25'         }              0       0.067497        0.14043             0       0.002351      0.0026933       0.078865       0.012749       0.090082       0.076086              0       0.18534 
    {'fracByP50'         }              0        0.20658        0.35779             0       0.050647       0.051049        0.17101       0.064779        0.25614        0.22533              0       0.42456 
    {'fracByP75'         }              1        0.44409        0.66951             1        0.26381        0.25241        0.27932        0.19845        0.51976        0.47046       0.035042       0.69573 
    {'fracByP90'         }              1         0.6831        0.86922             1        0.54208        0.54513        0.45718        0.39501        0.75188        0.70499        0.26144       0.87329 
    {'fracByP99_99'      }              1        0.99848              1             1        0.99785        0.99777        0.99929              1        0.99919        0.99873         0.9942       0.99986 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
kids =1
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames       married         y_all         age_ss         educ_ss         a_ss          ap_ss           MPC           Mass           c_ss        y_head_inc      y_spouse      yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    __________    ___________    ___________    ___________    ___________    ___________    ___________

    {'mean'              }        0.48303         94.687          37.46        0.31392         163.05        174.75        0.21261     1.2899e-06         63.271         69.861         24.826        0.18414
    {'unweighted_sum'    }              1     1.7814e+09           1909              1     1.2935e+05    9.9369e+09      2.911e+05        0.12532     9.1596e+08     1.7831e+08     1.0379e+07     1.0298e+06
    {'sd'                }        0.49971         90.675         12.413        0.46408         298.89         310.3        0.27827     2.7284e-06         40.266          59.82         62.596       0.033796
    {'coefofvar'         }         1.0345        0.95763        0.33137         1.4784         1.8331        1.7757         1.3088         2.1152         0.6364        0.85627         2.5214        0.18354
    {'gini'              }        0.35621        0.42949        0.18779        0.59992        0.72885       0.72411        0.58952        0.73415         0.3326         0.4014        0.84148        0.10326
    {'min'               }              0         2.2124             19              0              0             0    -1.0027e-08              0         2.1316         2.2124              0       0.036506
    {'max'               }              1         2715.2             64              1         7837.6          9272              1      2.588e-05         605.17         1414.1         1307.3        0.25496
    {'pYis0'             }        0.51697              0              0        0.68608        0.16638       0.13409              0              0              0              0        0.51697              0
    {'pYls0'             }              0              0              0              0              0             0      1.703e-07              0              0              0              0              0
    {'pYgr0'             }        0.48303              1              1        0.31392        0.83362       0.86591              1              1              1              1        0.48303              1
    {'pYisMINY'          }        0.51697     8.7082e-07       0.032554        0.68608        0.16638       0.13409     7.9246e-14              0     8.7082e-07     1.4559e-06        0.51697     8.7082e-07
    {'pYisMAXY'          }        0.48303     2.5175e-12      0.0061116        0.31392     2.7005e-06    2.5175e-12     1.5411e-05      0.0002036     5.7503e-10     1.3312e-09      8.704e-10     2.5175e-12
    {'p0_01'             }              0         3.9202             19              0              0             0       0.037205     4.8031e-11         3.7126         3.6143              0        0.05294
    {'p10'               }              0         24.541             21              0              0             0       0.046179     4.5329e-08         21.754         20.523              0        0.13703
    {'p25'               }              0         39.852             26              0         1.9135        3.0553       0.050232     1.2689e-07         34.122         31.947              0        0.16248
    {'p50'               }              0         68.409             37              0         39.794        49.861       0.060158     3.3767e-07         55.106         52.818              0        0.18835
    {'p75'               }              1         118.73             47              1         205.07        209.06        0.23507     1.0397e-06         82.697         87.519         27.094        0.21016
    {'p90'               }              1         193.79             55              1         467.15        512.18        0.73236     3.4806e-06         113.77         137.85         73.411        0.22505
    {'p99_99'            }              1         1212.2             64              1         4203.9          4443              1      2.588e-05         439.18         798.98         983.74        0.25144
    {'fl_cov_married'    }        0.24971         14.899        0.69339       0.029149           35.5        38.015      -0.029849    -1.9886e-07         8.8069          2.065         12.834      0.0069685
    {'fl_cor_married'    }              1        0.32882        0.11178        0.12569        0.23769       0.24516       -0.21465       -0.14586        0.43769       0.069081         0.4103        0.41262
    {'fl_cov_y_all'      }         14.899         8221.9          296.2         7.6969          15691         18932        -9.6826    -6.1897e-05         2953.1           3941         4280.8         2.2798
    {'fl_cor_y_all'      }        0.32882              1        0.26316        0.18291        0.57898       0.67285       -0.38374       -0.25019        0.80882        0.72657        0.75422        0.74395
    {'fl_cov_age_ss'     }        0.69339          296.2         154.09        0.15644         1774.9        1842.5        -1.3781    -1.3655e-05         157.35         206.32         89.888        0.13506
    {'fl_cor_age_ss'     }        0.11178        0.26316              1       0.027156        0.47838       0.47835       -0.39896       -0.40317        0.31481        0.27785        0.11568        0.32195
    {'fl_cov_educ_ss'    }       0.029149         7.6969        0.15644        0.21537         16.186        17.321      0.0095259    -1.6868e-07         4.6956         4.8059          2.891      0.0030572
    {'fl_cor_educ_ss'    }        0.12569        0.18291       0.027156              1        0.11669       0.12028       0.073764       -0.13322        0.25128        0.17312       0.099519        0.19492
    {'fl_cov_a_ss'       }           35.5          15691         1774.9         16.186          89333         91902        -25.746    -0.00018023         9278.1          12771         2920.6         5.0207
    {'fl_cor_a_ss'       }        0.23769        0.57898        0.47838        0.11669              1        0.9909       -0.30956       -0.22101        0.77093        0.71427         0.1561        0.49704
    {'fl_cov_ap_ss'      }         38.015          18932         1842.5         17.321          91902         96289        -27.675      -0.000192         9891.8          13612         5320.2         5.6443
    {'fl_cor_ap_ss'      }        0.24516        0.67285        0.47835        0.12028         0.9909             1       -0.32051       -0.22678        0.79169        0.73329         0.2739        0.53821
    {'fl_cov_MPC'        }      -0.029849        -9.6826        -1.3781      0.0095259        -25.746       -27.675       0.077434     3.2131e-07        -5.4889        -6.5548        -3.1278     -0.0064355
    {'fl_cor_MPC'        }       -0.21465       -0.38374       -0.39896       0.073764       -0.30956      -0.32051              1         0.4232       -0.48988       -0.39378       -0.17957        -0.6843
    {'fl_cov_Mass'       }    -1.9886e-07    -6.1897e-05    -1.3655e-05    -1.6868e-07    -0.00018023     -0.000192     3.2131e-07     7.4442e-12    -3.5387e-05    -3.9609e-05    -2.2287e-05    -3.2084e-08
    {'fl_cor_Mass'       }       -0.14586       -0.25019       -0.40317       -0.13322       -0.22101      -0.22678         0.4232              1       -0.32211       -0.24268        -0.1305       -0.34795
    {'fl_cov_c_ss'       }         8.8069         2953.1         157.35         4.6956         9278.1        9891.8        -5.4889    -3.5387e-05         1621.3         2138.3         814.73         1.1112
    {'fl_cor_c_ss'       }        0.43769        0.80882        0.31481        0.25128        0.77093       0.79169       -0.48988       -0.32211              1        0.88776        0.32325        0.81657
    {'fl_cov_y_head_inc' }          2.065           3941         206.32         4.8059          12771         13612        -6.5548    -3.9609e-05         2138.3         3578.4         362.63         1.3789
    {'fl_cor_y_head_inc' }       0.069081        0.72657        0.27785        0.17312        0.71427       0.73329       -0.39378       -0.24268        0.88776              1       0.096844        0.68206
    {'fl_cov_y_spouse'   }         12.834         4280.8         89.888          2.891         2920.6        5320.2        -3.1278    -2.2287e-05         814.73         362.63         3918.2         0.9009
    {'fl_cor_y_spouse'   }         0.4103        0.75422        0.11568       0.099519         0.1561        0.2739       -0.17957        -0.1305        0.32325       0.096844              1        0.42586
    {'fl_cov_yshr_nttxss'}      0.0069685         2.2798        0.13506      0.0030572         5.0207        5.6443     -0.0064355    -3.2084e-08         1.1112         1.3789         0.9009      0.0011422
    {'fl_cor_yshr_nttxss'}        0.41262        0.74395        0.32195        0.19492        0.49704       0.53821        -0.6843       -0.34795        0.81657        0.68206        0.42586              1
    {'fracByP0_01'       }              0     3.7241e-06       0.016512              0              0             0     1.5782e-05     1.9578e-09      5.295e-06     4.5746e-06              0     2.7113e-05
    {'fracByP10'         }              0       0.018692       0.055462              0              0             0       0.020542      0.0016288       0.025039       0.021682              0       0.063941
    {'fracByP25'         }              0       0.069801         0.1535              0     0.00069906    0.00081116       0.054629       0.011565        0.09175       0.078309              0        0.18693
    {'fracByP50'         }              0        0.21065        0.37529              0       0.028068      0.030359        0.11835       0.054133        0.26687        0.22821              0        0.42614
    {'fracByP75'         }              1         0.4485         0.6393              1        0.21188       0.19187        0.25159        0.16805        0.53524        0.47164        0.12533        0.69657
    {'fracByP90'         }              1        0.68715        0.85347              1        0.47478       0.47724        0.56836        0.39061        0.76294        0.70432        0.33785         0.8737
    {'fracByP99_99'      }              1        0.99858              1              1        0.99686       0.99698        0.99958              1        0.99922        0.99868        0.99586        0.99986

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
kids =2
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames       married         y_all         age_ss         educ_ss         a_ss          ap_ss           MPC           Mass           c_ss        y_head_inc      y_spouse     yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    __________    ___________    ___________    ___________    ___________    ___________    __________    ___________

    {'mean'              }        0.58436         95.419         35.807        0.30789        124.28         132.94        0.26809     1.4865e-06         66.903         68.481        26.939        0.18557
    {'unweighted_sum'    }              1     1.6966e+09           1909              1    1.2935e+05     9.8386e+09     3.1368e+05         0.1465     9.5131e+08     1.7831e+08    9.0751e+06     1.0264e+06
    {'sd'                }        0.49283         87.576         10.518        0.46162        238.29         247.97        0.31733      2.889e-06         40.589         57.867        60.459       0.032573
    {'coefofvar'         }        0.84337        0.91781        0.29375         1.4993        1.9174         1.8652         1.1837         1.9434        0.60668        0.84501        2.2443        0.17553
    {'gini'              }        0.22818        0.41656        0.16465        0.60873       0.73697        0.73747        0.57414        0.71541        0.31937        0.39555       0.79163       0.098545
    {'min'               }              0         2.2124             19              0             0              0    -6.4775e-09              0         2.1316         2.2124             0       0.036506
    {'max'               }              1         2551.1             64              1        7837.6         9108.8              1     1.8645e-05         668.01         1414.1          1143        0.25477
    {'pYis0'             }        0.41564              0              0        0.69211        0.1963        0.18544              0              0              0              0       0.41564              0
    {'pYls0'             }              0              0              0              0             0              0     3.9508e-08              0              0              0             0              0
    {'pYgr0'             }        0.58436              1              1        0.30789        0.8037        0.81456              1              1              1              1       0.58436              1
    {'pYisMINY'          }        0.41564     4.0938e-07       0.014906        0.69211        0.1963        0.18544     5.0791e-09              0     4.0938e-07     7.3728e-07       0.41564     4.0938e-07
    {'pYisMAXY'          }        0.58436     1.0736e-12      0.0019534        0.30789    9.1954e-07     1.0736e-12      6.047e-06      0.0001257     1.6286e-10     6.3635e-10    1.2765e-09     1.0736e-12
    {'p0_01'             }              0         4.1232             19              0             0              0       0.038832     5.6452e-11         3.8979         3.7835             0       0.054635
    {'p10'               }              0         26.204             23              0             0              0       0.048381     5.7916e-08         23.629         20.802             0        0.14052
    {'p25'               }              0         41.871             27              0       0.80724         1.6539       0.053831     1.7068e-07         37.828         31.979             0        0.16499
    {'p50'               }              1         70.257             35              0        29.898         39.175       0.086584     4.5359e-07         59.542          52.03        5.5483        0.18953
    {'p75'               }              1         120.84             43              1        146.89         150.28        0.40869     1.2205e-06         86.752         85.442        26.677        0.21077
    {'p90'               }              1         190.32             51              1        363.77         387.37        0.95534     4.1339e-06         117.64         133.93        94.623        0.22458
    {'p99_99'            }              1         1122.5             64              1        3737.2         3800.9              1     1.8645e-05         439.88         779.65        876.64        0.25094
    {'fl_cov_married'    }        0.24288         12.863        0.51579       0.025827        25.491         27.147      -0.055633    -4.6541e-07         8.1321         1.6658        11.197      0.0064177
    {'fl_cor_married'    }              1        0.29802       0.099501        0.11352       0.21706        0.22214       -0.35573       -0.32688        0.40653       0.058412       0.37578        0.39977
    {'fl_cov_y_all'      }         12.863         7669.6         228.36         8.3133         11413          14327        -12.184    -7.3755e-05         2864.5         3681.5        3988.2         2.1485
    {'fl_cor_y_all'      }        0.29802              1         0.2479        0.20564       0.54689        0.65975       -0.43842       -0.29151        0.80585        0.72644       0.75322        0.75315
    {'fl_cov_age_ss'     }        0.51579         228.36         110.63        0.45675        1116.6         1160.8        -1.1929    -9.0248e-06         129.17         154.09        74.272        0.10113
    {'fl_cor_age_ss'     }       0.099501         0.2479              1       0.094068       0.44549        0.44505        -0.3574       -0.29699        0.30257        0.25315       0.11679        0.29517
    {'fl_cov_educ_ss'    }       0.025827         8.3133        0.45675        0.21309        15.009         16.023     -0.0029873    -2.4395e-07         5.2868         5.3399        2.9734      0.0033688
    {'fl_cor_educ_ss'    }        0.11352        0.20564       0.094068              1       0.13644        0.13997      -0.020393       -0.18292        0.28216         0.1999       0.10654        0.22404
    {'fl_cov_a_ss'       }         25.491          11413         1116.6         15.009         56783          58304        -25.836     -0.0001563         7092.7         9372.8        2040.1         3.5399
    {'fl_cor_a_ss'       }        0.21706        0.54689        0.44549        0.13644             1         0.9867       -0.34167       -0.22704        0.73333        0.67972        0.1416        0.45606
    {'fl_cov_ap_ss'      }         27.147          14327         1160.8         16.023         58304          61490        -27.838    -0.00016809         7613.6          10048        4279.2         4.0928
    {'fl_cor_ap_ss'      }        0.22214        0.65975        0.44505        0.13997        0.9867              1       -0.35377       -0.23464        0.75645        0.70025       0.28543        0.50671
    {'fl_cov_MPC'        }      -0.055633        -12.184        -1.1929     -0.0029873       -25.836        -27.838         0.1007     5.5672e-07        -7.3153        -7.6835       -4.5004     -0.0074736
    {'fl_cor_MPC'        }       -0.35573       -0.43842        -0.3574      -0.020393      -0.34167       -0.35377              1        0.60726       -0.56795       -0.41842      -0.23458       -0.72303
    {'fl_cov_Mass'       }    -4.6541e-07    -7.3755e-05    -9.0248e-06    -2.4395e-07    -0.0001563    -0.00016809     5.5672e-07     8.3463e-12    -4.4472e-05    -4.3895e-05    -2.986e-05    -4.0326e-08
    {'fl_cor_Mass'       }       -0.32688       -0.29151       -0.29699       -0.18292      -0.22704       -0.23464        0.60726              1       -0.37926       -0.26257      -0.17096       -0.42853
    {'fl_cov_c_ss'       }         8.1321         2864.5         129.17         5.2868        7092.7         7613.6        -7.3153    -4.4472e-05         1647.4         2107.3        757.19         1.0816
    {'fl_cor_c_ss'       }        0.40653        0.80585        0.30257        0.28216       0.73333        0.75645       -0.56795       -0.37926              1        0.89719       0.30856        0.81808
    {'fl_cov_y_head_inc' }         1.6658         3681.5         154.09         5.3399        9372.8          10048        -7.6835    -4.3895e-05         2107.3         3348.6        332.87         1.2671
    {'fl_cor_y_head_inc' }       0.058412        0.72644        0.25315         0.1999       0.67972        0.70025       -0.41842       -0.26257        0.89719              1      0.095144        0.67225
    {'fl_cov_y_spouse'   }         11.197         3988.2         74.272         2.9734        2040.1         4279.2        -4.5004     -2.986e-05         757.19         332.87        3655.3        0.88132
    {'fl_cor_y_spouse'   }        0.37578        0.75322        0.11679        0.10654        0.1416        0.28543       -0.23458       -0.17096        0.30856       0.095144             1        0.44752
    {'fl_cov_yshr_nttxss'}      0.0064177         2.1485        0.10113      0.0033688        3.5399         4.0928     -0.0074736    -4.0326e-08         1.0816         1.2671       0.88132       0.001061
    {'fl_cor_yshr_nttxss'}        0.39977        0.75315        0.29517        0.22404       0.45606        0.50671       -0.72303       -0.42853        0.81808        0.67225       0.44752              1
    {'fracByP0_01'       }              0     3.7828e-06      0.0079094              0             0              0     1.3781e-05     1.9892e-09     5.1103e-06     4.8539e-06             0     2.7068e-05
    {'fracByP10'         }              0       0.019866       0.075143              0             0              0       0.016997      0.0017777       0.025599       0.022515             0       0.065413
    {'fracByP25'         }              0       0.073594        0.17417              0    0.00024523     0.00032928       0.045629       0.013183        0.09503       0.080596             0        0.18987
    {'fracByP50'         }              1        0.21851        0.40471              0      0.027182       0.029001        0.10433        0.06311        0.27655        0.23237      0.012439        0.42959
    {'fracByP75'         }              1         0.4596        0.65078              1       0.20572         0.1836        0.28603        0.18859         0.5463        0.47595       0.17667         0.6991
    {'fracByP90'         }              1        0.69638        0.85987              1       0.47333        0.45943        0.63045         0.4029         0.7706        0.70706       0.40287        0.87492
    {'fracByP99_99'      }              1        0.99869              1              1       0.99695        0.99655        0.99964              1        0.99926        0.99868       0.99662        0.99986

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
kids =3
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames       married         y_all         age_ss         educ_ss         a_ss           ap_ss           MPC           Mass           c_ss        y_head_inc      y_spouse      yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________

    {'mean'              }        0.69032         96.012         35.356        0.30365          101.3         108.26        0.28224     7.8011e-07         69.095         68.194         27.819        0.18709
    {'unweighted_sum'    }              1     1.6091e+09           1909              1     1.2935e+05     9.7565e+09     3.2876e+05       0.079163     9.6836e+08     1.7831e+08     7.7289e+06     1.0223e+06
    {'sd'                }        0.46236          83.53         9.1314        0.45983         196.58         204.96        0.31193     1.4843e-06         40.156          56.96         56.054       0.031157
    {'coefofvar'         }        0.66978        0.86999        0.25827         1.5143         1.9407         1.8933         1.1052         1.9027        0.58117        0.83526          2.015        0.16653
    {'gini'              }        0.12198        0.40117        0.14344        0.61493         0.7291        0.73174        0.54945        0.68776        0.30596        0.39099        0.73451       0.093298
    {'min'               }              0         2.2124             19              0              0              0    -8.0852e-09              0         2.1316         2.2124              0       0.036506
    {'max'               }              1         2381.6             64              1         7837.6         8950.9              1     9.9682e-06         714.44         1414.1         973.47        0.25455
    {'pYis0'             }        0.30968              0              0        0.69635        0.19175        0.18156              0              0              0              0        0.30968              0
    {'pYls0'             }              0              0              0              0              0              0     8.2958e-09              0              0              0              0              0
    {'pYgr0'             }        0.69032              1              1        0.30365        0.80825        0.81844              1              1              1              1        0.69032              1
    {'pYisMINY'          }        0.30968      2.133e-07       0.007718        0.69635        0.19175        0.18156     9.9695e-15              0      2.133e-07     3.9358e-07        0.30968      2.133e-07
    {'pYisMAXY'          }        0.69032     3.4711e-13     0.00070368        0.30365     3.1947e-07     3.4711e-13     1.3131e-06     0.00012445     2.8676e-11      2.506e-10     1.7067e-09     3.4711e-13
    {'p0_01'             }              0         4.4187             19              0              0              0       0.040653     3.0816e-11         4.1667         3.9496              0       0.057025
    {'p10'               }              0         28.136             24              0              0              0       0.050129     3.4991e-08         26.115         21.124              0        0.14431
    {'p25'               }              0         44.054             28              0        0.80724         1.9135       0.057657     1.0876e-07         40.886         32.382              0        0.16755
    {'p50'               }              1         72.443             34              0         29.898         33.491        0.12541     2.8867e-07         61.963         52.134         13.426        0.19086
    {'p75'               }              1         122.12             42              1         100.91          119.1        0.42749     7.0957e-07         88.579         84.839         24.894        0.21113
    {'p90'               }              1          185.9             48              1         276.88          306.3        0.97187     1.7707e-06         119.14         132.44          94.59        0.22395
    {'p99_99'            }              1         1027.1             64              1         3306.5         3355.1              1     9.9682e-06         437.82         770.05         755.82        0.25033
    {'fl_cov_married'    }        0.21378         9.9452        0.39867        0.02286         16.463         17.437      -0.061242    -2.6557e-07         6.6057         1.3302         8.6149      0.0052966
    {'fl_cor_married'    }              1        0.25751       0.094427        0.10752        0.18113          0.184       -0.42463       -0.38696        0.35578        0.05051         0.3324        0.36767
    {'fl_cov_y_all'      }         9.9452         6977.2         176.66         8.4101         8663.4          11197         -11.95    -3.5455e-05         2725.3         3539.8         3437.4         1.9936
    {'fl_cor_y_all'      }        0.25751              1        0.23161        0.21896         0.5276        0.65402       -0.45863       -0.28596        0.81251          0.744        0.73415        0.76604
    {'fl_cov_age_ss'     }        0.39867         176.66         83.382        0.55101          713.9         743.03       -0.93092    -3.3149e-06            105         118.35         58.307       0.078236
    {'fl_cor_age_ss'     }       0.094427        0.23161              1        0.13123         0.3977          0.397       -0.32683       -0.24457        0.28636        0.22755        0.11391        0.27499
    {'fl_cov_educ_ss'    }        0.02286         8.4101        0.55101        0.21145         12.958         13.851     -0.0093462    -1.3715e-07         5.4818          5.592         2.8181      0.0034153
    {'fl_cor_educ_ss'    }        0.10752        0.21896        0.13123              1        0.14334        0.14696      -0.065159       -0.20093        0.29687         0.2135        0.10933        0.23838
    {'fl_cov_a_ss'       }         16.463         8663.4          713.9         12.958          38644          39601        -21.838    -6.3012e-05         5577.8         7371.5         1291.9         2.5823
    {'fl_cor_a_ss'       }        0.18113         0.5276         0.3977        0.14334              1        0.98286       -0.35613       -0.21595         0.7066        0.65833        0.11724        0.42161
    {'fl_cov_ap_ss'      }         17.437          11197         743.03         13.851          39601          42010        -23.617    -6.8528e-05         6028.1         7956.3         3240.9         3.0807
    {'fl_cor_ap_ss'      }          0.184        0.65402          0.397        0.14696        0.98286              1       -0.36939       -0.22525        0.73241        0.68151        0.28209        0.48242
    {'fl_cov_MPC'        }      -0.061242         -11.95       -0.93092     -0.0093462        -21.838        -23.617       0.097301     2.8634e-07        -7.3453          -7.31        -4.6398     -0.0068587
    {'fl_cor_MPC'        }       -0.42463       -0.45863       -0.32683      -0.065159       -0.35613       -0.36939              1        0.61844       -0.58641       -0.41142       -0.26536       -0.70572
    {'fl_cov_Mass'       }    -2.6557e-07    -3.5455e-05    -3.3149e-06    -1.3715e-07    -6.3012e-05    -6.8528e-05     2.8634e-07     2.2032e-12    -2.1502e-05    -2.0705e-05    -1.4749e-05    -1.8427e-08
    {'fl_cor_Mass'       }       -0.38696       -0.28596       -0.24457       -0.20093       -0.21595       -0.22525        0.61844              1       -0.36075        -0.2449       -0.17727       -0.39845
    {'fl_cov_c_ss'       }         6.6057         2725.3            105         5.4818         5577.8         6028.1        -7.3453    -2.1502e-05         1612.5         2089.9         635.41          1.018
    {'fl_cor_c_ss'       }        0.35578        0.81251        0.28636        0.29687         0.7066        0.73241       -0.58641       -0.36075              1        0.91372        0.28229        0.81369
    {'fl_cov_y_head_inc' }         1.3302         3539.8         118.35          5.592         7371.5         7956.3          -7.31    -2.0705e-05         2089.9         3244.4         295.41         1.1909
    {'fl_cor_y_head_inc' }        0.05051          0.744        0.22755         0.2135        0.65833        0.68151       -0.41142        -0.2449        0.91372              1       0.092523        0.67107
    {'fl_cov_y_spouse'   }         8.6149         3437.4         58.307         2.8181         1291.9         3240.9        -4.6398    -1.4749e-05         635.41         295.41           3142         0.8027
    {'fl_cor_y_spouse'   }         0.3324        0.73415        0.11391        0.10933        0.11724        0.28209       -0.26536       -0.17727        0.28229       0.092523              1        0.45962
    {'fl_cov_yshr_nttxss'}      0.0052966         1.9936       0.078236      0.0034153         2.5823         3.0807     -0.0068587    -1.8427e-08          1.018         1.1909         0.8027     0.00097074
    {'fl_cor_yshr_nttxss'}        0.36767        0.76604        0.27499        0.23838        0.42161        0.48242       -0.70572       -0.39845        0.81369        0.67107        0.45962              1
    {'fracByP0_01'       }              0     4.0037e-06      0.0041476              0              0              0     1.4008e-05     2.0625e-09     5.2343e-06     5.1027e-06              0      2.797e-05
    {'fracByP10'         }              0       0.021316       0.072166              0              0              0       0.016711      0.0020213       0.027306       0.023122              0       0.066974
    {'fracByP25'         }              0       0.078153        0.18337              0     0.00031224     0.00051709        0.04527        0.01563        0.10079       0.082258              0        0.19318
    {'fracByP50'         }              1        0.22773        0.39789              0       0.038052       0.034485        0.11583       0.076657        0.28673        0.23551       0.038194        0.43334
    {'fracByP75'         }              1        0.47322        0.69228              1        0.18766        0.19112        0.32287        0.22309        0.55536        0.47942        0.21771        0.70198
    {'fracByP90'         }              1         0.7065           0.86              1        0.45944        0.45862          0.647        0.43067        0.77615        0.70944        0.46583         0.8762
    {'fracByP99_99'      }              1         0.9988              1              1        0.99675        0.99624        0.99977              1        0.99928        0.99869        0.99718        0.99987

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
kids =4
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames       married         y_all         age_ss         educ_ss         a_ss           ap_ss           MPC           Mass           c_ss        y_head_inc      y_spouse     yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    __________    ___________

    {'mean'              }        0.78724         91.676         35.383        0.29511         81.617         85.611        0.29276     5.1432e-07         68.821         68.205        23.472        0.18674
    {'unweighted_sum'    }              1     1.4702e+09           1909              1     1.2935e+05     9.6506e+09     3.4265e+05       0.051587     9.7082e+08     1.7831e+08    5.5918e+06     1.0144e+06
    {'sd'                }        0.40926         74.133         7.9178        0.45609          164.3          170.7        0.29591     8.0629e-07         39.197         56.505        43.258        0.02972
    {'coefofvar'         }        0.51987        0.80864        0.22378         1.5455         2.0131         1.9939         1.0108         1.5677        0.56954        0.82846         1.843        0.15915
    {'gini'              }       0.054374        0.38168        0.12297        0.62738        0.72749        0.73583         0.5153        0.63607        0.29793        0.38794       0.68012       0.089215
    {'min'               }              0         2.2124             19              0              0              0    -8.2688e-09              0         2.1316         2.2124             0       0.036506
    {'max'               }              1         2113.2             64              1         7837.6         8726.8              1     5.6518e-06         747.91         1414.1         704.3        0.25413
    {'pYis0'             }        0.21276              0              0        0.70489        0.18917        0.18302              0              0              0              0       0.21276              0
    {'pYls0'             }              0              0              0              0              0              0     1.0358e-10              0              0              0             0              0
    {'pYgr0'             }        0.78724              1              1        0.29511        0.81083        0.81698              1              1              1              1       0.78724              1
    {'pYisMINY'          }        0.21276     9.2536e-08      0.0035072        0.70489        0.18917        0.18302     3.5142e-16              0     9.2536e-08     1.8357e-07       0.21276     9.2536e-08
    {'pYisMAXY'          }        0.78724     2.0254e-13     0.00027556        0.29511     1.1672e-07     7.7513e-14     1.6608e-07     0.00010833     2.6842e-12     7.8158e-11    2.0775e-09     2.0254e-13
    {'p0_01'             }              0         4.7807             19              0              0              0       0.042402     2.0422e-11         4.5075         4.1088             0       0.059838
    {'p10'               }              0          29.13             26              0              0              0       0.051938     2.6614e-08         28.036         21.475             0        0.14615
    {'p25'               }              1          44.24             29              0        0.80724          1.854       0.065352     8.4594e-08         41.599         32.656        2.5325        0.16776
    {'p50'               }              1           71.8             35              0         29.898         29.435        0.16918     2.3036e-07         61.162         52.422        13.321        0.19047
    {'p75'               }              1         115.49             41              1          82.04         87.298        0.43637     5.6686e-07         87.293         84.772        19.544        0.20919
    {'p90'               }              1         172.56             46              1         239.18         238.99        0.83194     1.2804e-06         117.89         131.88        73.247         0.2219
    {'p99_99'            }              1         888.01             64              1         2910.1         3021.1              1     5.6518e-06         431.99         764.52        552.49        0.24922
    {'fl_cov_married'    }        0.16749         5.9174        0.25239       0.018555         8.6206         8.7102       -0.04739    -1.0116e-07         4.4325        0.92362        4.9938      0.0035289
    {'fl_cor_married'    }              1        0.19504       0.077888       0.099404         0.1282        0.12468       -0.39132       -0.30657        0.27632        0.03994       0.28208        0.29013
    {'fl_cov_y_all'      }         5.9174         5495.7         126.24         7.9495         6630.3         8295.7        -10.199    -1.7179e-05         2483.7         3408.6        2087.1         1.7418
    {'fl_cor_y_all'      }        0.19504              1        0.21507        0.23511        0.54435        0.65556       -0.46494       -0.28741        0.85476        0.81373       0.65082        0.79058
    {'fl_cov_age_ss'     }        0.25239         126.24         62.692        0.61699          463.7         479.98       -0.82379    -1.6822e-06         79.686         90.849        35.394       0.059073
    {'fl_cor_age_ss'     }       0.077888        0.21507              1        0.17085        0.35644        0.35513        -0.3516       -0.26349        0.25676        0.20306       0.10334        0.25104
    {'fl_cov_educ_ss'    }       0.018555         7.9495        0.61699        0.20802         10.809         11.425      -0.011367    -8.6576e-08          5.416         5.7717        2.1778      0.0033945
    {'fl_cor_educ_ss'    }       0.099404        0.23511        0.17085              1        0.14424        0.14675      -0.084227       -0.23543        0.30296        0.22396       0.11038        0.25043
    {'fl_cov_a_ss'       }         8.6206         6630.3          463.7         10.809          26996          27613        -17.743    -3.0647e-05         4382.5         5998.5        631.84         1.9291
    {'fl_cor_a_ss'       }         0.1282        0.54435        0.35644        0.14424              1        0.98455       -0.36495       -0.23134         0.6805        0.64611      0.088899        0.39506
    {'fl_cov_ap_ss'      }         8.7102         8295.7         479.98         11.425          27613          29138        -18.962    -3.3262e-05           4727         6501.5        1794.1         2.3048
    {'fl_cor_ap_ss'      }        0.12468        0.65556        0.35513        0.14675        0.98455              1       -0.37541       -0.24167         0.7065        0.67406       0.24298        0.45431
    {'fl_cov_MPC'        }       -0.04739        -10.199       -0.82379      -0.011367        -17.743        -18.962       0.087562     1.3517e-07        -6.5632        -6.6653       -3.5339     -0.0056438
    {'fl_cor_MPC'        }       -0.39132       -0.46494        -0.3516      -0.084227       -0.36495       -0.37541              1        0.56654       -0.56586       -0.39863      -0.27608       -0.64175
    {'fl_cov_Mass'       }    -1.0116e-07    -1.7179e-05    -1.6822e-06    -8.6576e-08    -3.0647e-05    -3.3262e-05     1.3517e-07      6.501e-13    -1.0438e-05    -1.1049e-05     -6.13e-06    -7.6801e-09
    {'fl_cor_Mass'       }       -0.30657       -0.28741       -0.26349       -0.23543       -0.23134       -0.24167        0.56654              1       -0.33028       -0.24252      -0.17575        -0.3205
    {'fl_cov_c_ss'       }         4.4325         2483.7         79.686          5.416         4382.5           4727        -6.5632    -1.0438e-05         1536.4         2073.6        410.14        0.95059
    {'fl_cor_c_ss'       }        0.27632        0.85476        0.25676        0.30296         0.6805         0.7065       -0.56586       -0.33028              1        0.93624       0.24189        0.81603
    {'fl_cov_y_head_inc' }        0.92362         3408.6         90.849         5.7717         5998.5         6501.5        -6.6653    -1.1049e-05         2073.6         3192.8        215.82         1.1685
    {'fl_cor_y_head_inc' }        0.03994        0.81373        0.20306        0.22396        0.64611        0.67406       -0.39863       -0.24252        0.93624              1      0.088297        0.69583
    {'fl_cov_y_spouse'   }         4.9938         2087.1         35.394         2.1778         631.84         1794.1        -3.5339      -6.13e-06         410.14         215.82        1871.3        0.57329
    {'fl_cor_y_spouse'   }        0.28208        0.65082        0.10334        0.11038       0.088899        0.24298       -0.27608       -0.17575        0.24189       0.088297             1        0.44593
    {'fl_cov_yshr_nttxss'}      0.0035289         1.7418       0.059073      0.0033945         1.9291         2.3048     -0.0056438    -7.6801e-09        0.95059         1.1685       0.57329     0.00088325
    {'fl_cor_yshr_nttxss'}        0.29013        0.79058        0.25104        0.25043        0.39506        0.45431       -0.64175        -0.3205        0.81603        0.69583       0.44593              1
    {'fracByP0_01'       }              0     4.5191e-06      0.0018833              0              0              0     1.4214e-05     2.0593e-09     5.6494e-06     5.2884e-06             0     2.9363e-05
    {'fracByP10'         }              0       0.023539        0.08684              0              0              0       0.016649      0.0023097        0.02996       0.023523             0        0.06868
    {'fracByP25'         }              1       0.083914        0.18322              0     0.00038004     0.00052367       0.046086       0.018178        0.10663        0.08333     0.0027991        0.19569
    {'fracByP50'         }              1        0.24018        0.44948              0       0.059094       0.038166        0.13978        0.09109        0.29288        0.23757      0.075376        0.43629
    {'fracByP75'         }              1        0.48959        0.71178              1        0.20094        0.18709        0.36221        0.27127        0.55859        0.48178       0.24734        0.70399
    {'fracByP90'         }              1        0.71753        0.86506              1        0.48753        0.44498        0.66588        0.51892        0.77749        0.71114       0.51359        0.87683
    {'fracByP99_99'      }              1         0.9989              1              1        0.99603        0.99569        0.99968              1        0.99929         0.9987       0.99756        0.99987

1.10 Distributional Statistics By Marital Status and Kids Count

Various statistics, including MPC (of the first check) by Marital Status and Kids COunt

it_row_ctr = 0;
for it_marry_ctr=1:mp_params('n_marriedgrid')
    
    display(['']);
    display(['']);
    display(['-------------------------------']);
    display(['-------------------------------']);
    display(['-------------------------------']);
    display(['-------------------------------']);
    display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
    display(['Marital =' num2str(ar_marital(it_marry_ctr))]);
    display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
    display(['-------------------------------']);
    display(['-------------------------------']);
    
    for it_kids_ctr=1:mp_params('n_kidsgrid')
        display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
        display(['Marital =' num2str(ar_marital(it_marry_ctr)) ' and kids =' num2str(ar_kids(it_kids_ctr))]);
        display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
        
        % construct input data
        y_all_grp = y_all(min_age:max_age, :, :, : ,it_marry_ctr ,it_ctr);
        age_ss_grp = age_ss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        educ_ss_grp = educ_ss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        a_ss_grp = a_ss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        ap_ss_grp = ap_ss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        mn_MPC_C_gain_share_check_grp = mn_MPC_C_gain_share_check(min_age:max_age, :, :, :, it_marry_ctr, it_kids_ctr);
        Phi_true_grp = Phi_true_1(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        c_ss_grp = c_ss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        y_head_inc_grp = y_head_inc(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        y_spouse_inc_grp = y_spouse_inc(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        yshr_nttxss_grp = yshr_nttxss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        
        mp_cl_ar_xyz_of_s = containers.Map('KeyType','char', 'ValueType','any');
        mp_cl_ar_xyz_of_s('y_all') = {y_all_grp(:), zeros(1)};
        mp_cl_ar_xyz_of_s('age_ss') = {age_ss_grp(:), zeros(1)};
        mp_cl_ar_xyz_of_s('educ_ss') = {educ_ss_grp(:), zeros(1)};
        mp_cl_ar_xyz_of_s('a_ss') = {a_ss_grp(:), zeros(1)};
        mp_cl_ar_xyz_of_s('ap_ss') = {ap_ss_grp(:), zeros(1)};
        mp_cl_ar_xyz_of_s('MPC') = {mn_MPC_C_gain_share_check_grp(:), zeros(1)};
        mp_cl_ar_xyz_of_s('Mass') = {Phi_true_grp(:), zeros(1)};
        mp_cl_ar_xyz_of_s('c_ss') = {c_ss_grp(:), zeros(1)};
        mp_cl_ar_xyz_of_s('y_head_inc') = {y_head_inc_grp(:), zeros(1)};
        mp_cl_ar_xyz_of_s('y_spouse') = {y_spouse_inc_grp(:), zeros(1)};
        mp_cl_ar_xyz_of_s('yshr_nttxss') = {yshr_nttxss_grp(:), zeros(1)};
        
        mp_cl_ar_xyz_of_s('ar_st_y_name') = ["y_all", "age_ss", "educ_ss", "a_ss", "ap_ss", "MPC", "Mass", "c_ss", "y_head_inc", "y_spouse", "yshr_nttxss"];
        
        % controls
        mp_support = containers.Map('KeyType','char', 'ValueType','any');
        mp_support('ar_fl_percentiles') = [0.01 10 25 50 75 90 99.99];
        mp_support('bl_display_final') = true;
        mp_support('bl_display_detail') = false;
        mp_support('bl_display_drvm2outcomes') = false;
        mp_support('bl_display_drvstats') = false;
        mp_support('bl_display_drvm2covcor') = false;
        
        % Call Function
        mp_cl_mt_xyz_of_s = ff_simu_stats(Phi_true_grp(:)/sum(Phi_true_grp,'all'), mp_cl_ar_xyz_of_s, mp_support);
            
        it_marital = ar_marital(it_marry_ctr);
        it_kids = ar_kids(it_kids_ctr);
        
        tb_dist_stats = mp_cl_mt_xyz_of_s('tb_outcomes');
        fl_age_mean = tb_dist_stats{"age_ss", "mean"};
        fl_age_p50 = tb_dist_stats{"age_ss", "p50"};
        
        fl_educ_mean = tb_dist_stats{"educ_ss", "mean"};
        
        fl_a_mean = tb_dist_stats{"a_ss", "mean"};
        fl_a_p50 = tb_dist_stats{"a_ss", "p50"};
        
        fl_ap_mean = tb_dist_stats{"ap_ss", "mean"};
        fl_ap_p50 = tb_dist_stats{"ap_ss", "p50"};
        
        fl_y_all_mean = tb_dist_stats{"y_all", "mean"};
        fl_y_all_p50 = tb_dist_stats{"y_all", "p50"};
        
        fl_mpc_mean = tb_dist_stats{"MPC", "mean"};
        fl_mpc_p50 = tb_dist_stats{"MPC", "p50"};
        
        fl_mass = tb_dist_stats{"Mass", "unweighted_sum"};
        
        fl_c_ss_mean = tb_dist_stats{"c_ss", "mean"};
        fl_c_ss_p50 = tb_dist_stats{"c_ss", "p50"};
        
        fl_y_head_inc_mean = tb_dist_stats{"y_head_inc", "mean"};
        fl_y_spouse_mean = tb_dist_stats{"y_spouse", "mean"};
                                
        ar_store_stats = [it_marital, it_kids, ...
            fl_age_mean, fl_age_p50, fl_educ_mean, ...
            fl_a_mean, fl_a_p50, fl_ap_mean, fl_ap_p50, ...
            fl_y_all_mean, fl_y_all_p50, ...
            fl_mpc_mean, fl_mpc_p50, ...
            fl_mass, ...
            fl_c_ss_mean, fl_c_ss_p50, ...
            fl_y_head_inc_mean, fl_y_spouse_mean];
        
        it_row_ctr = it_row_ctr + 1;
        
        if (it_row_ctr>1)
            mt_store_stats_by_mk = [mt_store_stats_by_mk;ar_store_stats];
        else
            mt_store_stats_by_mk = [ar_store_stats];
        end
    end
end

  0x0 empty char array

  0x0 empty char array

-------------------------------
-------------------------------
-------------------------------
-------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-------------------------------
-------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0 and kids =0
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames        y_all         age_ss         educ_ss         a_ss           ap_ss           MPC           Mass           c_ss        y_head_inc     y_spouse    yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ________    ___________

    {'mean'              }         71.752         42.174        0.25604         195.11         208.11        0.14002     4.4609e-06         44.562         71.752        0             0.174
    {'unweighted_sum'    }     1.7831e+08           1909              1     1.2935e+05     1.6068e+09          44908        0.24597     1.1691e+08     1.7831e+08        0        1.5239e+05
    {'sd'                }         62.288         14.196        0.43644         339.77         352.46        0.23811     9.1222e-06         30.619         62.288        0          0.034189
    {'coefofvar'         }         0.8681        0.33661         1.7046         1.7414         1.6936         1.7005         2.0449        0.68711         0.8681      NaN           0.19649
    {'gini'              }        0.40852         0.1892        0.68372         0.7026        0.69895        0.58852        0.67475        0.33388        0.40852      NaN           0.11126
    {'min'               }         2.2124             19              0              0              0    -1.6475e-08              0         2.1316         2.2124        0          0.036506
    {'max'               }         1414.1             64              1         7837.6         8386.2              1     8.3083e-05         509.49         1414.1        0           0.25232
    {'pYis0'             }              0              0        0.74396        0.11911       0.081859              0              0              0              0        1                 0
    {'pYls0'             }              0              0              0              0              0     4.5509e-07              0              0              0        0                 0
    {'pYgr0'             }              1              1        0.25604        0.88089        0.91814              1              1              1              1        0                 1
    {'pYisMINY'          }     1.9394e-06       0.036566        0.74396        0.11911       0.081859     5.3209e-09              0     1.9394e-06     1.9394e-06        1        1.9394e-06
    {'pYisMAXY'          }     1.1947e-09       0.024953        0.25604     5.4117e-06     5.9148e-10       2.52e-05     0.00033294     2.1161e-09     1.1947e-09        1        1.1947e-09
    {'p0_01'             }         3.6063             19              0              0              0       0.033823     2.2776e-10         3.4221         3.6063        0          0.050229
    {'p10'               }         20.129             22              0              0        0.20085       0.041649     2.4701e-07         17.373         20.129        0           0.12646
    {'p25'               }         31.931             29              0         3.7372         6.5636       0.045737     7.0183e-07          24.84         31.931        0           0.15099
    {'p50'               }          53.79             44              0         65.686         70.536       0.051999     1.7533e-06         36.724          53.79        0           0.17731
    {'p75'               }         90.494             55              1         239.18         258.98       0.064984     4.2796e-06         54.991         90.494        0           0.20007
    {'p90'               }         143.31             61              1         525.49         583.89         0.4252     9.4378e-06          80.27         143.31        0           0.21638
    {'p99_99'            }         816.36             64              1         4974.3         5033.7              1     8.3083e-05         388.76         816.36        0           0.24852
    {'fl_cov_y_all'      }         3879.8         217.85         3.8458          17148          18233        -4.5809    -0.00012497         1859.9         3879.8        0            1.7036
    {'fl_cor_y_all'      }              1        0.24637        0.14147        0.81024        0.83049       -0.30887       -0.21994        0.97519              1      NaN           0.79998
    {'fl_cov_age_ss'     }         217.85         201.53       -0.25515         2124.1         2205.5        -1.3124    -5.6686e-05         85.521         217.85        0           0.14382
    {'fl_cor_age_ss'     }        0.24637              1      -0.041181        0.44036        0.44078       -0.38826       -0.43773        0.19675        0.24637      NaN           0.29631
    {'fl_cov_educ_ss'    }         3.8458       -0.25515        0.19048         8.5838         9.2793       0.020725    -3.0201e-07         2.2319         3.8458        0         0.0019345
    {'fl_cor_educ_ss'    }        0.14147      -0.041181              1       0.057885       0.060323        0.19943      -0.075858        0.16702        0.14147      NaN           0.12964
    {'fl_cov_a_ss'       }          17148         2124.1         8.5838     1.1544e+05     1.1966e+05        -17.446    -0.00063245         8778.5          17148        0            6.9206
    {'fl_cor_a_ss'       }        0.81024        0.44036       0.057885              1        0.99922       -0.21564       -0.20405        0.84382        0.81024      NaN           0.59576
    {'fl_cov_ap_ss'      }          18233         2205.5         9.2793     1.1966e+05     1.2423e+05        -18.642    -0.00066786         9253.9          18233        0            7.3705
    {'fl_cor_ap_ss'      }        0.83049        0.44078       0.060323        0.99922              1       -0.22213       -0.20772         0.8575        0.83049      NaN           0.61165
    {'fl_cov_MPC'        }        -4.5809        -1.3124       0.020725        -17.446        -18.642       0.056696     4.4306e-07        -2.3581        -4.5809        0        -0.0045549
    {'fl_cor_MPC'        }       -0.30887       -0.38826        0.19943       -0.21564       -0.22213              1        0.20398       -0.32345       -0.30887      NaN          -0.55952
    {'fl_cov_Mass'       }    -0.00012497    -5.6686e-05    -3.0201e-07    -0.00063245    -0.00066786     4.4306e-07     8.3214e-11    -6.0158e-05    -0.00012497        0       -7.5138e-08
    {'fl_cor_Mass'       }       -0.21994       -0.43773      -0.075858       -0.20405       -0.20772        0.20398              1       -0.21538       -0.21994      NaN          -0.24092
    {'fl_cov_c_ss'       }         1859.9         85.521         2.2319         8778.5         9253.9        -2.3581    -6.0158e-05          937.5         1859.9        0           0.85654
    {'fl_cor_c_ss'       }        0.97519        0.19675        0.16702        0.84382         0.8575       -0.32345       -0.21538              1        0.97519      NaN           0.81823
    {'fl_cov_y_head_inc' }         3879.8         217.85         3.8458          17148          18233        -4.5809    -0.00012497         1859.9         3879.8        0            1.7036
    {'fl_cor_y_head_inc' }              1        0.24637        0.14147        0.81024        0.83049       -0.30887       -0.21994        0.97519              1      NaN           0.79998
    {'fl_cov_y_spouse'   }              0              0              0              0              0              0              0              0              0        0                 0
    {'fl_cor_y_spouse'   }            NaN            NaN            NaN            NaN            NaN            NaN            NaN            NaN            NaN      NaN               NaN
    {'fl_cov_yshr_nttxss'}         1.7036        0.14382      0.0019345         6.9206         7.3705     -0.0045549    -7.5138e-08        0.85654         1.7036        0         0.0011689
    {'fl_cor_yshr_nttxss'}        0.79998        0.29631        0.12964        0.59576        0.61165       -0.55952       -0.24092        0.81823        0.79998      NaN                 1
    {'fracByP0_01'       }     4.4303e-06       0.016474              0              0              0     2.2103e-05     2.6483e-09     6.7674e-06     4.4303e-06      NaN        2.6626e-05
    {'fracByP10'         }       0.020773       0.059565              0              0     5.8512e-06       0.027886       0.002499       0.029551       0.020773      NaN           0.06281
    {'fracByP25'         }       0.075454        0.14379              0      0.0011338      0.0016584       0.074873       0.018427        0.10114       0.075454      NaN           0.18333
    {'fracByP50'         }        0.22298         0.3659              0       0.043403       0.039292        0.16185       0.086887        0.27277        0.22298      NaN           0.42025
    {'fracByP75'         }        0.46643        0.67037              1        0.22326        0.21886        0.26365        0.24138        0.52426        0.46643      NaN           0.69126
    {'fracByP90'         }        0.70129        0.88673              1        0.49372        0.50105        0.41472        0.43635        0.74487        0.70129      NaN           0.87035
    {'fracByP99_99'      }        0.99869              1              1        0.99759        0.99716        0.99932              1        0.99902        0.99869      NaN           0.99986

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0 and kids =1
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames        y_all         age_ss        educ_ss         a_ss          ap_ss           MPC           Mass           c_ss        y_head_inc     y_spouse    yshr_nttxss
    ______________________    ___________    ___________    __________    ___________    __________    ___________    ___________    ___________    ___________    ________    ___________

    {'mean'              }         65.867         36.118       0.25753         94.382        101.22        0.27035     1.6746e-06         46.236         65.867        0           0.17066
    {'unweighted_sum'    }     1.7831e+08           1909             1     1.2935e+05    1.5913e+09          51229       0.064862     1.3312e+08     1.7831e+08        0        1.5239e+05
    {'sd'                }         56.932         11.182       0.43728         214.92        223.55        0.34398     2.5345e-06         31.484         56.932        0           0.03393
    {'coefofvar'         }        0.86435         0.3096        1.6979         2.2771        2.2087         1.2724         1.5135        0.68094        0.86435      NaN           0.19882
    {'gini'              }        0.40364        0.17438       0.68158        0.79318       0.79099        0.60214        0.65568        0.33549        0.40364      NaN            0.1128
    {'min'               }         2.2124             19             0              0             0    -1.0027e-08              0         2.1316         2.2124        0          0.036506
    {'max'               }         1414.1             64             1         7837.6        8291.1              1     1.7142e-05         605.17         1414.1        0           0.25232
    {'pYis0'             }              0              0       0.74247        0.23563       0.21309              0              0              0              0        1                 0
    {'pYls0'             }              0              0             0              0             0     4.6508e-09              0              0              0        0                 0
    {'pYgr0'             }              1              1       0.25753        0.76437       0.78691              1              1              1              1        0                 1
    {'pYisMINY'          }     1.6845e-06       0.020845       0.74247        0.23563       0.21309     1.5329e-13              0     1.6845e-06     1.6845e-06        1        1.6845e-06
    {'pYisMAXY'          }     3.4305e-10      0.0031122       0.25753      8.262e-07    1.6379e-10      2.981e-05     0.00026086     1.1123e-09     3.4305e-10        1        3.4305e-10
    {'p0_01'             }         3.5188             19             0              0             0       0.038534      5.863e-11         3.3448         3.5188        0          0.049452
    {'p10'               }         19.292             22             0              0             0       0.046864     6.8253e-08         17.015         19.292        0           0.12421
    {'p25'               }         30.023             26             0       0.029898       0.23918        0.05028     2.1294e-07         25.627         30.023        0           0.14775
    {'p50'               }         49.454             35             0         10.255        14.159       0.059088     6.2564e-07         38.787         49.454        0           0.17326
    {'p75'               }         82.311             45             1          82.04        100.97        0.41883     1.8835e-06         57.676         82.311        0           0.19625
    {'p90'               }         130.49             52             1         276.88        293.79        0.92925     4.9159e-06         83.195         130.49        0           0.21336
    {'p99_99'            }         764.17             64             1         3737.2        3751.1              1     1.7142e-05         395.77         764.17        0           0.24792
    {'fl_cov_y_all'      }         3241.3         152.53        4.1103         9427.3         10125        -8.9788    -4.8054e-05         1766.6         3241.3        0            1.5555
    {'fl_cor_y_all'      }              1        0.23959       0.16511        0.77047       0.79555       -0.45848       -0.33303        0.98556              1      NaN           0.80522
    {'fl_cov_age_ss'     }         152.53         125.05       0.19904         967.92          1008        -1.3659    -1.3242e-05         76.831         152.53        0           0.10317
    {'fl_cor_age_ss'     }        0.23959              1      0.040704        0.40274       0.40323       -0.35509       -0.46722        0.21823        0.23959      NaN            0.2719
    {'fl_cov_educ_ss'    }         4.1103        0.19904       0.19121         5.7853        6.3576       0.021532     -1.409e-07         2.5674         4.1103        0         0.0024166
    {'fl_cor_educ_ss'    }        0.16511       0.040704             1       0.061559      0.065037        0.14315       -0.12714        0.18649        0.16511      NaN           0.16288
    {'fl_cov_a_ss'       }         9427.3         967.92        5.7853          46190         47995        -20.591    -0.00013616         5341.5         9427.3        0            3.8467
    {'fl_cor_a_ss'       }        0.77047        0.40274      0.061559              1       0.99895       -0.27853       -0.24996         0.7894        0.77047      NaN            0.5275
    {'fl_cov_ap_ss'      }          10125           1008        6.3576          47995         49975         -22.11     -0.0001451         5695.3          10125        0            4.1371
    {'fl_cor_ap_ss'      }        0.79555        0.40323      0.065037        0.99895             1       -0.28753       -0.25609        0.80918        0.79555      NaN           0.54542
    {'fl_cov_MPC'        }        -8.9788        -1.3659      0.021532        -20.591        -22.11        0.11833     4.0203e-07        -5.4378        -8.9788        0        -0.0084909
    {'fl_cor_MPC'        }       -0.45848       -0.35509       0.14315       -0.27853      -0.28753              1        0.46114        -0.5021       -0.45848      NaN          -0.72749
    {'fl_cov_Mass'       }    -4.8054e-05    -1.3242e-05    -1.409e-07    -0.00013616    -0.0001451     4.0203e-07     6.4237e-12    -2.7987e-05    -4.8054e-05        0       -3.4709e-08
    {'fl_cor_Mass'       }       -0.33303       -0.46722      -0.12714       -0.24996      -0.25609        0.46114              1       -0.35073       -0.33303      NaN          -0.40361
    {'fl_cov_c_ss'       }         1766.6         76.831        2.5674         5341.5        5695.3        -5.4378    -2.7987e-05         991.24         1766.6        0           0.90499
    {'fl_cor_c_ss'       }        0.98556        0.21823       0.18649         0.7894       0.80918        -0.5021       -0.35073              1        0.98556      NaN           0.84716
    {'fl_cov_y_head_inc' }         3241.3         152.53        4.1103         9427.3         10125        -8.9788    -4.8054e-05         1766.6         3241.3        0            1.5555
    {'fl_cor_y_head_inc' }              1        0.23959       0.16511        0.77047       0.79555       -0.45848       -0.33303        0.98556              1      NaN           0.80522
    {'fl_cov_y_spouse'   }              0              0             0              0             0              0              0              0              0        0                 0
    {'fl_cor_y_spouse'   }            NaN            NaN           NaN            NaN           NaN            NaN            NaN            NaN            NaN      NaN               NaN
    {'fl_cov_yshr_nttxss'}         1.5555        0.10317     0.0024166         3.8467        4.1371     -0.0084909    -3.4709e-08        0.90499         1.5555        0         0.0011513
    {'fl_cor_yshr_nttxss'}        0.80522         0.2719       0.16288         0.5275       0.54542       -0.72749       -0.40361        0.84716        0.80522      NaN                 1
    {'fracByP0_01'       }     4.7258e-06       0.010966             0              0             0     1.3978e-05     1.8126e-09     6.4246e-06     4.7258e-06      NaN         2.675e-05
    {'fracByP10'         }       0.021712       0.068419             0              0             0       0.016512       0.001866       0.027652       0.021712      NaN          0.062763
    {'fracByP25'         }       0.078097        0.15825             0     6.9352e-06    3.5474e-05       0.043505       0.014134       0.097343       0.078097      NaN           0.18326
    {'fracByP50'         }        0.22713        0.37923             0      0.0099825      0.010737       0.093156       0.073818        0.27076        0.22713      NaN           0.41938
    {'fracByP75'         }        0.46939        0.67298             1        0.11689       0.12619        0.22384        0.24401        0.52617        0.46939      NaN           0.68966
    {'fracByP90'         }        0.70221        0.85638             1        0.39992       0.38891        0.63843        0.51736        0.74773        0.70221      NaN           0.86921
    {'fracByP99_99'      }        0.99866              1             1        0.99622       0.99554        0.99967              1        0.99902        0.99866      NaN           0.99985

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0 and kids =2
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames        y_all         age_ss         educ_ss         a_ss           ap_ss          MPC           Mass           c_ss        y_head_inc     y_spouse    yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    __________    ___________    ___________    ___________    ________    ___________

    {'mean'              }         64.473         34.566        0.24576         62.952         67.629       0.40193     2.6063e-06         47.337         64.473        0           0.17013
    {'unweighted_sum'    }     1.7831e+08           1909              1     1.2935e+05     1.5826e+09         56327       0.060896     1.4202e+08     1.7831e+08        0        1.5239e+05
    {'sd'                }         54.982         9.1574        0.43053         161.65         168.99       0.41343     3.8252e-06         32.135         54.982        0          0.033511
    {'coefofvar'         }        0.85279        0.26492         1.7519         2.5678         2.4988        1.0286         1.4677        0.67884        0.85279      NaN           0.19697
    {'gini'              }        0.39845        0.14726        0.69833        0.83755        0.84059       0.53533        0.66399        0.33793        0.39845      NaN           0.11174
    {'min'               }         2.2124             19              0              0              0    -7.549e-10              0         2.1316         2.2124        0          0.036506
    {'max'               }         1414.1             64              1         7837.6           8229             1     1.7878e-05         668.01         1414.1        0           0.25232
    {'pYis0'             }              0              0        0.75424        0.36638        0.36654             0              0              0              0        1                 0
    {'pYls0'             }              0              0              0              0              0             0              0              0              0        0                 0
    {'pYgr0'             }              1              1        0.24576        0.63362        0.63346             1              1              1              1        0                 1
    {'pYisMINY'          }     9.8494e-07        0.01156        0.75424        0.36638        0.36654             0              0     9.8494e-07     9.8494e-07        1        9.8494e-07
    {'pYisMAXY'          }     6.7773e-11     0.00057855        0.24576        1.4e-07      9.363e-12    1.4549e-05        0.00029     3.9183e-10     6.7773e-11        1        6.7773e-11
    {'p0_01'             }         3.5915             19              0              0              0      0.040756     5.4765e-11         3.4116         3.5915        0          0.050098
    {'p10'               }         19.324             23              0              0              0      0.049871     7.8876e-08         17.031         19.324        0            0.1243
    {'p25'               }         29.888             27              0              0              0      0.054254     2.7548e-07         25.691         29.888        0           0.14751
    {'p50'               }         48.811             34              0         1.9135         3.2844      0.088137     8.7838e-07         40.011         48.811        0           0.17262
    {'p75'               }         80.448             41              0         51.664         56.749       0.94713     3.0659e-06         59.627         80.448        0            0.1953
    {'p90'               }         126.75             47              1         174.36         199.54       0.99668     7.3142e-06         85.453         126.75        0           0.21239
    {'p99_99'            }         740.25             64              1         2910.1         3038.9             1     1.7878e-05         394.67         740.25        0           0.24762
    {'fl_cov_y_all'      }           3023         108.56         4.4029         6789.1         7342.2       -12.648    -7.6259e-05         1746.8           3023        0            1.4898
    {'fl_cor_y_all'      }              1        0.21562          0.186        0.76387         0.7902      -0.55643       -0.36259        0.98869              1      NaN            0.8086
    {'fl_cov_age_ss'     }         108.56         83.858        0.38657         516.18         539.94         -1.27    -1.1065e-05         59.484         108.56        0          0.073937
    {'fl_cor_age_ss'     }        0.21562              1        0.09805         0.3487        0.34891      -0.33546       -0.31587        0.20214        0.21562      NaN           0.24094
    {'fl_cov_educ_ss'    }         4.4029        0.38657        0.18536         4.3837         4.9328     0.0077811    -2.8216e-07          2.819         4.4029        0         0.0027409
    {'fl_cor_educ_ss'    }          0.186        0.09805              1       0.062988       0.067799      0.043715       -0.17133        0.20376          0.186      NaN           0.18997
    {'fl_cov_a_ss'       }         6789.1         516.18         4.3837          26131          27284       -21.879    -0.00014947         3991.5         6789.1        0              2.72
    {'fl_cor_a_ss'       }        0.76387         0.3487       0.062988              1        0.99878      -0.32737       -0.24172        0.76839        0.76387      NaN           0.50211
    {'fl_cov_ap_ss'      }         7342.2         539.94         4.9328          27284          28559       -23.534    -0.00016026         4289.9         7342.2        0            2.9404
    {'fl_cor_ap_ss'      }         0.7902        0.34891       0.067799        0.99878              1      -0.33684       -0.24792        0.78995         0.7902      NaN           0.51922
    {'fl_cov_MPC'        }        -12.648          -1.27      0.0077811        -21.879        -23.534       0.17093     9.6192e-07        -8.1176        -12.648        0         -0.010932
    {'fl_cor_MPC'        }       -0.55643       -0.33546       0.043715       -0.32737       -0.33684             1        0.60824       -0.61101       -0.55643      NaN          -0.78903
    {'fl_cov_Mass'       }    -7.6259e-05    -1.1065e-05    -2.8216e-07    -0.00014947    -0.00016026    9.6192e-07     1.4632e-11    -4.7812e-05    -7.6259e-05        0       -5.4486e-08
    {'fl_cor_Mass'       }       -0.36259       -0.31587       -0.17133       -0.24172       -0.24792       0.60824              1       -0.38896       -0.36259      NaN          -0.42505
    {'fl_cov_c_ss'       }         1746.8         59.484          2.819         3991.5         4289.9       -8.1176    -4.7812e-05         1032.6         1746.8        0           0.92525
    {'fl_cor_c_ss'       }        0.98869        0.20214        0.20376        0.76839        0.78995      -0.61101       -0.38896              1        0.98869      NaN           0.85921
    {'fl_cov_y_head_inc' }           3023         108.56         4.4029         6789.1         7342.2       -12.648    -7.6259e-05         1746.8           3023        0            1.4898
    {'fl_cor_y_head_inc' }              1        0.21562          0.186        0.76387         0.7902      -0.55643       -0.36259        0.98869              1      NaN            0.8086
    {'fl_cov_y_spouse'   }              0              0              0              0              0             0              0              0              0        0                 0
    {'fl_cor_y_spouse'   }            NaN            NaN            NaN            NaN            NaN           NaN            NaN            NaN            NaN      NaN               NaN
    {'fl_cov_yshr_nttxss'}         1.4898       0.073937      0.0027409           2.72         2.9404     -0.010932    -5.4486e-08        0.92525         1.4898        0          0.001123
    {'fl_cor_yshr_nttxss'}         0.8086        0.24094        0.18997        0.50211        0.51922      -0.78903       -0.42505        0.85921         0.8086      NaN                 1
    {'fracByP0_01'       }      4.972e-06      0.0063542              0              0              0    1.0229e-05     1.0808e-09     6.4569e-06      4.972e-06      NaN        2.7425e-05
    {'fracByP10'         }        0.02237       0.067607              0              0              0      0.011805      0.0013317        0.02714        0.02237      NaN          0.063263
    {'fracByP25'         }       0.079911         0.1793              0              0              0      0.031252       0.011135       0.095345       0.079911      NaN           0.18401
    {'fracByP50'         }        0.23057        0.42619              0      0.0018299      0.0020426      0.069913       0.063086        0.26782        0.23057      NaN           0.42005
    {'fracByP75'         }        0.47337        0.67985              0       0.091755       0.083969       0.38585        0.23048        0.52573        0.47337      NaN           0.69005
    {'fracByP90'         }        0.70508        0.85252              1        0.32859        0.33227       0.75145        0.52638        0.74895        0.70508      NaN           0.86932
    {'fracByP99_99'      }        0.99867              1              1        0.99463        0.99454       0.99977              1        0.99905        0.99867      NaN           0.99985

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0 and kids =3
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames        y_all         age_ss         educ_ss         a_ss           ap_ss          MPC           Mass           c_ss        y_head_inc     y_spouse    yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    __________    ___________    ___________    ___________    ________    ___________

    {'mean'              }         63.898         34.068        0.22983         48.134         51.951          0.48     1.6377e-06         47.764         63.898        0           0.16999
    {'unweighted_sum'    }     1.7831e+08           1909              1     1.2935e+05     1.5774e+09         59167       0.024515     1.4716e+08     1.7831e+08        0        1.5239e+05
    {'sd'                }         54.001         7.9772        0.42073         134.32         141.06       0.43321     2.3589e-06         32.448         54.001        0          0.033247
    {'coefofvar'         }        0.84511        0.23415         1.8306         2.7906         2.7152       0.90252         1.4404        0.67934        0.84511      NaN           0.19559
    {'gini'              }        0.39521        0.12909        0.72073        0.86678        0.86943       0.47895        0.66946         0.3397        0.39521      NaN           0.11092
    {'min'               }         2.2124             19              0              0              0    4.7561e-08              0         2.1316         2.2124        0          0.036506
    {'max'               }         1414.1             64              1         7837.6         8183.8             1     9.9682e-06         714.44         1414.1        0           0.25232
    {'pYis0'             }              0              0        0.77017        0.45656        0.45134             0              0              0              0        1                 0
    {'pYls0'             }              0              0              0              0              0             0              0              0              0        0                 0
    {'pYgr0'             }              1              1        0.22983        0.54344        0.54866             1              1              1              1        0                 1
    {'pYisMINY'          }     6.8879e-07      0.0083137        0.77017        0.45656        0.45134             0              0     6.8879e-07     6.8879e-07        1        6.8879e-07
    {'pYisMAXY'          }     1.1096e-11     0.00013776        0.22983     2.4752e-08     1.1431e-12    4.2401e-06     0.00040187     9.2599e-11     1.1096e-11        1        1.1096e-11
    {'p0_01'             }         3.6125             19              0              0              0      0.042355     2.2294e-11         3.4309         3.6125        0          0.050284
    {'p10'               }         19.479             24              0              0              0      0.051982     3.9674e-08         17.059         19.479        0           0.12472
    {'p25'               }         29.928             28              0              0              0      0.057211     1.4355e-07          25.62         29.928        0           0.14758
    {'p50'               }         48.607             33              0        0.23918         0.4981       0.25206     5.1838e-07         40.356         48.607        0           0.17241
    {'p75'               }         79.715             39              0         29.898         37.199         0.998     2.2898e-06           60.5         79.715        0           0.19492
    {'p90'               }         125.03             45              1         146.89         152.53       0.99994     5.2698e-06         86.516         125.03        0           0.21193
    {'p99_99'            }         727.36             64              1         2546.8           2631             1     9.9682e-06         393.24         727.36        0           0.24746
    {'fl_cov_y_all'      }         2916.1         86.208         4.4997           5525         6009.3       -14.294    -4.6648e-05         1734.9         2916.1        0            1.4552
    {'fl_cor_y_all'      }              1        0.20012        0.19805        0.76171        0.78891        -0.611        -0.3662        0.99009              1      NaN           0.81051
    {'fl_cov_age_ss'     }         86.208         63.635        0.47515         327.14         343.36       -1.1063    -5.1607e-06         49.892         86.208        0          0.059225
    {'fl_cor_age_ss'     }        0.20012              1        0.14157        0.30531        0.30515      -0.32013       -0.27425        0.19275        0.20012      NaN            0.2233
    {'fl_cov_educ_ss'    }         4.4997        0.47515        0.17701         3.7005         4.2241    -0.0020988    -2.1548e-07           2.92         4.4997        0         0.0028436
    {'fl_cor_educ_ss'    }        0.19805        0.14157              1       0.065482       0.071177     -0.011516       -0.21712        0.21389        0.19805      NaN           0.20329
    {'fl_cov_a_ss'       }           5525         327.14         3.7005          18042          18921       -20.435    -7.4065e-05         3306.4           5525        0            2.1663
    {'fl_cor_a_ss'       }        0.76171        0.30531       0.065482              1        0.99863      -0.35119       -0.23375        0.75862        0.76171      NaN            0.4851
    {'fl_cov_ap_ss'      }         6009.3         343.36         4.2241          18921          19897       -22.077    -7.9832e-05         3575.9         6009.3        0            2.3537
    {'fl_cor_ap_ss'      }        0.78891        0.30515       0.071177        0.99863              1      -0.36128       -0.23992        0.78127        0.78891      NaN           0.50187
    {'fl_cov_MPC'        }        -14.294        -1.1063     -0.0020988        -20.435        -22.077       0.18767     6.1913e-07        -9.3819        -14.294        0         -0.011615
    {'fl_cor_MPC'        }         -0.611       -0.32013      -0.011516       -0.35119       -0.36128             1        0.60586       -0.66743         -0.611      NaN          -0.80643
    {'fl_cov_Mass'       }    -4.6648e-05    -5.1607e-06    -2.1548e-07    -7.4065e-05    -7.9832e-05    6.1913e-07     5.5644e-12    -3.0024e-05    -4.6648e-05        0       -3.1197e-08
    {'fl_cor_Mass'       }        -0.3662       -0.27425       -0.21712       -0.23375       -0.23992       0.60586              1       -0.39226        -0.3662      NaN          -0.39778
    {'fl_cov_c_ss'       }         1734.9         49.892           2.92         3306.4         3575.9       -9.3819    -3.0024e-05         1052.9         1734.9        0             0.932
    {'fl_cor_c_ss'       }        0.99009        0.19275        0.21389        0.75862        0.78127      -0.66743       -0.39226              1        0.99009      NaN           0.86391
    {'fl_cov_y_head_inc' }         2916.1         86.208         4.4997           5525         6009.3       -14.294    -4.6648e-05         1734.9         2916.1        0            1.4552
    {'fl_cor_y_head_inc' }              1        0.20012        0.19805        0.76171        0.78891        -0.611        -0.3662        0.99009              1      NaN           0.81051
    {'fl_cov_y_spouse'   }              0              0              0              0              0             0              0              0              0        0                 0
    {'fl_cor_y_spouse'   }            NaN            NaN            NaN            NaN            NaN           NaN            NaN            NaN            NaN      NaN               NaN
    {'fl_cov_yshr_nttxss'}         1.4552       0.059225      0.0028436         2.1663         2.3537     -0.011615    -3.1197e-08          0.932         1.4552        0         0.0011054
    {'fl_cor_yshr_nttxss'}        0.81051         0.2233        0.20329         0.4851        0.50187      -0.80643       -0.39778        0.86391        0.81051      NaN                 1
    {'fracByP0_01'       }     5.1241e-06      0.0046366              0              0              0    9.1768e-06     6.9826e-10     6.5328e-06     5.1241e-06      NaN         2.789e-05
    {'fracByP10'         }       0.022798       0.072031              0              0              0      0.010291        0.00104       0.027053       0.022798      NaN          0.063706
    {'fracByP25'         }       0.081073         0.1985              0              0              0      0.027336      0.0090696        0.09452       0.081073      NaN           0.18471
    {'fracByP50'         }        0.23275        0.41302              0     0.00019689     0.00018652      0.072554       0.053408         0.2657        0.23275      NaN           0.42064
    {'fracByP75'         }        0.47593        0.67505              0       0.056161       0.056849       0.47949        0.22677        0.52482        0.47593      NaN           0.69044
    {'fracByP90'         }        0.70691        0.86752              1        0.31708        0.29108       0.79234        0.53042        0.74913        0.70691      NaN           0.86944
    {'fracByP99_99'      }        0.99868              1              1        0.99425        0.99383       0.99985              1        0.99906        0.99868      NaN           0.99985

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0 and kids =4
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames        y_all         age_ss         educ_ss         a_ss           ap_ss          MPC           Mass           c_ss        y_head_inc     y_spouse    yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    __________    ___________    ___________    ___________    ________    ___________

    {'mean'              }         63.864         34.197         0.2079         41.099         44.671        0.5155     9.8979e-07         47.988         63.864        0          0.17015 
    {'unweighted_sum'    }     1.7831e+08           1909              1     1.2935e+05     1.5749e+09         60811       0.010983     1.4977e+08     1.7831e+08        0       1.5239e+05 
    {'sd'                }         53.609         7.1538         0.4058         120.68         127.29       0.43732     1.3927e-06         32.514         53.609        0         0.033026 
    {'coefofvar'         }        0.83942         0.2092         1.9519         2.9363         2.8494       0.84834         1.4071        0.67755        0.83942      NaN           0.1941 
    {'gini'              }        0.39289        0.11447        0.75112        0.88249        0.88373       0.45039        0.66771        0.33944        0.39289      NaN          0.11005 
    {'min'               }         2.2124             19              0              0              0    2.8502e-07              0         2.1316         2.2124        0         0.036506 
    {'max'               }         1414.1             64              1         7837.6         8164.9             1     5.6518e-06         747.91         1414.1        0          0.25232 
    {'pYis0'             }              0              0         0.7921        0.50485        0.49255             0              0              0              0        1                0 
    {'pYls0'             }              0              0              0              0              0             0              0              0              0        0                0 
    {'pYgr0'             }              1              1         0.2079        0.49515        0.50745             1              1              1              1        0                1 
    {'pYisMINY'          }     4.3493e-07      0.0045732         0.7921        0.50485        0.49255             0              0     4.3493e-07     4.3493e-07        1       4.3493e-07 
    {'pYisMAXY'          }     1.4837e-12     4.6124e-05         0.2079      5.166e-09     1.5175e-11    7.8061e-07     0.00050918     1.2616e-11     1.4837e-12        1       1.4837e-12 
    {'p0_01'             }         3.6887             19              0              0              0      0.043315     1.0193e-11         3.5008         3.6887        0         0.050952 
    {'p10'               }         19.685             25              0              0              0      0.053362     2.1201e-08         17.219         19.685        0          0.12528 
    {'p25'               }         30.153             29              0              0              0      0.059271     7.7102e-08         25.719         30.153        0          0.14797 
    {'p50'               }          48.75             34              0              0       0.029898        0.4735     2.9721e-07          40.43          48.75        0          0.17256 
    {'p75'               }         79.548             39              0         21.796         27.795       0.99978     1.4123e-06         60.986         79.548        0          0.19484 
    {'p90'               }         124.62             44              1         122.46         130.01             1     3.3124e-06         86.892         124.62        0          0.21182 
    {'p99_99'            }         721.01             63              1         2377.1         2423.1             1     5.6518e-06         390.87         721.01        0          0.24737 
    {'fl_cov_y_all'      }         2873.9         71.941         4.4963         4930.8           5391       -14.976    -2.7333e-05           1727         2873.9        0            1.437 
    {'fl_cor_y_all'      }              1        0.18759        0.20668        0.76216        0.79005      -0.63881       -0.36608         0.9908              1      NaN          0.81163 
    {'fl_cov_age_ss'     }         71.941         51.176         0.5437         238.82         251.85       -1.0328    -2.6204e-06         42.146         71.941        0         0.049376 
    {'fl_cor_age_ss'     }        0.18759              1        0.18729        0.27663        0.27658      -0.33014         -0.263         0.1812        0.18759      NaN          0.20899 
    {'fl_cov_educ_ss'    }         4.4963         0.5437        0.16468         3.6463         4.1759     -0.010238    -1.3997e-07         2.9107         4.4963        0        0.0028207 
    {'fl_cor_educ_ss'    }        0.20668        0.18729              1       0.074456       0.080846     -0.057692       -0.24765        0.22061        0.20668      NaN          0.21047 
    {'fl_cov_a_ss'       }         4930.8         238.82         3.6463          14564          15338       -18.883    -3.8707e-05         2959.6         4930.8        0           1.8938 
    {'fl_cor_a_ss'       }        0.76216        0.27663       0.074456              1        0.99852      -0.35781        -0.2303        0.75427        0.76216      NaN          0.47516 
    {'fl_cov_ap_ss'      }           5391         251.85         4.1759          15338          16202       -20.539    -4.2009e-05         3218.9           5391        0           2.0694 
    {'fl_cor_ap_ss'      }        0.79005        0.27658       0.080846        0.99852              1      -0.36898       -0.23697        0.77778        0.79005      NaN          0.49228 
    {'fl_cov_MPC'        }        -14.976        -1.0328      -0.010238        -18.883        -20.539       0.19125     3.5805e-07        -9.8829        -14.976        0        -0.011786 
    {'fl_cor_MPC'        }       -0.63881       -0.33014      -0.057692       -0.35781       -0.36898             1        0.58787       -0.69505       -0.63881      NaN         -0.81604 
    {'fl_cov_Mass'       }    -2.7333e-05    -2.6204e-06    -1.3997e-07    -3.8707e-05    -4.2009e-05    3.5805e-07     1.9397e-12    -1.7637e-05    -2.7333e-05        0       -1.717e-08 
    {'fl_cor_Mass'       }       -0.36608         -0.263       -0.24765        -0.2303       -0.23697       0.58787              1       -0.38949       -0.36608      NaN         -0.37328 
    {'fl_cov_c_ss'       }           1727         42.146         2.9107         2959.6         3218.9       -9.8829    -1.7637e-05         1057.2           1727        0          0.92969 
    {'fl_cor_c_ss'       }         0.9908         0.1812        0.22061        0.75427        0.77778      -0.69505       -0.38949              1         0.9908      NaN          0.86579 
    {'fl_cov_y_head_inc' }         2873.9         71.941         4.4963         4930.8           5391       -14.976    -2.7333e-05           1727         2873.9        0            1.437 
    {'fl_cor_y_head_inc' }              1        0.18759        0.20668        0.76216        0.79005      -0.63881       -0.36608         0.9908              1      NaN          0.81163 
    {'fl_cov_y_spouse'   }              0              0              0              0              0             0              0              0              0        0                0 
    {'fl_cor_y_spouse'   }            NaN            NaN            NaN            NaN            NaN           NaN            NaN            NaN            NaN      NaN              NaN 
    {'fl_cov_yshr_nttxss'}          1.437       0.049376      0.0028207         1.8938         2.0694     -0.011786     -1.717e-08        0.92969          1.437        0        0.0010907 
    {'fl_cor_yshr_nttxss'}        0.81163        0.20899        0.21047        0.47516        0.49228      -0.81604       -0.37328        0.86579        0.81163      NaN                1 
    {'fracByP0_01'       }     5.1325e-06      0.0025409              0              0              0    8.3511e-06     5.2683e-10     6.5063e-06     5.1325e-06      NaN       2.7738e-05 
    {'fracByP10'         }       0.022996       0.072385              0              0              0     0.0098261     0.00091365       0.027166       0.022996      NaN         0.063835 
    {'fracByP25'         }       0.081963        0.20856              0              0              0      0.026177      0.0080459       0.094679       0.081963      NaN          0.18549 
    {'fracByP50'         }        0.23436        0.45949              0              0     4.2228e-06      0.087798       0.049091        0.26589        0.23436      NaN          0.42136 
    {'fracByP75'         }        0.47776        0.70775              0       0.041779       0.043053       0.51583        0.23086        0.52502        0.47776      NaN          0.69089 
    {'fracByP90'         }        0.70826        0.87861              1         0.2851         0.2661       0.80736        0.54656        0.74964        0.70826      NaN          0.86963 
    {'fracByP99_99'      }        0.99869        0.99991              1        0.99427        0.99339       0.99998              1        0.99907        0.99869      NaN          0.99985 

  0x0 empty char array

  0x0 empty char array

-------------------------------
-------------------------------
-------------------------------
-------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =1
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-------------------------------
-------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =1 and kids =0
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames        y_all         age_ss        educ_ss         a_ss           ap_ss           MPC           Mass           c_ss        y_head_inc      y_spouse      yshr_nttxss
    ______________________    ___________    ___________    __________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________

    {'mean'              }         109.57         44.041       0.38021         408.45          434.2        0.12185     1.6158e-06         85.062         82.446          59.54        0.20324
    {'unweighted_sum'    }     1.2919e+09           1909             1     1.2935e+05     8.4753e+09     2.1767e+05        0.12732     7.4472e+08     1.7831e+08     1.2273e+07     8.8173e+05
    {'sd'                }         83.584         15.135       0.48544         498.74          514.1        0.15675     4.5518e-06         40.768         67.688         94.499       0.025745
    {'coefofvar'         }        0.76282        0.34365        1.2768         1.2211          1.184         1.2864          2.817        0.47927        0.82101         1.5872        0.12667
    {'gini'              }         0.3692        0.18905       0.50257        0.57853        0.57485        0.51157        0.75245        0.24927        0.39247        0.58092       0.070304
    {'min'               }         2.4223             19             0              0              0    -8.0925e-09              0         2.5624         2.2124        0.46062       0.041394
    {'max'               }         2113.2             64             1         7837.6         9503.9        0.94127     3.7003e-05         535.22         1414.1         1545.8         0.2552
    {'pYis0'             }              0              0       0.61979        0.07588       0.036618              0              0              0              0              0              0
    {'pYls0'             }              0              0             0              0              0     1.9519e-06              0              0              0              0              0
    {'pYgr0'             }              1              1       0.38021        0.92412        0.96338              1              1              1              1              1              1
    {'pYisMINY'          }     5.1901e-09       0.043093       0.61979        0.07588       0.036618     3.0411e-12              0     5.1901e-09      1.122e-06     5.1901e-09     5.1901e-09
    {'pYisMAXY'          }     2.4329e-11       0.038439       0.38021     1.8938e-05     1.2944e-11     5.9811e-09     0.00028667     5.4384e-11     5.1431e-09     1.1831e-09     1.2944e-11
    {'p0_01'             }          6.597             19             0              0              0       0.032266     8.4676e-11         8.1468          3.946        0.63002       0.081027
    {'p10'               }         35.716             21             0         1.9135         3.7372       0.042396     6.6896e-08         42.965         24.432         6.1978        0.16807
    {'p25'               }         54.783             29             0         51.664         59.412       0.047165     1.9028e-07         58.175         38.641         16.818        0.18773
    {'p50'               }         88.064             48             0         239.18         270.71       0.054067     4.7474e-07         77.753         63.788         31.505        0.20694
    {'p75'               }          137.9             58             1         588.48          634.2       0.090852     1.0716e-06         103.31         104.19         47.065        0.22325
    {'p90'               }         204.71             62             1         1074.4         1074.4        0.37409     2.4214e-06         134.76         161.04         159.09        0.23264
    {'p99_99'            }         967.74             64             1         5833.4         5977.2        0.84217     3.7003e-05         472.19          871.1           1187         0.2525
    {'fl_cov_y_all'      }         6986.3         361.95        5.7657          27155          31359        -4.5371    -7.4044e-05         2941.3         4857.1         4673.1         1.6494
    {'fl_cor_y_all'      }              1        0.28612        0.1421        0.65142        0.72978        -0.3463       -0.19462        0.86319        0.85851        0.59164         0.7665
    {'fl_cov_age_ss'     }         361.95         229.06      -0.85351         4123.7         4247.6        -1.4233    -2.2911e-05         188.87         318.48           95.4        0.13956
    {'fl_cor_age_ss'     }        0.28612              1      -0.11617         0.5463        0.54592       -0.59994       -0.33257        0.30611        0.31089       0.066703        0.35816
    {'fl_cov_educ_ss'    }         5.7657       -0.85351       0.23565         16.048         17.247      0.0094147     5.5246e-08         4.2928         4.4672         2.8501      0.0013995
    {'fl_cor_educ_ss'    }         0.1421       -0.11617             1       0.066283       0.069108        0.12373       0.025002        0.21692        0.13595        0.06213        0.11198
    {'fl_cov_a_ss'       }          27155         4123.7        16.048     2.4874e+05      2.541e+05        -28.557    -0.00041977          16348          25709         3173.5         6.3032
    {'fl_cor_a_ss'       }        0.65142         0.5463      0.066283              1        0.99103       -0.36528       -0.18491        0.80402        0.76156       0.067335        0.49089
    {'fl_cov_ap_ss'      }          31359         4247.6        17.247      2.541e+05      2.643e+05        -30.413    -0.00044771          17228          27033         9494.5         7.2859
    {'fl_cor_ap_ss'      }        0.72978        0.54592      0.069108        0.99103              1       -0.37741       -0.19132        0.82201        0.77684        0.19543        0.55047
    {'fl_cov_MPC'        }        -4.5371        -1.4233     0.0094147        -28.557        -30.413        0.02457     4.0429e-07         -2.782        -3.2029        -2.9283     -0.0021924
    {'fl_cor_MPC'        }        -0.3463       -0.59994       0.12373       -0.36528       -0.37741              1        0.56664       -0.43535       -0.30187       -0.19769       -0.54328
    {'fl_cov_Mass'       }    -7.4044e-05    -2.2911e-05    5.5246e-08    -0.00041977    -0.00044771     4.0429e-07     2.0719e-11    -4.7818e-05    -5.1946e-05    -4.8502e-05    -2.8934e-08
    {'fl_cor_Mass'       }       -0.19462       -0.33257      0.025002       -0.18491       -0.19132        0.56664              1       -0.25768        -0.1686       -0.11276        -0.2469
    {'fl_cov_c_ss'       }         2941.3         188.87        4.2928          16348          17228         -2.782    -4.7818e-05           1662         2572.5         809.56         0.7609
    {'fl_cor_c_ss'       }        0.86319        0.30611       0.21692        0.80402        0.82201       -0.43535       -0.25768              1        0.93223        0.21014        0.72495
    {'fl_cov_y_head_inc' }         4857.1         318.48        4.4672          25709          27033        -3.2029    -5.1946e-05         2572.5         4581.7         604.48         1.0945
    {'fl_cor_y_head_inc' }        0.85851        0.31089       0.13595        0.76156        0.77684       -0.30187        -0.1686        0.93223              1       0.094501        0.62804
    {'fl_cov_y_spouse'   }         4673.1           95.4        2.8501         3173.5         9494.5        -2.9283    -4.8502e-05         809.56         604.48         8930.1         1.2181
    {'fl_cor_y_spouse'   }        0.59164       0.066703       0.06213       0.067335        0.19543       -0.19769       -0.11276        0.21014       0.094501              1        0.50066
    {'fl_cov_yshr_nttxss'}         1.6494        0.13956     0.0013995         6.3032         7.2859     -0.0021924    -2.8934e-08         0.7609         1.0945         1.2181     0.00066283
    {'fl_cor_yshr_nttxss'}         0.7665        0.35816       0.11198        0.49089        0.55047       -0.54328        -0.2469        0.72495        0.62804        0.50066              1
    {'fracByP0_01'       }     5.3214e-06       0.018591             0              0              0     1.5443e-05     2.7901e-09     8.2801e-06     4.1526e-06     1.0337e-06     3.6911e-05
    {'fracByP10'         }       0.024266       0.049706             0     0.00015705     0.00034862       0.032674      0.0019366        0.03843       0.021536       0.007497       0.074255
    {'fracByP25'         }       0.086535         0.1342             0       0.010018       0.010404       0.087951       0.013766        0.12876       0.079314       0.030127        0.20641
    {'fracByP50'         }        0.24796        0.35975             0       0.097271       0.098709        0.19176       0.063401        0.32845        0.23292         0.13...

1.11 Distributional Statistics By Marital Status, Kids Count and Income Bins

Various statistics, including MPC (of the first check) by Marital Status and Kids COunt and income bins

it_row_ctr = 0;
for it_marry_ctr=1:mp_params('n_marriedgrid')
    
    display(['']);
    display(['']);
    display(['-------------------------------']);
    display(['-------------------------------']);
    display(['-------------------------------']);
    display(['-------------------------------']);
    display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
    display(['Marital =' num2str(ar_marital(it_marry_ctr))]);
    display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
    display(['-------------------------------']);
    display(['-------------------------------']);
    
    for it_kids_ctr=1:mp_params('n_kidsgrid')
        display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
        display(['Marital =' num2str(ar_marital(it_marry_ctr)) ' and kids =' num2str(ar_kids(it_kids_ctr))]);
        display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
        
        % construct input data
        y_all_grp = y_all(min_age:max_age, :, :, : ,it_marry_ctr ,it_ctr);
        age_ss_grp = age_ss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        educ_ss_grp = educ_ss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        a_ss_grp = a_ss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        ap_ss_grp = ap_ss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        mn_MPC_C_gain_share_check_grp = mn_MPC_C_gain_share_check(min_age:max_age, :, :, :, it_marry_ctr, it_kids_ctr);
        Phi_true_grp = Phi_true_1(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        c_ss_grp = c_ss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        y_head_inc_grp = y_head_inc(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        y_spouse_inc_grp = y_spouse_inc(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        yshr_nttxss_grp = yshr_nttxss(min_age:max_age, :, :, : ,it_marry_ctr, it_kids_ctr);
        
        % Income Bins
        ar_y_all = y_all_grp(:);
        ar_age_ss = age_ss_grp(:);
        ar_educ_ss = educ_ss_grp(:);
        ar_a_ss = a_ss_grp(:);
        ar_ap_ss = ap_ss_grp(:);
        ar_mn_MPC_C_gain_share_check = mn_MPC_C_gain_share_check_grp(:);
        ar_Phi_true = Phi_true_grp(:);
        ar_c_ss = c_ss_grp(:);
        ar_y_head_inc = y_head_inc_grp(:);
        ar_y_spouse_inc = y_spouse_inc_grp(:);
        ar_yshr_nttxss = yshr_nttxss_grp(:);
        
        % income bins loop
        for it_y_all_ctr=1:6
            
            % Current y group index
            % y is in thousands of dollars
            y_all_start = (it_y_all_ctr-1)*20;
            if (it_y_all_ctr == 6)
                y_all_end = max(ar_y_all);
            else
                y_all_end = it_y_all_ctr*20;                
            end
            
            display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
            display(['Marital =' num2str(ar_marital(it_marry_ctr)) ', kids =' num2str(ar_kids(it_kids_ctr)) ', ybin =' num2str(y_all_start) ' to ' num2str(y_all_end)]);
            display(['xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']);
            
            ar_y_idx = (ar_y_all >= y_all_start & ar_y_all <y_all_end);
            
            ar_mky_y_all = ar_y_all(ar_y_idx);
            ar_mky_age_ss = ar_age_ss(ar_y_idx);
            ar_mky_educ_ss = ar_educ_ss(ar_y_idx);
            ar_mky_a_ss = ar_a_ss(ar_y_idx);
            ar_mky_ap_ss = ar_ap_ss(ar_y_idx);
            ar_mky_mn_MPC_C_gain_share_check = ar_mn_MPC_C_gain_share_check(ar_y_idx);
            ar_mky_Phi_true = ar_Phi_true(ar_y_idx);
            ar_mky_c_ss = ar_c_ss(ar_y_idx);
            ar_mky_y_head_inc = ar_y_head_inc(ar_y_idx);
            ar_mky_y_spouse_inc = ar_y_spouse_inc(ar_y_idx);
            ar_mky_yshr_nttxss = ar_yshr_nttxss(ar_y_idx);
            
            mp_cl_ar_xyz_of_s = containers.Map('KeyType','char', 'ValueType','any');
            mp_cl_ar_xyz_of_s('y_all') = {ar_mky_y_all(:), zeros(1)};
            mp_cl_ar_xyz_of_s('age_ss') = {ar_mky_age_ss(:), zeros(1)};
            mp_cl_ar_xyz_of_s('educ_ss') = {ar_mky_educ_ss(:), zeros(1)};
            mp_cl_ar_xyz_of_s('a_ss') = {ar_mky_a_ss(:), zeros(1)};
            mp_cl_ar_xyz_of_s('ap_ss') = {ar_mky_ap_ss(:), zeros(1)};
            mp_cl_ar_xyz_of_s('MPC') = {ar_mky_mn_MPC_C_gain_share_check(:), zeros(1)};
            mp_cl_ar_xyz_of_s('Mass') = {ar_mky_Phi_true(:), zeros(1)};
            mp_cl_ar_xyz_of_s('c_ss') = {ar_mky_c_ss(:), zeros(1)};
            mp_cl_ar_xyz_of_s('y_head_inc') = {ar_mky_y_head_inc(:), zeros(1)};
            mp_cl_ar_xyz_of_s('y_spouse') = {ar_mky_y_spouse_inc(:), zeros(1)};
            mp_cl_ar_xyz_of_s('yshr_nttxss') = {ar_mky_yshr_nttxss(:), zeros(1)};
            mp_cl_ar_xyz_of_s('ar_st_y_name') = ["y_all", "age_ss", "educ_ss", "a_ss", "ap_ss", "MPC", "Mass", "c_ss", "y_head_inc", "y_spouse", "yshr_nttxss"];
            
            % controls
            mp_support = containers.Map('KeyType','char', 'ValueType','any');
            mp_support('ar_fl_percentiles') = [0.01 10 25 50 75 90 99.99];
            mp_support('bl_display_final') = true;
            mp_support('bl_display_detail') = false;
            mp_support('bl_display_drvm2outcomes') = false;
            mp_support('bl_display_drvstats') = false;
            mp_support('bl_display_drvm2covcor') = false;
            
            % Call Function
            mp_cl_mt_xyz_of_s = ff_simu_stats(ar_mky_Phi_true(:)/sum(ar_mky_Phi_true,'all'), mp_cl_ar_xyz_of_s, mp_support);            
            
            it_marital = ar_marital(it_marry_ctr);
            it_kids = ar_kids(it_kids_ctr);
            fl_y_all_start = y_all_start;
            fl_y_all_end = y_all_end;
            
            tb_dist_stats = mp_cl_mt_xyz_of_s('tb_outcomes');
            fl_age_mean = tb_dist_stats{"age_ss", "mean"};
            fl_age_p50 = tb_dist_stats{"age_ss", "p50"};
            
            fl_educ_mean = tb_dist_stats{"educ_ss", "mean"};
            
            fl_a_mean = tb_dist_stats{"a_ss", "mean"};
            fl_a_p50 = tb_dist_stats{"a_ss", "p50"};
            
            fl_ap_mean = tb_dist_stats{"ap_ss", "mean"};
            fl_ap_p50 = tb_dist_stats{"ap_ss", "p50"};
            
            fl_y_all_mean = tb_dist_stats{"y_all", "mean"};
            fl_y_all_p50 = tb_dist_stats{"y_all", "p50"};
            
            fl_mpc_mean = tb_dist_stats{"MPC", "mean"};
            fl_mpc_p50 = tb_dist_stats{"MPC", "p50"};
            
            fl_mass = tb_dist_stats{"Mass", "unweighted_sum"};
            
            fl_c_ss_mean = tb_dist_stats{"c_ss", "mean"};
            fl_c_ss_p50 = tb_dist_stats{"c_ss", "p50"};
            
            fl_y_head_inc_mean = tb_dist_stats{"y_head_inc", "mean"};
            fl_y_spouse_mean = tb_dist_stats{"y_spouse", "mean"};
                                    
            ar_store_stats = [it_marital, it_kids, fl_y_all_start, fl_y_all_end, ...
                fl_age_mean, fl_age_p50, fl_educ_mean, ...
                fl_a_mean, fl_a_p50, fl_ap_mean, fl_ap_p50, ...
                fl_y_all_mean, fl_y_all_p50, ...
                fl_mpc_mean, fl_mpc_p50, ...
                fl_mass, ...
                fl_c_ss_mean, fl_c_ss_p50, ...
                fl_y_head_inc_mean, fl_y_spouse_mean];
            
            it_row_ctr = it_row_ctr + 1;
            
            if (it_row_ctr>1)
                mt_store_stats_by_mky = [mt_store_stats_by_mky;ar_store_stats];
            else
                mt_store_stats_by_mky = [ar_store_stats];
            end
            
        end       
    end
end

  0x0 empty char array

  0x0 empty char array

-------------------------------
-------------------------------
-------------------------------
-------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-------------------------------
-------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0 and kids =0
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0, kids =0, ybin =0 to 20
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames       y_all         age_ss         educ_ss         a_ss           ap_ss          MPC           Mass           c_ss       y_head_inc    y_spouse    yshr_nttxss
    ______________________    __________    ___________    ___________    ___________    ___________    __________    ___________    __________    __________    ________    ___________

    {'mean'              }        14.688         34.974        0.18182         2.7226         2.6703       0.56785      6.739e-06        13.095        14.688        0           0.1084 
    {'unweighted_sum'    }    8.4083e+05           1909              1         2690.8     5.2986e+06         13257        0.02393     1.068e+06    8.4083e+05        0           6912.2 
    {'sd'                }        3.6764         14.501         0.3857         10.125         9.7397       0.34943      9.319e-06        3.1257        3.6764        0         0.014423 
    {'coefofvar'         }       0.25031        0.41462         2.1213         3.7189         3.6474       0.61536         1.3829       0.23869       0.25031      NaN          0.13306 
    {'gini'              }         0.141        0.23128        0.78641        0.92249        0.92536       0.34425        0.62907       0.13386         0.141      NaN         0.071967 
    {'min'               }        2.2124             19              0              0              0      0.033951              0        2.1316        2.2124        0         0.036506 
    {'max'               }            20             64              1         413.31         409.12             1     6.1059e-05        38.804            20        0          0.12612 
    {'pYis0'             }             0              0        0.81818        0.53967        0.49704             0              0             0             0        1                0 
    {'pYls0'             }             0              0              0              0              0             0              0             0             0        0                0 
    {'pYgr0'             }             1              1        0.18182        0.46033        0.50296             1              1             1             1        0                1 
    {'pYisMINY'          }    1.9988e-05       0.084859        0.81818        0.53967        0.49704             0              0    1.9988e-05    1.9988e-05        1       1.9988e-05 
    {'pYisMAXY'          }    4.7568e-12        0.01496        0.18182     1.4916e-11              0    0.00025972      0.0025217    5.0366e-12    4.7568e-12        1       4.7568e-12 
    {'p0_01'             }        2.6052             19              0              0              0         0.048     1.7416e-10        2.4992        2.6052        0           0.0407 
    {'p10'               }         9.307             20              0              0              0      0.084412     2.4733e-07        8.5591         9.307        0         0.087526 
    {'p25'               }        12.172             22              0              0              0       0.17981     7.7122e-07        11.004        12.172        0          0.10045 
    {'p50'               }        15.236             30              0              0       0.011132       0.66566     2.8295e-06        13.654        15.236        0          0.11184 
    {'p75'               }        17.778             48              0        0.23918        0.48535       0.90461        9.2e-06        15.614        17.778        0          0.11989 
    {'p90'               }         19.14             58              1          6.458         6.0051       0.96941     1.8669e-05        16.703         19.14        0          0.12379 
    {'p99_99'            }        19.999             64              1         174.36         166.76             1     6.1059e-05        24.254        19.999        0          0.12612 
    {'fl_cov_y_all'      }        13.516         5.6455      0.0023525         6.9774         7.1104      -0.53539     6.2968e-06        11.292        13.516        0         0.052502 
    {'fl_cor_y_all'      }             1         0.1059       0.001659        0.18744        0.19857      -0.41675        0.18379       0.98267             1      NaN          0.99014 
    {'fl_cov_age_ss'     }        5.6455         210.28        -1.0046         57.763         56.482       -2.7127    -7.1893e-05        6.0576        5.6455        0         0.022189 
    {'fl_cor_age_ss'     }        0.1059              1       -0.17962        0.39342        0.39991      -0.53535       -0.53201       0.13365        0.1059      NaN          0.10609 
    {'fl_cov_educ_ss'    }     0.0023525        -1.0046        0.14876       -0.29328       -0.29618      0.035745    -3.4162e-07     0.0049126     0.0023525        0       1.0001e-05 
    {'fl_cor_educ_ss'    }      0.001659       -0.17962              1        -0.0751      -0.078843       0.26522      -0.095046     0.0040749      0.001659      NaN        0.0017978 
    {'fl_cov_a_ss'       }        6.9774         57.763       -0.29328         102.52         98.523       -1.3183    -1.6308e-05        9.8651        6.9774        0         0.025753 
    {'fl_cor_a_ss'       }       0.18744        0.39342        -0.0751              1        0.99907      -0.37261       -0.17284       0.31172       0.18744      NaN          0.17635 
    {'fl_cov_ap_ss'      }        7.1104         56.482       -0.29618         98.523         94.862       -1.3069    -1.5421e-05        9.6441        7.1104        0         0.026154 
    {'fl_cor_ap_ss'      }       0.19857        0.39991      -0.078843        0.99907              1      -0.38399        -0.1699       0.31679       0.19857      NaN          0.18618 
    {'fl_cov_MPC'        }      -0.53539        -2.7127       0.035745        -1.3183        -1.3069        0.1221     1.1836e-07      -0.46327      -0.53539        0       -0.0020386 
    {'fl_cor_MPC'        }      -0.41675       -0.53535        0.26522       -0.37261       -0.38399             1       0.036348      -0.42415      -0.41675      NaN          -0.4045 
    {'fl_cov_Mass'       }    6.2968e-06    -7.1893e-05    -3.4162e-07    -1.6308e-05    -1.5421e-05    1.1836e-07     8.6844e-11    4.4666e-06    6.2968e-06        0       2.6134e-08 
    {'fl_cor_Mass'       }       0.18379       -0.53201      -0.095046       -0.17284        -0.1699      0.036348              1       0.15334       0.18379      NaN          0.19444 
    {'fl_cov_c_ss'       }        11.292         6.0576      0.0049126         9.8651         9.6441      -0.46327     4.4666e-06        9.7701        11.292        0         0.044053 
    {'fl_cor_c_ss'       }       0.98267        0.13365      0.0040749        0.31172        0.31679      -0.42415        0.15334             1       0.98267      NaN          0.97719 
    {'fl_cov_y_head_inc' }        13.516         5.6455      0.0023525         6.9774         7.1104      -0.53539     6.2968e-06        11.292        13.516        0         0.052502 
    {'fl_cor_y_head_inc' }             1         0.1059       0.001659        0.18744        0.19857      -0.41675        0.18379       0.98267             1      NaN          0.99014 
    {'fl_cov_y_spouse'   }             0              0              0              0              0             0              0             0             0        0                0 
    {'fl_cor_y_spouse'   }           NaN            NaN            NaN            NaN            NaN           NaN            NaN           NaN           NaN      NaN              NaN 
    {'fl_cov_yshr_nttxss'}      0.052502       0.022189     1.0001e-05       0.025753       0.026154    -0.0020386     2.6134e-08      0.044053      0.052502        0       0.00020802 
    {'fl_cor_yshr_nttxss'}       0.99014        0.10609      0.0017978        0.17635        0.18618       -0.4045        0.19444       0.97719       0.99014      NaN                1 
    {'fracByP0_01'       }    1.8388e-05         0.0461              0              0              0    8.2849e-06      1.295e-09     1.982e-05    1.8388e-05      NaN       3.9816e-05 
    {'fracByP10'         }      0.051228       0.088792              0              0              0      0.012201       0.001643      0.052988      0.051228      NaN         0.071457 
    {'fracByP25'         }       0.16212        0.16288              0              0              0      0.044981       0.012709       0.16609       0.16212      NaN          0.20249 
    {'fracByP50'         }       0.39701         0.3352              0              0     6.3754e-06       0.21811       0.072524       0.40439       0.39701      NaN          0.44851 
    {'fracByP75'         }       0.68371        0.60992              0       0.013023       0.018274       0.58397        0.28029       0.68314       0.68371      NaN          0.72078 
    {'fracByP90'         }       0.86704        0.84015              1        0.16055        0.12661       0.82506        0.57288       0.86826       0.86704      NaN          0.88483 
    {'fracByP99_99'      }             1              1              1        0.99661        0.99334             1              1       0.99981             1      NaN                1 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0, kids =0, ybin =20 to 40
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames        y_all         age_ss       educ_ss         a_ss           ap_ss           MPC           Mass           c_ss       y_head_inc     y_spouse    yshr_nttxss
    ______________________    ___________    __________    __________    ___________    ___________    ___________    ___________    __________    ___________    ________    ___________

    {'mean'              }         29.952        38.525       0.20638         25.273         26.927        0.17518     7.2864e-06        23.849         29.952        0           0.14657
    {'unweighted_sum'    }     1.9087e+06          1909             1         7355.4     1.8539e+07         4111.7       0.062169    2.0581e+06     1.9087e+06        0            9425.9
    {'sd'                }         5.6854        14.456        0.4047         44.204         44.499        0.25807     1.3357e-05        3.9706         5.6854        0          0.010299
    {'coefofvar'         }        0.18982       0.37522         1.961         1.7491         1.6525         1.4732         1.8332       0.16649        0.18982      NaN          0.070269
    {'gini'              }        0.10955        0.2128        0.7532        0.72521        0.71433        0.57108        0.68009      0.095458        0.10955      NaN          0.040369
    {'min'               }             20            19             0              0              0       0.032157              0        13.998             20        0           0.12612
    {'max'               }             40            64             1         890.69         885.93              1     8.3083e-05        66.847             40        0           0.16267
    {'pYis0'             }              0             0       0.79362        0.16854        0.10132              0              0             0              0        1                 0
    {'pYls0'             }              0             0             0              0              0              0              0             0              0        0                 0
    {'pYgr0'             }              1             1       0.20638        0.83146        0.89868              1              1             1              1        0                 1
    {'pYisMINY'          }    8.0995e-288      0.055295       0.79362        0.16854        0.10132              0              0    1.2849e-07    8.0995e-288        1       8.0995e-288
    {'pYisMAXY'          }     4.4783e-07      0.018337       0.20638     8.9396e-13              0     0.00033045      0.0013183    1.2298e-13     4.4783e-07        1        4.4783e-07
    {'p0_01'             }         20.004            19             0              0              0       0.038809     6.9607e-10        14.666         20.004        0           0.12613
    {'p10'               }         22.011            20             0              0              0       0.049364     3.9076e-07        18.628         22.011        0           0.13122
    {'p25'               }         25.065            25             0        0.80724         1.0692       0.053905     1.1314e-06        20.592         25.065        0           0.13815
    {'p50'               }         30.008            37             0          6.458         6.7423       0.065191     2.7151e-06        23.685         30.008        0           0.14772
    {'p75'               }         34.798            52             0         29.898          33.25        0.12717     6.0849e-06        26.866         34.798        0           0.15549
    {'p90'               }         37.826            59             1          82.04         83.859         0.5677     1.9056e-05        29.367         37.826        0           0.15981
    {'p99_99'            }         39.999            64             1         413.31         407.97              1     8.3083e-05        39.793         39.999        0           0.16267
    {'fl_cov_y_all'      }         32.324        7.6438      0.038871         72.305         78.269       -0.30518    -4.5536e-06        19.905         32.324        0          0.058292
    {'fl_cor_y_all'      }              1      0.093006      0.016894        0.28771        0.30937         -0.208      -0.059962       0.88176              1      NaN           0.99551
    {'fl_cov_age_ss'     }         7.6438        208.96      -0.73238         386.27         403.49        -1.6691     -9.611e-05         -11.1         7.6438        0          0.013838
    {'fl_cor_age_ss'     }       0.093006             1      -0.12519        0.60451        0.62727        -0.4474       -0.49775      -0.19338       0.093006      NaN          0.092947
    {'fl_cov_educ_ss'    }       0.038871      -0.73238       0.16379        -2.1597        -2.3263       0.062231     3.7003e-08       0.19764       0.038871        0        6.9651e-05
    {'fl_cor_educ_ss'    }       0.016894      -0.12519             1       -0.12073       -0.12918        0.59583      0.0068451       0.12299       0.016894      NaN          0.016711
    {'fl_cov_a_ss'       }         72.305        386.27       -2.1597           1954         1964.7        -3.0143    -0.00013723        47.044         72.305        0           0.12878
    {'fl_cor_a_ss'       }        0.28771       0.60451      -0.12073              1        0.99885       -0.26423       -0.23242       0.26804        0.28771      NaN           0.28287
    {'fl_cov_ap_ss'      }         78.269        403.49       -2.3263         1964.7         1980.1        -3.2123    -0.00014127        47.213         78.269        0           0.13941
    {'fl_cor_ap_ss'      }        0.30937       0.62727      -0.12918        0.99885              1       -0.27972       -0.23768       0.26721        0.30937      NaN           0.30419
    {'fl_cov_MPC'        }       -0.30518       -1.6691      0.062231        -3.0143        -3.2123       0.066603     6.1725e-07     -0.046711       -0.30518        0       -0.00057164
    {'fl_cor_MPC'        }         -0.208       -0.4474       0.59583       -0.26423       -0.27972              1        0.17906     -0.045585         -0.208      NaN          -0.21507
    {'fl_cov_Mass'       }    -4.5536e-06    -9.611e-05    3.7003e-08    -0.00013723    -0.00014127     6.1725e-07     1.7842e-10    3.9864e-07    -4.5536e-06        0       -8.2292e-09
    {'fl_cor_Mass'       }      -0.059962      -0.49775     0.0068451       -0.23242       -0.23768        0.17906              1     0.0075163      -0.059962      NaN         -0.059819
    {'fl_cov_c_ss'       }         19.905         -11.1       0.19764         47.044         47.213      -0.046711     3.9864e-07        15.765         19.905        0          0.036045
    {'fl_cor_c_ss'       }        0.88176      -0.19338       0.12299        0.26804        0.26721      -0.045585      0.0075163             1        0.88176      NaN           0.88145
    {'fl_cov_y_head_inc' }         32.324        7.6438      0.038871         72.305         78.269       -0.30518    -4.5536e-06        19.905         32.324        0          0.058292
    {'fl_cor_y_head_inc' }              1      0.093006      0.016894        0.28771        0.30937         -0.208      -0.059962       0.88176              1      NaN           0.99551
    {'fl_cov_y_spouse'   }              0             0             0              0              0              0              0             0              0        0                 0
    {'fl_cor_y_spouse'   }            NaN           NaN           NaN            NaN            NaN            NaN            NaN           NaN            NaN      NaN               NaN
    {'fl_cov_yshr_nttxss'}       0.058292      0.013838    6.9651e-05        0.12878        0.13941    -0.00057164    -8.2292e-09      0.036045       0.058292        0        0.00010607
    {'fl_cor_yshr_nttxss'}        0.99551      0.092947      0.016711        0.28287        0.30419       -0.21507      -0.059819       0.88145        0.99551      NaN                 1
    {'fracByP0_01'       }     0.00010275       0.02727             0              0              0     2.2051e-05     5.0134e-09    6.7429e-05     0.00010275      NaN        0.00013239
    {'fracByP10'         }       0.070196      0.052525             0              0              0       0.026727      0.0025961      0.074374       0.070196      NaN           0.08786
    {'fracByP25'         }        0.18834       0.15502             0      0.0035395      0.0030822       0.070934       0.018336       0.19784        0.18834      NaN           0.22589
    {'fracByP50'         }         0.4181       0.33724             0       0.038073       0.032523        0.15484       0.079472        0.4301         0.4181      NaN           0.46994
    {'fracByP75'         }        0.68834       0.64594             0        0.19439        0.19244         0.2768        0.21997       0.69645        0.68834      NaN           0.72868
    {'fracByP90'         }        0.87021       0.84782             1        0.53295        0.49305        0.48886        0.44898       0.87098        0.87021      NaN           0.89003
    {'fracByP99_99'      }        0.99996             1             1        0.99833        0.99827              1              1       0.99983        0.99996      NaN           0.99997

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0, kids =0, ybin =40 to 60
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames        y_all         age_ss         educ_ss         a_ss           ap_ss           MPC           Mass           c_ss       y_head_inc     y_spouse    yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    __________    ___________    ________    ___________

    {'mean'              }         49.366         41.657        0.23457         81.386         87.448       0.089225     5.2154e-06        34.743         49.366        0           0.17275
    {'unweighted_sum'    }     2.5368e+06           1909              1          13261     2.8595e+07         2580.8       0.050893    2.4868e+06     2.5368e+06        0            8836.7
    {'sd'                }         5.7595         14.091        0.42373          93.65          93.99        0.16201     9.5851e-06        4.7163         5.7595        0         0.0057052
    {'coefofvar'         }        0.11667        0.33826         1.8064         1.1507         1.0748         1.8158         1.8378       0.13575        0.11667      NaN          0.033025
    {'gini'              }       0.067274         0.1907        0.71409        0.55942        0.54841        0.44765        0.61982      0.076288       0.067274      NaN          0.019057
    {'min'               }             40             19              0              0              0       0.031691              0        16.758             40        0           0.16267
    {'max'               }             60             64              1         1394.9         1389.5        0.99999     7.9383e-05        96.304             60        0           0.18243
    {'pYis0'             }              0              0        0.76543       0.074319       0.034709              0              0             0              0        1                 0
    {'pYls0'             }              0              0              0              0              0              0              0             0              0        0                 0
    {'pYgr0'             }              1              1        0.23457        0.92568        0.96529              1              1             1              1        0                 1
    {'pYisMINY'          }     1.1988e-05       0.035852        0.76543       0.074319       0.034709              0              0    1.4781e-16     1.1988e-05        1        1.1988e-05
    {'pYisMAXY'          }     2.6918e-19       0.022889        0.23457      1.725e-14              0     0.00031473      0.0015419    2.7102e-15     2.6918e-19        1        2.6918e-19
    {'p0_01'             }         40.004             19              0              0              0       0.036579     7.4515e-10        19.928         40.004        0           0.16268
    {'p10'               }         41.738             22              0         1.9135         4.1783       0.043656     4.7242e-07        28.811         41.738        0           0.16483
    {'p25'               }         44.289             28              0         10.255         15.829       0.045968     1.2398e-06         31.53         44.289        0           0.16781
    {'p50'               }         49.163             43              0         51.664         56.522       0.049672     2.3015e-06        34.546         49.163        0           0.17297
    {'p75'               }         54.155             54              0         122.46         130.25       0.056328     5.1823e-06        37.865         54.155        0           0.17763
    {'p90'               }         57.677             60              1         205.07         213.83       0.066175     1.0332e-05         40.83         57.677        0            0.1806
    {'p99_99'            }         59.997             64              1         729.18         718.69        0.99999     7.9383e-05        57.866         59.997        0           0.18243
    {'fl_cov_y_all'      }         33.172         5.7383       0.031749         121.07         129.84       -0.09046    -4.8663e-06        17.041         33.172        0          0.032789
    {'fl_cor_y_all'      }              1       0.070707       0.013009        0.22446        0.23985      -0.096943      -0.088148       0.62733              1      NaN           0.99787
    {'fl_cov_age_ss'     }         5.7383         198.55       -0.52991         911.38         944.69       -0.71366    -5.8353e-05       -28.838         5.7383        0         0.0057148
    {'fl_cor_age_ss'     }       0.070707              1      -0.088752        0.69065        0.71331       -0.31261       -0.43205      -0.43394       0.070707      NaN          0.071088
    {'fl_cov_educ_ss'    }       0.031749       -0.52991        0.17955        -5.8166         -6.252       0.029802    -1.5517e-07       0.46008       0.031749        0        3.1401e-05
    {'fl_cor_educ_ss'    }       0.013009      -0.088752              1       -0.14658       -0.15698        0.43412      -0.038205       0.23022       0.013009      NaN          0.012989
    {'fl_cov_a_ss'       }         121.07         911.38        -5.8166         8770.3         8794.3        -2.9986    -0.00023117        70.248         121.07        0           0.11935
    {'fl_cor_a_ss'       }        0.22446        0.69065       -0.14658              1        0.99911       -0.19763       -0.25753       0.15905        0.22446      NaN           0.22339
    {'fl_cov_ap_ss'      }         129.84         944.69         -6.252         8794.3           8834        -3.2391    -0.00023793        61.265         129.84        0           0.12801
    {'fl_cor_ap_ss'      }        0.23985        0.71331       -0.15698        0.99911              1       -0.21271        -0.2641       0.13821        0.23985      NaN           0.23873
    {'fl_cov_MPC'        }       -0.09046       -0.71366       0.029802        -2.9986        -3.2391       0.026249     2.8905e-07        0.1701       -0.09046        0       -9.0262e-05
    {'fl_cor_MPC'        }      -0.096943       -0.31261        0.43412       -0.19763       -0.21271              1        0.18613       0.22261      -0.096943      NaN         -0.097652
    {'fl_cov_Mass'       }    -4.8663e-06    -5.8353e-05    -1.5517e-07    -0.00023117    -0.00023793     2.8905e-07     9.1875e-11    2.9641e-06    -4.8663e-06        0        -4.853e-09
    {'fl_cor_Mass'       }      -0.088148       -0.43205      -0.038205       -0.25753        -0.2641        0.18613              1      0.065569      -0.088148      NaN         -0.088745
    {'fl_cov_c_ss'       }         17.041        -28.838        0.46008         70.248         61.265         0.1701     2.9641e-06        22.243         17.041        0          0.016858
    {'fl_cor_c_ss'       }        0.62733       -0.43394        0.23022        0.15905        0.13821        0.22261       0.065569             1        0.62733      NaN           0.62653
    {'fl_cov_y_head_inc' }         33.172         5.7383       0.031749         121.07         129.84       -0.09046    -4.8663e-06        17.041         33.172        0          0.032789
    {'fl_cor_y_head_inc' }              1       0.070707       0.013009        0.22446        0.23985      -0.096943      -0.088148       0.62733              1      NaN           0.99787
    {'fl_cov_y_spouse'   }              0              0              0              0              0              0              0             0              0        0                 0
    {'fl_cor_y_spouse'   }            NaN            NaN            NaN            NaN            NaN            NaN            NaN           NaN            NaN      NaN               NaN
    {'fl_cov_yshr_nttxss'}       0.032789      0.0057148     3.1401e-05        0.11935        0.12801    -9.0262e-05     -4.853e-09      0.016858       0.032789        0        3.2549e-05
    {'fl_cor_yshr_nttxss'}        0.99787       0.071088       0.012989        0.22339        0.23873      -0.097652      -0.088745       0.62653        0.99787      NaN                 1
    {'fracByP0_01'       }     8.1986e-05       0.016353              0              0              0     6.9754e-05     7.4643e-09    5.7619e-05     8.1986e-05      NaN        9.5274e-05
    {'fracByP10'         }       0.082731       0.059676              0     0.00080736      0.0015529       0.046758       0.004399      0.077181       0.082731      NaN          0.094865
    {'fracByP25'         }        0.21327        0.13822              0       0.013027       0.018312        0.12219       0.028324       0.20818        0.21327      NaN           0.23919
    {'fracByP50'         }        0.44964        0.36454              0        0.12623        0.11331        0.25588        0.11397       0.44613        0.44964      NaN           0.48575
    {'fracByP75'         }         0.7111        0.65402              0        0.38755        0.36658        0.40319        0.29739       0.70689         0.7111      NaN           0.73947
    {'fracByP90'         }        0.88093        0.85769              1        0.66284         0.6549        0.50458        0.48353       0.87532        0.88093      NaN           0.89495
    {'fracByP99_99'      }        0.99988              1              1        0.99951        0.99913              1              1       0.99983        0.99988      NaN           0.99989

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0, kids =0, ybin =60 to 80
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames        y_all         age_ss         educ_ss         a_ss           ap_ss           MPC           Mass           c_ss        y_head_inc     y_spouse    yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ________    ___________

    {'mean'              }         69.288         43.863        0.26092          158.1         169.53       0.055771     3.3078e-06         44.768         69.288        0           0.18871
    {'unweighted_sum'    }     3.0245e+06           1909              1          20103     3.6714e+07         2041.2       0.034644     2.8234e+06     3.0245e+06        0            8196.6
    {'sd'                }         5.7381          13.54        0.43913         144.91         144.63       0.053076      5.264e-06         5.8757         5.7381        0         0.0036391
    {'coefofvar'         }       0.082816        0.30869          1.683        0.91655        0.85316        0.95167         1.5914        0.13125       0.082816      NaN          0.019284
    {'gini'              }       0.047737        0.17193        0.67675        0.46696        0.45774        0.20088         0.5372       0.072954       0.047737      NaN          0.011131
    {'min'               }             60             19              0              0              0       0.031467              0         19.049             60        0           0.18243
    {'max'               }         79.999             64              1         1913.5         1907.3        0.90442     5.5135e-05         126.58         79.999        0           0.19507
    {'pYis0'             }              0              0        0.73908       0.036459      0.0062838              0              0              0              0        1                 0
    {'pYls0'             }              0              0              0              0              0              0              0              0              0        0                 0
    {'pYgr0'             }              1              1        0.26092        0.96354        0.99372              1              1              1              1        0                 1
    {'pYisMINY'          }     7.0785e-08       0.024362        0.73908       0.036459      0.0062838              0              0     2.2641e-14     7.0785e-08        1        7.0785e-08
    {'pYisMAXY'          }     1.0527e-08       0.027901        0.26092     8.7298e-17              0     6.3868e-06      0.0015737     3.8128e-17     1.0527e-08        1        1.0527e-08
    {'p0_01'             }         60.004             19              0              0              0        0.03566     6.5204e-10         25.481         60.004        0           0.18243
    {'p10'               }         61.586             23              0         10.255         18.691       0.039942      4.507e-07         37.462         61.586        0           0.18363
    {'p25'               }         64.221             32              0         39.794         54.138       0.043098     1.0418e-06         41.077         64.221        0           0.18553
    {'p50'               }          68.93             46              0         122.46         134.97       0.047033     1.9366e-06         44.608          68.93        0           0.18869
    {'p75'               }         74.224             56              1         239.18         250.88       0.052935     4.1555e-06         48.379         74.224        0           0.19191
    {'p90'               }         77.547             61              1         363.77          373.3       0.059583     5.7439e-06         51.905         77.547        0           0.19377
    {'p99_99'            }         79.989             64              1         1074.4         1050.1         0.8324     5.5135e-05         75.619         79.989        0           0.19507
    {'fl_cov_y_all'      }         32.926         4.1151       0.027108         145.03         154.46      -0.032152    -2.7754e-06         15.819         32.926        0          0.020855
    {'fl_cor_y_all'      }              1       0.052966       0.010758        0.17442        0.18612       -0.10557      -0.091883        0.46921              1      NaN           0.99874
    {'fl_cov_age_ss'     }         4.1151         183.33       -0.37329         1400.5           1438        -0.1128    -2.3008e-05        -34.276         4.1151        0         0.0026153
    {'fl_cor_age_ss'     }       0.052966              1      -0.062782        0.71382        0.73429       -0.15696       -0.32281       -0.43083       0.052966      NaN          0.053079
    {'fl_cov_educ_ss'    }       0.027108       -0.37329        0.19284        -9.2359        -9.7931      0.0061122    -3.5426e-07        0.57801       0.027108        0         1.697e-05
    {'fl_cor_educ_ss'    }       0.010758      -0.062782              1       -0.14514       -0.15419        0.26224       -0.15325        0.22402       0.010758      NaN          0.010619
    {'fl_cov_a_ss'       }         145.03         1400.5        -9.2359          20999          20944       -0.71422    -0.00016592         165.89         145.03        0          0.091765
    {'fl_cor_a_ss'       }        0.17442        0.71382       -0.14514              1         0.9993      -0.092863       -0.21751        0.19483        0.17442      NaN           0.17402
    {'fl_cov_ap_ss'      }         154.46           1438        -9.7931          20944          20919       -0.79413    -0.00016774          143.5         154.46        0           0.09774
    {'fl_cor_ap_ss'      }        0.18612        0.73429       -0.15419         0.9993              1       -0.10345       -0.22031        0.16886        0.18612      NaN            0.1857
    {'fl_cov_MPC'        }      -0.032152        -0.1128      0.0061122       -0.71422       -0.79413       0.002817     3.0754e-08       0.055227      -0.032152        0       -2.0711e-05
    {'fl_cor_MPC'        }       -0.10557       -0.15696        0.26224      -0.092863       -0.10345              1        0.11007        0.17709       -0.10557      NaN          -0.10723
    {'fl_cov_Mass'       }    -2.7754e-06    -2.3008e-05    -3.5426e-07    -0.00016592    -0.00016774     3.0754e-08      2.771e-11    -3.0872e-07    -2.7754e-06        0       -1.7727e-09
    {'fl_cor_Mass'       }      -0.091883       -0.32281       -0.15325       -0.21751       -0.22031        0.11007              1     -0.0099813      -0.091883      NaN         -0.092538
    {'fl_cov_c_ss'       }         15.819        -34.276        0.57801         165.89          143.5       0.055227    -3.0872e-07         34.524         15.819        0          0.010023
    {'fl_cor_c_ss'       }        0.46921       -0.43083        0.22402        0.19483        0.16886        0.17709     -0.0099813              1        0.46921      NaN           0.46875
    {'fl_cov_y_head_inc' }         32.926         4.1151       0.027108         145.03         154.46      -0.032152    -2.7754e-06         15.819         32.926        0          0.020855
    {'fl_cor_y_head_inc' }              1       0.052966       0.010758        0.17442        0.18612       -0.10557      -0.091883        0.46921              1      NaN           0.99874
    {'fl_cov_y_spouse'   }              0              0              0              0              0              0              0              0              0        0                 0
    {'fl_cor_y_spouse'   }            NaN            NaN            NaN            NaN            NaN            NaN            NaN            NaN            NaN      NaN               NaN
    {'fl_cov_yshr_nttxss'}       0.020855      0.0026153      1.697e-05       0.091765        0.09774    -2.0711e-05    -1.7727e-09       0.010023       0.020855        0        1.3243e-05
    {'fl_cor_yshr_nttxss'}        0.99874       0.053079       0.010619        0.17402         0.1857       -0.10723      -0.092538        0.46875        0.99874      NaN                 1
    {'fracByP0_01'       }     0.00013554       0.010553              0              0              0     6.7618e-05     1.0101e-08     9.7466e-05     0.00013554      NaN        0.00015131
    {'fracByP10'         }       0.087755       0.048541              0      0.0025063      0.0045134       0.068841      0.0062933        0.07744       0.087755      NaN          0.096997
    {'fracByP25'         }         0.2241        0.14456              0       0.028727       0.036738        0.18113       0.039007        0.20955         0.2241      NaN           0.24383
    {'fracByP50'         }        0.46426        0.38247              0        0.18419        0.17359        0.38294        0.15519        0.44925        0.46426      NaN           0.49166
    {'fracByP75'         }        0.72225        0.68941              1        0.48388        0.44892        0.60575        0.37051        0.70837        0.72225      NaN           0.74374
    {'fracByP90'         }        0.88703        0.88024              1        0.74634        0.71602        0.75586          0.594        0.87577        0.88703      NaN           0.89757
    {'fracByP99_99'      }        0.99995              1              1        0.99979        0.99936        0.99985              1        0.99982        0.99995      NaN           0.99996

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0, kids =0, ybin =80 to 100
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames        y_all         age_ss         educ_ss         a_ss           ap_ss           MPC           Mass           c_ss        y_head_inc     y_spouse    yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    ________    ___________

    {'mean'              }         89.313         45.289        0.28587         244.08         261.11       0.048107     2.2848e-06         54.456         89.313        0           0.19943
    {'unweighted_sum'    }     3.4629e+06           1909              1          26756     4.4356e+07         1766.5       0.023174     3.1451e+06     3.4629e+06        0            7699.4
    {'sd'                }         5.7791         13.023        0.45183          194.1         192.85      0.0098838     2.9454e-06          7.052         5.7791        0         0.0025681
    {'coefofvar'         }       0.064706        0.28755         1.5805        0.79522        0.73856        0.20545         1.2891         0.1295       0.064706      NaN          0.012877
    {'gini'              }       0.037295        0.15841         0.6408         0.4125        0.40399       0.094078        0.48336       0.071333       0.037295      NaN         0.0074322
    {'min'               }         80.001             19              0              0              0       0.031354              0         20.801         80.001        0           0.19507
    {'max'               }            100             64              1         2377.1         2370.2        0.29632      3.439e-05         156.57            100        0           0.20394
    {'pYis0'             }              0              0        0.71413       0.020853     1.1851e-17              0              0              0              0        1                 0
    {'pYls0'             }              0              0              0              0              0              0              0              0              0        0                 0
    {'pYgr0'             }              1              1        0.28587        0.97915              1              1              1              1              1        0                 1
    {'pYisMINY'          }              0       0.018972        0.71413       0.020853     1.1851e-17              0              0     8.8801e-20              0        1                 0
    {'pYisMAXY'          }     3.7911e-06        0.02925        0.28587     1.1813e-15              0     2.6766e-08      0.0014681     8.4036e-18     3.7911e-06        1        3.7911e-06
    {'p0_01'             }         80.012             19              0              0        0.79044       0.035088      5.263e-10         29.908         80.012        0           0.19508
    {'p10'               }          81.54             25              0         29.898         43.522       0.038754     3.7394e-07         45.822          81.54        0           0.19586
    {'p25'               }          84.27             35              0         100.91         114.23       0.042327     7.8217e-07         50.182          84.27        0           0.19721
    {'p50'               }         88.922             48              0         205.07         224.41       0.046616     1.6088e-06          54.23         88.922        0           0.19938
    {'p75'               }         94.198             56              1         363.77         378.89       0.052372     3.0806e-06         58.463         94.198        0           0.20165
    {'p90'               }         97.585             61              1         525.49         536.58       0.057987     4.5762e-06         63.016         97.585        0           0.20301
    {'p99_99'            }            100             64              1         1281.9         1273.4        0.16243      3.439e-05         93.578            100        0           0.20394
    {'fl_cov_y_all'      }         33.398         2.1956       0.039297         150.26         159.68     -0.0031027    -1.4164e-06         15.988         33.398        0          0.014829
    {'fl_cor_y_all'      }              1       0.029174        0.01505        0.13396        0.14327       -0.05432      -0.083209        0.39229              1      NaN           0.99914
    {'fl_cov_age_ss'     }         2.1956         169.59       -0.29823         1813.9         1849.7       0.051957    -8.0012e-06        -34.182         2.1956        0         0.0010034
    {'fl_cor_age_ss'     }       0.029174              1      -0.050684        0.71759        0.73653        0.40366       -0.20859        -0.3722       0.029174      NaN          0.030003
    {'fl_cov_educ_ss'    }       0.039297       -0.29823        0.20415        -12.356        -12.922      0.0006815    -3.1745e-07        0.59583       0.039297        0        1.7131e-05
    {'fl_cor_educ_ss'    }        0.01505      -0.050684              1       -0.14089        -0.1483        0.15261       -0.23854          0.187        0.01505      NaN          0.014763
    {'fl_cov_a_ss'       }         150.26         1813.9        -12.356          37675          37410        0.63872    -9.5448e-05         378.89         150.26        0          0.066952
    {'fl_cor_a_ss'       }        0.13396        0.71759       -0.14089              1        0.99942        0.33294       -0.16695        0.27681        0.13396      NaN           0.13431
    {'fl_cov_ap_ss'      }         159.68         1849.7        -12.922          37410          37190        0.64022    -9.4333e-05         341.32         159.68        0          0.071142
    {'fl_cor_ap_ss'      }        0.14327        0.73653        -0.1483        0.99942              1        0.33588       -0.16607        0.25098        0.14327      NaN           0.14365
    {'fl_cov_MPC'        }     -0.0031027       0.051957      0.0006815        0.63872        0.64022     9.7689e-05     2.4949e-09     -0.0038564     -0.0031027        0       -1.4015e-06
    {'fl_cor_MPC'        }       -0.05432        0.40366        0.15261        0.33294        0.33588              1       0.085701      -0.055329       -0.05432      NaN         -0.055214
    {'fl_cov_Mass'       }    -1.4164e-06    -8.0012e-06    -3.1745e-07    -9.5448e-05    -9.4333e-05     2.4949e-09     8.6755e-12    -2.1934e-06    -1.4164e-06        0       -6.3643e-10
    {'fl_cor_Mass'       }      -0.083209       -0.20859       -0.23854       -0.16695       -0.16607       0.085701              1        -0.1056      -0.083209      NaN         -0.084137
    {'fl_cov_c_ss'       }         15.988        -34.182        0.59583         378.89         341.32     -0.0038564    -2.1934e-06         49.731         15.988        0         0.0070893
    {'fl_cor_c_ss'       }        0.39229        -0.3722          0.187        0.27681        0.25098      -0.055329        -0.1056              1        0.39229      NaN           0.39145
    {'fl_cov_y_head_inc' }         33.398         2.1956       0.039297         150.26         159.68     -0.0031027    -1.4164e-06         15.988         33.398        0          0.014829
    {'fl_cor_y_head_inc' }              1       0.029174        0.01505        0.13396        0.14327       -0.05432      -0.083209        0.39229              1      NaN           0.99914
    {'fl_cov_y_spouse'   }              0              0              0              0              0              0              0              0              0        0                 0
    {'fl_cor_y_spouse'   }            NaN            NaN            NaN            NaN            NaN            NaN            NaN            NaN            NaN      NaN               NaN
    {'fl_cov_yshr_nttxss'}       0.014829      0.0010034     1.7131e-05       0.066952       0.071142    -1.4015e-06    -6.3643e-10      0.0070893       0.014829        0        6.5954e-06
    {'fl_cor_yshr_nttxss'}        0.99914       0.030003       0.014763        0.13431        0.14365      -0.055214      -0.084137        0.39145        0.99914      NaN                 1
    {'fracByP0_01'       }     0.00042007      0.0079591              0              0     5.0103e-07     0.00014006      1.196e-08     5.6865e-05     0.00042007      NaN        0.00045866
    {'fracByP10'         }       0.090622        0.05099              0      0.0059303      0.0081038        0.07731      0.0074828       0.077704       0.090622      NaN          0.098184
    {'fracByP25'         }        0.22976        0.15254              0       0.060679       0.052596        0.20406       0.046599        0.21075        0.22976      NaN           0.24587
    {'fracByP50'         }        0.47206        0.40219              0        0.22278         0.2121        0.43521        0.18099        0.45112        0.47206      NaN           0.49443
    {'fracByP75'         }        0.72831        0.67181              1        0.53644        0.49268        0.69113        0.41129        0.70931        0.72831      NaN           0.74581
    {'fracByP90'         }        0.88939        0.87436              1        0.78432        0.74554        0.86193        0.66032        0.87534        0.88939      NaN           0.89802
    {'fracByP99_99'      }              1              1              1        0.99942        0.99946        0.99982              1        0.99982              1      NaN                 1

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Marital =0, kids =0, ybin =100 to 1414.0634
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxx tb_outcomes: all stats xxx
    OriginalVariableNames        y_all         age_ss         educ_ss         a_ss           ap_ss           MPC           Mass           c_ss       y_head_inc     y_spouse    yshr_nttxss
    ______________________    ___________    ___________    ___________    ___________    ___________    ___________    ___________    __________    ___________    ________    ___________

    {'mean'              }         164.25         47.879        0.35462         603.16         641.93       0.047297     1.0098e-06        89.131         164.25        0           0.21736
    {'unweighted_sum'    }     1.6654e+08           1909              1     1.2935e+05     1.4733e+09          21152       0.051769    1.0533e+08     1.6654e+08        0        1.1132e+05
    {'sd'                }         74.664         11.785         0.4784         524.59         535.23       0.006722     1.1944e-06        35.746         74.664        0         0.0095293
    {'coefofvar'         }        0.45456        0.24615          1.349        0.86973        0.83377        0.14212         1.1829       0.40105        0.45456      NaN          0.043841
    {'gini'              }        0.20972        0.13265        0.54013        0.41585        0.40991       0.081083        0.52084       0.19064        0.20972      NaN          0.024642
    {'min'               }            100             19              0              0         2.6604    -1.6475e-08              0         22.71            100        0           0.20394
    {'max'               }         1413.7             64              1         7837.6         8386.2       0.079842     1.9906e-05        509.49         1413.7        0           0.25232
    {'pYis0'             }              0              0        0.64538       0.008464              0              0              0             0              0        1                 0
    {'pYls0'             }              0              0              0              0              0     2.1631e-06              0             0              0        0                 0
    {'pYgr0'             }              1              1        0.35462        0.99154              1              1              1             1              1        0                 1
    {'pYisMINY'          }     8.0846e-15      0.0084319        0.64538       0.008464              0     2.5357e-08              0             0     8.0846e-15        1        8.0846e-15
    {'pYisMAXY'          }      9.784e-09       0.035671        0.35462     2.5784e-05     2.8187e-09     0.00031034     0.00038015    1.0085e-08      9.784e-09        1         9.784e-09
    {'p0_01'             }         100.01             19              0              0         8.3907       0.030058     8.0069e-11        37.405         100.01        0           0.20394
    {'p10'               }         105.91             30              0         122.46         146.14       0.038675      8.553e-08        59.877         105.91        0           0.20608
    {'p25'               }         116.38             40              0         239.18         290.41       0.042108     2.7755e-07         66.59         116.38        0           0.20946
    {'p50'               }         140.36             50              0         467.15         508.34       0.046702     6.6267e-07        78.834         140.36        0           0.21572
    {'p75'               }         184.67             58              1         807.24         835.48       0.052106      1.346e-06         99.86         184.67        0           0.22377
    {'p90'               }          250.3             62              1         1175.1         1271.8       0.056993       2.41e-06        130.74          250.3        0           0.23122
    {'p99_99'            }         1005.7             64              1         6140.4         6451.7       0.079842     1.9906e-05        472.26         1005.7        0           0.25018
    {'fl_cov_y_all'      }         5574.6         82.616         3.9383          27029          28687     -0.0039422    -3.2407e-05          2511         5574.6        0           0.64609
    {'fl_cor_y_all'      }              1       0.093888        0.11026         0.6901        0.71786     -0.0078548       -0.36338       0.94083              1      NaN           0.90808
    {'fl_cov_age_ss'     }         82.616          138.9      -0.051378         3187.5         3233.7       0.067815    -4.7599e-07         15.67         82.616        0          0.011641
    {'fl_cor_age_ss'     }       0.093888              1     -0.0091126        0.51557        0.51265        0.85602      -0.033813      0.037196       0.093888      NaN           0.10365
    {'fl_cov_educ_ss'    }         3.9383      -0.051378        0.22886         1.1548         1.8629    -2.0374e-06    -1.5824e-07        2.2388         3.9383        0        0.00050086
    {'fl_cor_educ_ss'    }        0.11026     -0.0091126              1      0.0046015      0.0072754    -0.00063355       -0.27693       0.13092        0.11026      NaN           0.10987
    {'fl_cov_a_ss'       }          27029         3187.5         1.1548     2.7519e+05     2.8051e+05         1.5699    -0.00016835         14895          27029        0            3.1347
    {'fl_cor_a_ss'       }         0.6901        0.51557      0.0046015              1        0.99906        0.44519       -0.26869       0.79429         0.6901      NaN           0.62707
    {'fl_cov_ap_ss'      }          28687         3233.7         1.8629     2.8051e+05     2.8647e+05         1.5747    -0.00017615         15495          28687        0            3.3246
    {'fl_cor_ap_ss'      }        0.71786        0.51265      0.0072754        0.99906              1        0.43769       -0.27554       0.80987        0.71786      NaN           0.65183
    {'fl_cov_MPC'        }     -0.0039422       0.067815    -2.0374e-06         1.5699         1.5747     4.5185e-05     9.0958e-10    -0.0078019     -0.0039422        0       -2.0849e-07
    {'fl_cor_MPC'        }     -0.0078548        0.85602    -0.00063355        0.44519        0.43769              1        0.11329     -0.032469     -0.0078548      NaN        -0.0032548
    {'fl_cov_Mass'       }    -3.2407e-05    -4.7599e-07    -1.5824e-07    -0.00016835    -0.00017615     9.0958e-10     1.4267e-12    -1.649e-05    -3.2407e-05        0       -4.9329e-09
    {'fl_cor_Mass'       }       -0.36338      -0.033813       -0.27693       -0.26869       -0.27554        0.11329              1       -0.3862       -0.36338      NaN          -0.43339
    {'fl_cov_c_ss'       }           2511          15.67         2.2388          14895          15495     -0.0078019     -1.649e-05        1277.8           2511        0           0.29398
    {'fl_cor_c_ss'       }        0.94083       0.037196        0.13092        0.79429        0.80987      -0.032469        -0.3862             1        0.94083      NaN           0.86303
    {'fl_cov_y_head_inc' }         5574.6         82.616         3.9383          27029          28687     -0.0039422    -3.2407e-05          2511         5574.6        0           0.64609
    {'fl_cor_y_head_inc' }              1       0.093888        0.11026         0.6901        0.71786     -0.0078548       -0.36338       0.94083              1      NaN           0.90808
    {'fl_cov_y_spouse'   }              0              0              0              0              0              0              0             0              0        0                 0
    {'fl_cor_y_spouse'   }            NaN            NaN            NaN            NaN            NaN            NaN            NaN           NaN            NaN      NaN               NaN
    {'fl_cov_yshr_nttxss'}        0.64609       0.011641     0.00050086         3.1347         3.3246    -2.0849e-07    -4.9329e-09       0.29398        0.64609        0        9.0808e-05
    {'fl_cor_yshr_nttxss'}        0.90808        0.10365        0.10987        0.62707        0.65183     -0.0032548       -0.43339       0.86303        0.90808      NaN                 1
    {'fracByP0_01'       }     7.5135e-05       0.003346              0              0      1.097e-06     2.6055e-05      4.202e-09    4.6635e-05     7.5135e-05      NaN        0.00011578
    {'fracByP10'         }       0.062666       0.056801              0       0.013271       0.012935       0.078221      0.0037878      0.061502       0.062666      NaN          0.094321
    {'fracByP25'         }        0.16403        0.16984              0       0.057688       0.064153        0.20659       0.030364       0.16822        0.16403      NaN           0.23774
    {'fracByP50'         }        0.35792        0.40929              0          0.223        0.21964        0.44142         0.1443       0.37128        0.35792      NaN            0.4821
    {'fracByP75'         }        0.60086        0.72112              1        0.50267        0.47584        0.70175        0.38621       0.61807        0.60086      NaN           0.73457
    {'fracByP90'         }        0.79433        0.90509              1        0.70917        0.71292        0.87411        0.64573       0.80764        0.79433      NaN           0.89132
    {'fracByP99_99'      }        0.99932              1              1        0.99885        0.99887              1              1       0.99945        0.99932 ...

1.12 Store Aggregate To File

Store Several Files:

  1. Overall Aggregate Statistics All Distribution

  2. Aggregate Statistics Only for 18 to 64 year olds

  3. Group Statistics by Kids

  4. Group Statistics by Marital + Kids

  5. Group Statistics by Marital + Kids + Income Bins

if (bl_save_csv)
    % All Stats All Ages
    mp_path = snw_mp_path('fan');
    spt_simu_results_csv = mp_path('spt_simu_results_csv');
    writetable(tb_dist_stats_all, [spt_simu_results_csv 'stats_all_allages.csv'], 'WriteRowNames', true);
    % All Stats 18 to 64 Year old
    mp_path = snw_mp_path('fan');
    spt_simu_results_csv = mp_path('spt_simu_results_csv');
    writetable(tb_dist_stats_all_18to64, [spt_simu_results_csv 'stats_all_18t64.csv'], 'WriteRowNames', true);
    % Group by K: Kids only
    tb_store_stats_by_k = array2table(mt_store_stats_by_k, 'VariableNames', ...
        {'kids', 'married_mean' ...
        'age_mean', 'age_p50', 'educ_mean', ...
        'a_mean', 'a_p50', 'ap_mean', 'ap_p50', ...
        'y_all_mean', 'y_all_p50', ...
        'mpc_mean', 'mpc_p50', ...
        'mass',...
        'c_ss_mean', 'c_ss_p50', ...
        'y_head_inc_mean', 'y_spouse_mean'});
    mp_path = snw_mp_path('fan');
    spt_simu_results_csv = mp_path('spt_simu_results_csv');
    writetable(tb_store_stats_by_k, [spt_simu_results_csv 'stats_by_kids.csv']);
    % Group by MK: marry + kids only
    tb_store_stats_by_mk = array2table(mt_store_stats_by_mk, 'VariableNames', ...
        {'marital', 'kids', ...
        'age_mean', 'age_p50', 'educ_mean', ...
        'a_mean', 'a_p50', 'ap_mean', 'ap_p50', ...
        'y_all_mean', 'y_all_p50', ...
        'mpc_mean', 'mpc_p50', ...
        'mass',...
        'c_ss_mean', 'c_ss_p50', ...
        'y_head_inc_mean', 'y_spouse_mean'});
    mp_path = snw_mp_path('fan');
    spt_simu_results_csv = mp_path('spt_simu_results_csv');
    writetable(tb_store_stats_by_mk, [spt_simu_results_csv 'stats_by_marital_kids.csv']);
    % Group by MKY
    tb_store_stats_by_mky = array2table(mt_store_stats_by_mky, 'VariableNames', ...
        {'marital', 'kids', 'y_all_start', 'y_all_end', ...
        'age_mean', 'age_p50', 'educ_mean', ...
        'a_mean', 'a_p50', 'ap_mean', 'ap_p50', ...
        'y_all_mean', 'y_all_p50', ...
        'mpc_mean', 'mpc_p50', ...
        'mass',...
        'c_ss_mean', 'c_ss_p50', ...
        'y_head_inc_mean', 'y_spouse_mean'});
    mp_path = snw_mp_path('fan');
    spt_simu_results_csv = mp_path('spt_simu_results_csv');
    writetable(tb_store_stats_by_mky, [spt_simu_results_csv 'stats_by_marital_kids_20kincbins.csv']);
end

1.13 Store Key Stats to Compare to Key US Distributional Statistics

Earning, income and Wealth.

Income = interest earnings + Social Security + labor income + spousal income. This is equal to y_all.

Earnings = labor income + spousal income.

% Income Variable
if (min(abs(total_inc_VFI*58.056 - y_all), [], 'all')>0)
    error('someothing is wrong, total_inc_VFI should be equal to y_all');
end
income = y_all;
% Earning variable
% earn*fl_earn_ratio generated earn_VFI
earning = (mp_valpol_more_ss('earn_VFI') + spouse_inc_VFI)*58.056;
% Wealth Varaible 
wealth = a_ss;

Generate Key Statistics for these three variables only, distributional Statistics Overall All Ages:

% construct input data
income_grp = income(min_age:82, :, :, : ,: ,:);
earning_grp = earning(min_age:82, :, :, : ,: ,:);
wealth_grp = wealth(min_age:82, :, :, : ,: ,:);
Phi_true_grp = Phi_true_1(min_age:82, :, :, : ,: ,:);

mp_cl_ar_xyz_of_s = containers.Map('KeyType','char', 'ValueType','any');
mp_cl_ar_xyz_of_s('earning') = {earning_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('income') = {income_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('wealth') = {wealth_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('earninglog') = {log(earning_grp(:)), zeros(1)};
mp_cl_ar_xyz_of_s('incomelog') = {log(income_grp(:)), zeros(1)};
mp_cl_ar_xyz_of_s('wealthlog') = {log(wealth_grp(:)), zeros(1)};
mp_cl_ar_xyz_of_s('ar_st_y_name') = ["earning", "income", "wealth", "earninglog", "incomelog", "wealthlog"];

% controls
mp_support = containers.Map('KeyType','char', 'ValueType','any');
mp_support('ar_fl_percentiles') = [20 30 40 60 50 80 90 95 99];
mp_support('bl_display_final') = true;
mp_support('bl_display_detail') = false;    
mp_support('bl_display_drvm2outcomes') = false;  
mp_support('bl_display_drvstats') = false;
mp_support('bl_display_drvm2covcor') = false;

% Call Function     
mp_cl_mt_xyz_of_s = ff_simu_stats(Phi_true_grp(:)/sum(Phi_true_grp,'all'), mp_cl_ar_xyz_of_s, mp_support);

xxx tb_outcomes: all stats xxx
    OriginalVariableNames     earning        income        wealth      earninglog    incomelog     wealthlog 
    _____________________    __________    __________    __________    __________    __________    __________

    {'mean'             }        72.136        84.974        245.22          -Inf        4.1042          -Inf
    {'unweighted_sum'   }    9.5943e+07    7.9255e+09    1.2935e+05          -Inf    1.1455e+08          -Inf
    {'sd'               }        80.749        84.549        391.42           NaN       0.81216           NaN
    {'coefofvar'        }        1.1194         0.995        1.5962           NaN       0.19789           NaN
    {'gini'             }       0.51369       0.44243       0.68023           NaN       0.11243           NaN
    {'min'              }             0        2.2124             0          -Inf       0.79408          -Inf
    {'max'              }          2640        2953.5        7837.6        7.8785        7.9907        8.9667
    {'pYis0'            }       0.10578             0       0.12285             0             0             0
    {'pYls0'            }             0             0             0       0.10695             0       0.16897
    {'pYgr0'            }       0.89422             1       0.87715       0.89305             1       0.83103
    {'pYisMINY'         }       0.10578     6.774e-07       0.12285       0.10578     6.774e-07       0.12285
    {'pYisMAXY'         }    1.5964e-10     1.671e-12    6.0119e-06    1.5964e-10     1.671e-12    6.0119e-06
    {'p20'              }        15.969        29.216        3.7372        2.7707        3.3747        1.3183
    {'p30'              }        29.464        38.184        15.308        3.3832        3.6424        2.7284
    {'p40'              }        40.761        48.225        39.794        3.7077        3.8759        3.6837
    {'p60'              }        65.423        74.426        146.89        4.1809        4.3098        4.9897
    {'p50'              }        52.252        59.948         82.04        3.9561        4.0935        4.4072
    {'p80'              }        108.96        122.39        413.31         4.691        4.8072        6.0242
    {'p90'              }         159.7        176.61        729.18        5.0733        5.1739        6.5919
    {'p95'              }        211.84        233.69        979.69        5.3558         5.454        6.8872
    {'p99'              }        356.31        398.22        1773.5        5.8758         5.987        7.4807
    {'fl_cov_earning'   }        6520.5        6671.7        8382.5           NaN        53.875           NaN
    {'fl_cor_earning'   }             1       0.97721       0.26521           NaN       0.82149           NaN
    {'fl_cov_income'    }        6671.7        7148.6         15059           NaN        57.878           NaN
    {'fl_cor_income'    }       0.97721             1       0.45504           NaN       0.84286           NaN
    {'fl_cov_wealth'    }        8382.5         15059    1.5321e+05           NaN        141.72           NaN
    {'fl_cor_wealth'    }       0.26521       0.45504             1           NaN        0.4458           NaN
    {'fl_cov_earninglog'}           NaN           NaN           NaN           NaN           NaN           NaN
    {'fl_cor_earninglog'}           NaN           NaN           NaN           NaN           NaN           NaN
    {'fl_cov_incomelog' }        53.875        57.878        141.72           NaN       0.65961           NaN
    {'fl_cor_incomelog' }       0.82149       0.84286        0.4458           NaN             1           NaN
    {'fl_cov_wealthlog' }           NaN           NaN           NaN           NaN           NaN           NaN
    {'fl_cor_wealthlog' }           NaN           NaN           NaN           NaN           NaN           NaN
    {'fracByP20'        }      0.012671       0.04827    0.00074821           NaN       0.14532           NaN
    {'fracByP30'        }      0.044498       0.08795     0.0041711           NaN       0.23096           NaN
    {'fracByP40'        }      0.093262       0.13869      0.016749           NaN       0.32262           NaN
    {'fracByP60'        }       0.23895       0.28076      0.095501           NaN       0.52207           NaN
    {'fracByP50'        }       0.15762       0.20209      0.045325           NaN       0.41971           NaN
    {'fracByP80'        }       0.47178       0.50479       0.32852           NaN       0.74357           NaN
    {'fracByP90'        }       0.65353        0.6766       0.56651           NaN       0.86486           NaN
    {'fracByP95'        }       0.78022       0.79527       0.70071           NaN       0.92947           NaN
    {'fracByP99'        }       0.92468       0.93132       0.90524           NaN       0.98459           NaN

tb_dist_stats_all = mp_cl_mt_xyz_of_s('tb_outcomes');
% Select columns
tb_dist_stats_all_save = tb_dist_stats_all(1:3,:);
ar_st_columns = ["coefofvar", "gini", "varianceoflog", ...
                 "p99p50ratio", "p90p50ratio", "meantomedian", "p50p30ratio", ...
                 "fracP0toP20", "fracP20toP40", "fracP40toP60", "fracP60toP80", "fracP80toP100", ...
                 "fracP90toP95", "fracP95toP99", "fracP99toP100"];
                 
varianceoflog = tb_dist_stats_all{4:6,"sd"}.^2;

p99p50ratio = tb_dist_stats_all_save{:,"p99"}./tb_dist_stats_all_save{:,"p50"};
p90p50ratio = tb_dist_stats_all_save{:,"p90"}./tb_dist_stats_all_save{:,"p50"};
meantomedian = tb_dist_stats_all_save{:,"mean"}./tb_dist_stats_all_save{:,"p50"};
p50p30ratio = tb_dist_stats_all_save{:,"p50"}./tb_dist_stats_all_save{:,"p30"};
fracP0toP20 = tb_dist_stats_all_save{:,"fracByP20"};
fracP20toP40 = tb_dist_stats_all_save{:,"fracByP40"} - tb_dist_stats_all_save{:,"fracByP20"};
fracP40toP60 = tb_dist_stats_all_save{:,"fracByP60"} - tb_dist_stats_all_save{:,"fracByP40"};
fracP60toP80 = tb_dist_stats_all_save{:,"fracByP80"} - tb_dist_stats_all_save{:,"fracByP60"};
fracP80toP100 = 1 - tb_dist_stats_all_save{:,"fracByP80"};

fracP90toP95 = tb_dist_stats_all_save{:,"fracByP95"} - tb_dist_stats_all_save{:,"fracByP90"};
fracP95toP99 = tb_dist_stats_all_save{:,"fracByP99"} - tb_dist_stats_all_save{:,"fracByP95"};
fracP99toP100 = 1 - tb_dist_stats_all_save{:,"fracByP99"};

tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, varianceoflog, 'Before', 'gini');
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, p99p50ratio);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, p90p50ratio);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, meantomedian);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, p50p30ratio);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP0toP20);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP20toP40);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP40toP60);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP60toP80);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP80toP100);

tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP90toP95);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP95toP99);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP99toP100);
disp(tb_dist_stats_all_save(:, ar_st_columns));

               coefofvar     gini      varianceoflog    p99p50ratio    p90p50ratio    meantomedian    p50p30ratio    fracP0toP20    fracP20toP40    fracP40toP60    fracP60toP80    fracP80toP100    fracP90toP95    fracP95toP99    fracP99toP100
               _________    _______    _____________    ___________    ___________    ____________    ___________    ___________    ____________    ____________    ____________    _____________    ____________    ____________    _____________

    earning     1.1194      0.51369           NaN          6.819         3.0563          1.3805         1.7734         0.012671        0.08059         0.14569        0.23283          0.52822         0.12669         0.14446         0.075321   
    income       0.995      0.44243       0.65961         6.6427          2.946          1.4174           1.57          0.04827       0.090424         0.14207        0.22404          0.49521         0.11867         0.13605         0.068676   
    wealth      1.5962      0.68023           NaN         21.618         8.8881           2.989         5.3594       0.00074821       0.016001        0.078752        0.23302          0.67148          0.1342         0.20454         0.094756   

% Core Stats Table
if (bl_save_csv)
    mp_path = snw_mp_path('fan');
    spt_simu_results_csv = mp_path('spt_simu_results_csv');
    writetable(tb_dist_stats_all_save(:, ar_st_columns), [spt_simu_results_csv 'stats_all_allages_vrrcore.csv'], 'WriteRowNames', true);
end

Statistics overall distributionally for 18 to 64 year olds.

% construct input data
income_grp = income(min_age:max_age, :, :, : ,: ,:);
earning_grp = earning(min_age:max_age, :, :, : ,: ,:);
wealth_grp = wealth(min_age:max_age, :, :, : ,: ,:);
Phi_true_grp = Phi_true_1(min_age:max_age, :, :, : ,: ,:);

mp_cl_ar_xyz_of_s = containers.Map('KeyType','char', 'ValueType','any');
mp_cl_ar_xyz_of_s('income') = {income_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('earning') = {earning_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('wealth') = {wealth_grp(:), zeros(1)};
mp_cl_ar_xyz_of_s('earninglog') = {log(earning_grp(:)), zeros(1)};
mp_cl_ar_xyz_of_s('incomelog') = {log(income_grp(:)), zeros(1)};
mp_cl_ar_xyz_of_s('wealthlog') = {log(wealth_grp(:)), zeros(1)};
mp_cl_ar_xyz_of_s('ar_st_y_name') = ["earning", "income", "wealth", "earninglog", "incomelog", "wealthlog"];

% controls
mp_support = containers.Map('KeyType','char', 'ValueType','any');
mp_support('ar_fl_percentiles') = [20 30 40 60 50 80 90 95 99];
mp_support('bl_display_final') = true;
mp_support('bl_display_detail') = false;    
mp_support('bl_display_drvm2outcomes') = false;  
mp_support('bl_display_drvstats') = false;
mp_support('bl_display_drvm2covcor') = false;

% Call Function     
mp_cl_mt_xyz_of_s = ff_simu_stats(Phi_true_grp(:)/sum(Phi_true_grp,'all'), mp_cl_ar_xyz_of_s, mp_support);

xxx tb_outcomes: all stats xxx
    OriginalVariableNames     earning        income        wealth      earninglog    incomelog     wealthlog 
    _____________________    __________    __________    __________    __________    __________    __________

    {'mean'             }        87.466        95.246         194.5        4.1711        4.2425          -Inf
    {'unweighted_sum'   }     9.394e+07    7.7487e+09    1.2935e+05    1.5445e+06     1.116e+08          -Inf
    {'sd'               }        82.434        89.631         344.5       0.76834       0.79264           NaN
    {'coefofvar'        }       0.94247       0.94104        1.7712        0.1842       0.18683           NaN
    {'gini'             }         0.417       0.42428       0.71579       0.10382        0.1055           NaN
    {'min'              }        2.2124        2.2124             0       0.79408       0.79408          -Inf
    {'max'              }          2640        2953.5        7837.6        7.8785        7.9907        8.9667
    {'pYis0'            }             0             0       0.14627             0             0             0
    {'pYls0'            }             0             0             0             0             0       0.20232
    {'pYgr0'            }             1             1       0.85373             1             1       0.79768
    {'pYisMINY'         }     8.617e-07    8.6135e-07       0.14627     8.617e-07    8.6135e-07       0.14627
    {'pYisMAXY'         }    2.0299e-10    2.1248e-12    5.4766e-06    2.0299e-10    2.1248e-12    5.4766e-06
    {'p20'              }        34.093        35.624       0.80724        3.5291         3.573      -0.21413
    {'p30'              }        43.249        45.828         6.458         3.767        3.8249        1.8653
    {'p40'              }        52.993        56.888        29.898        3.9702        4.0411        3.3978
    {'p60'              }        77.857        85.184        100.91        4.3549        4.4448        4.6142
    {'p50'              }         64.26         69.57        51.664        4.1629        4.2423        3.9448
    {'p80'              }        124.43        137.12        318.35        4.8237        4.9209        5.7632
    {'p90'              }        175.33         192.9        588.48        5.1667        5.2621        6.3775
    {'p95'              }        227.34        250.34        890.69        5.4265        5.5228         6.792
    {'p99'              }        384.15        427.18        1640.6         5.951        6.0572        7.4028
    {'fl_cov_earning'   }        6795.4        7319.6         13105          53.1        53.884           NaN
    {'fl_cor_earning'   }             1       0.99065       0.46144       0.83837       0.82467           NaN
    {'fl_cov_income'    }        7319.6        8033.6         17852        58.043        59.852           NaN
    {'fl_cor_income'    }       0.99065             1       0.57814       0.84283       0.84246           NaN
    {'fl_cov_wealth'    }         13105         17852    1.1868e+05        123.58         149.2           NaN
    {'fl_cor_wealth'    }       0.46144       0.57814             1       0.46687        0.5464           NaN
    {'fl_cov_earninglog'}          53.1        58.043        123.58       0.59034        0.6043           NaN
    {'fl_cor_earninglog'}       0.83837       0.84283       0.46687             1       0.99226           NaN
    {'fl_cov_incomelog' }        53.884        59.852         149.2        0.6043       0.62827           NaN
    {'fl_cor_incomelog' }       0.82467       0.84246        0.5464       0.99226             1           NaN
    {'fl_cov_wealthlog' }           NaN           NaN           NaN           NaN           NaN           NaN
    {'fl_cor_wealthlog' }           NaN           NaN           NaN           NaN           NaN           NaN
    {'fracByP20'        }      0.053802      0.050961    0.00014055       0.14882       0.14762           NaN
    {'fracByP30'        }      0.098055      0.093694     0.0021143       0.23646       0.23488           NaN
    {'fracByP40'        }         0.153       0.14753      0.015697        0.3292       0.32764           NaN
    {'fracByP60'        }       0.30069       0.29468      0.079605       0.52874       0.52766           NaN
    {'fracByP50'        }       0.21981       0.21374      0.034043       0.42667       0.42529           NaN
    {'fracByP80'        }       0.52452       0.52079       0.28918       0.74816        0.7478           NaN
    {'fracByP90'        }       0.69236       0.69054       0.51495       0.86758       0.86757           NaN
    {'fracByP95'        }       0.80576       0.80501       0.69371       0.93096       0.93099           NaN
    {'fracByP99'        }       0.93293       0.93437       0.90041       0.98483       0.98492           NaN

tb_dist_stats_all = mp_cl_mt_xyz_of_s('tb_outcomes');
% Select columns
tb_dist_stats_all_save = tb_dist_stats_all(1:3,:);
ar_st_columns = ["coefofvar", "gini", "varianceoflog", ...
                 "p99p50ratio", "p90p50ratio", "meantomedian", "p50p30ratio", ...
                 "fracP0toP20", "fracP20toP40", "fracP40toP60", "fracP60toP80", "fracP80toP100", ...
                 "fracP90toP95", "fracP95toP99", "fracP99toP100"];
                 
varianceoflog = tb_dist_stats_all{4:6,"sd"}.^2;

p99p50ratio = tb_dist_stats_all_save{:,"p99"}./tb_dist_stats_all_save{:,"p50"};
p90p50ratio = tb_dist_stats_all_save{:,"p90"}./tb_dist_stats_all_save{:,"p50"};
meantomedian = tb_dist_stats_all_save{:,"mean"}./tb_dist_stats_all_save{:,"p50"};
p50p30ratio = tb_dist_stats_all_save{:,"p50"}./tb_dist_stats_all_save{:,"p30"};
fracP0toP20 = tb_dist_stats_all_save{:,"fracByP20"};
fracP20toP40 = tb_dist_stats_all_save{:,"fracByP40"} - tb_dist_stats_all_save{:,"fracByP20"};
fracP40toP60 = tb_dist_stats_all_save{:,"fracByP60"} - tb_dist_stats_all_save{:,"fracByP40"};
fracP60toP80 = tb_dist_stats_all_save{:,"fracByP80"} - tb_dist_stats_all_save{:,"fracByP60"};
fracP80toP100 = 1 - tb_dist_stats_all_save{:,"fracByP80"};

fracP90toP95 = tb_dist_stats_all_save{:,"fracByP95"} - tb_dist_stats_all_save{:,"fracByP90"};
fracP95toP99 = tb_dist_stats_all_save{:,"fracByP99"} - tb_dist_stats_all_save{:,"fracByP95"};
fracP99toP100 = 1 - tb_dist_stats_all_save{:,"fracByP99"};

tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, varianceoflog, 'Before', 'gini');
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, p99p50ratio);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, p90p50ratio);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, meantomedian);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, p50p30ratio);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP0toP20);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP20toP40);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP40toP60);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP60toP80);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP80toP100);

tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP90toP95);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP95toP99);
tb_dist_stats_all_save = addvars(tb_dist_stats_all_save, fracP99toP100);
disp(tb_dist_stats_all_save(:, ar_st_columns));

               coefofvar     gini      varianceoflog    p99p50ratio    p90p50ratio    meantomedian    p50p30ratio    fracP0toP20    fracP20toP40    fracP40toP60    fracP60toP80    fracP80toP100    fracP90toP95    fracP95toP99    fracP99toP100
               _________    _______    _____________    ___________    ___________    ____________    ___________    ___________    ____________    ____________    ____________    _____________    ____________    ____________    _____________

    earning     0.94247       0.417       0.59034          5.978         2.7285          1.3611         1.4858         0.053802       0.099195         0.14769        0.22383          0.47548          0.1134         0.12718          0.06707   
    income      0.94104     0.42428       0.62827         6.1403         2.7727          1.3691         1.5181         0.050961       0.096569         0.14715        0.22612          0.47921         0.11447         0.12936         0.065628   
    wealth       1.7712     0.71579           NaN         31.755         11.391          3.7648              8       0.00014055       0.015557        0.063908        0.20958          0.71082         0.17876         0.20671         0.099586   

% Core Stats Table
if (bl_save_csv)
    mp_path = snw_mp_path('fan');
    spt_simu_results_csv = mp_path('spt_simu_results_csv');
    writetable(tb_dist_stats_all_save(:, ar_st_columns), [spt_simu_results_csv 'stats_all_18t64_vrrcore.csv'], 'WriteRowNames', true);
end