-------------
      name:  <unnamed>
       log:  B:\OtherDatabase\pvp3\output\logs\matchtest2_070714.smcl
  log type:  smcl
 opened on:   8 Jul 2014, 10:27:17

.
. encode bgname, gen(bgcode) //recode bgname to ordinal variable

. destring bgname, gen(bgnum) //recode bgname to non-ordinal number
bgname has all characters numeric; bgnum generated as double

. format bgcode bgnum %20.0g

. lab var bgcode "ordinal block group number"

. lab var bgnum "non-ordinal block group number"

.
. codebook sfla age acres saleyear bgname bgcode bgnum

-------------
sflasquare feet of living area
-------------

                  type:  numeric (float)

                 range:  [1002,4992]                  units:  1
         unique values:  3272                     missing .:  0/22579

                  mean:   2086.52
              std. dev:   761.168

           percentiles:        10%       25%       50%       75%       90%
                              1250      1520      1930      2496      3161

-------------
ageage at sale
-------------

                  type:  numeric (float)

                 range:  [-2,100]                     units:  1
         unique values:  103                      missing .:  0/22579

                  mean:   18.8163
              std. dev:   21.2492

           percentiles:        10%       25%       50%       75%       90%
                                 0         4        11        27        51

-------------
acresACRES
-------------

                  type:  numeric (double)

                 range:  [.0502,9.99]                 units:  .0001
         unique values:  3890                     missing .:  0/22579

                  mean:   .468794
              std. dev:   .892257

           percentiles:        10%       25%       50%       75%       90%
                               .11       .14     .2059       .36       .93

-------------
saleyearyear of sale
-------------

                  type:  numeric (float)

                 range:  [2003,2014]                  units:  1
         unique values:  12                       missing .:  0/22579

                  mean:   2011.18
              std. dev:   1.72188

           percentiles:        10%       25%       50%       75%       90%
                              2009      2010      2012      2012      2013

-------------
bgnamecensus block group - text
-------------

                  type:  string (str13)

         unique values:  359                      missing "":  0/22579

              examples:  "1211991120010"
                         "2404301030030"
                         "4101700110010"
                         "4103336120040"

-------------
bgcodeordinal block group number
-------------

                  type:  numeric (long)
label  :  bgcode

                 range:  [1,359]                      units:  1
         unique values:  359                      missing .:  0/22579

 examples:               58    1211991120010
                         100   2404301030030
                         226   4101700110010
                         254   4103336120040

-------------
bgnumnon-ordinal block group number
-------------

                  type:  numeric (double)

                 range:  [9.001e+11,4.213e+12]        units:  10
         unique values:  359                      missing .:  0/22579

                  mean:   2.9e+12
              std. dev:   1.3e+12

           percentiles:        10%       25%       50%       75%       90%
                           1.2e+12   1.2e+12   3.7e+12   4.1e+12   4.1e+12

. tabstat sfla age acres saleyear bgcode bgnum, ///
>         stat(n mean sd min q max) by(pv) col(stat)

Summary for variables: sfla age acres saleyear bgcode bgnum
     by categories of: pv (home has pv)

pv   |         N      mean        sd       min       p25       p50       p75       max
-------+--------------------------------------------------------------------------------
non-pv   |     22142  2080.846  757.6969      1002      1518      1927      2484      4992
       |     22142  18.73968  21.17049        -2         4        11        27       100
       |     22142  .4587137  .8739862     .0502       .14     .2008     .3551      9.99
       |     22142  2011.173  1.714171      2003      2010      2012      2012      2013
       |     22142  164.3014  104.8376         1        59       181       249       359
       |     22142  2.90e+12  1.34e+12  9.00e+11  1.21e+12  3.70e+12  4.10e+12  4.21e+12
-------+--------------------------------------------------------------------------------
pv   |       437  2374.124  874.0255      1004      1690      2215      2900      4926
       |       437  22.70023  24.63196        -1         4        14        35       100
       |       437  .9795595  1.473106       .06       .19     .3511      1.02       8.5
       |       437  2011.304   2.07349      2004      2010      2012      2013      2014
       |       437  184.9153  99.68726         1       107       185       268       359
       |       437  3.28e+12  1.07e+12  9.00e+11  2.50e+12  3.71e+12  4.10e+12  4.21e+12
-------+--------------------------------------------------------------------------------
Total   |     22579  2086.522  761.1684      1002      1520      1930      2496      4992
       |     22579  18.81633  21.24922        -2         4        11        27       100
       |     22579  .4687943  .8922566     .0502       .14     .2059       .36      9.99
       |     22579  2011.176  1.721876      2003      2010      2012      2012      2014
       |     22579  164.7003  104.7767         1        59       182       249       359
       |     22579  2.90e+12  1.34e+12  9.00e+11  1.21e+12  3.70e+12  4.10e+12  4.21e+12
-------+--------------------------------------------------------------------------------

.
. set seed 20555444

. imb sfla bestages1 acres fullbaths, tr(pv)

Multivariate L1 distance: .81363984

Univariate imbalance:

                 L1    mean     min     25%     50%     75%     max
       sfla  .18272  293.28       2     172     288     416     -66
bestages1sq  .10108   321.3       0       0      75     496       0
      acres  .25484  .52085   .0098     .05   .1503   .6649   -1.49
  fullbaths  .15077  .37898       0       1       0       1      -1

.
. *cem 1 - with bgname
. set seed 20555444 //was not sure if this mattered

. cem sfla(0 1000 2000 5000) age(0 1 10 20 100) acres(0.05 0.15 0.5 1 10) ///
> saleyear(#0) bgname(#0) , tr(pv)
(using the  break method for imbalance)

Matching Summary:
-----------------
Number of strata: 333
Number of matched strata: 136

               0      1
      All  22142    437
  Matched  17828    425
Unmatched   4314     12


Multivariate L1 distance: .94648102

Univariate imbalance:

               L1     mean      min      25%      50%      75%      max
    sfla   .11056   56.041        2       51       60       52      -66
     age   .10388   1.2152        1       -1        0        1        0
   acres   .10643   .05575    .0098      .01    .0371    -.009     -1.4
saleyear  4.8e-15  7.7e-12        1        0        0        0        0
  bgname        0        0        .        .        .        .        .

.
. rename cem_strata cem1s

. rename cem_matched cem1m

. rename cem_weights cem1w

. lab var cem1s "cem1 assigned strata"

. lab var cem1m "observation matched in cem1"

. lab var cem1w "cem1 stratum weight - 0=unmatched, 1=pv"

.
. *cem 2 - with bgcode
. set seed 20555444 //was not sure if this mattered

. cem sfla(0 1000 2000 5000) age(0 1 10 20 100) acres(0.05 0.15 0.5 1 10) ///
> saleyear(#0) bgcode(#0) , tr(pv)
(using the  break method for imbalance)

Matching Summary:
-----------------
Number of strata: 5283
Number of matched strata: 256

               0      1
      All  22142    437
  Matched   1684    277
Unmatched  20458    160


Multivariate L1 distance: .81589546

Univariate imbalance:

               L1     mean      min      25%      50%      75%      max
    sfla   .13876   51.475        2       93       71      148      -41
     age   .07363  -.44292        1       -1       -1       -3        0
   acres   .09348   .10654    .0098    .0068    .0168     .009    -1.35
saleyear  9.3e-16  1.5e-11        1        0        0        0        0
  bgcode  4.0e-16  8.5e-14        0        0        0        0        0

.
. rename cem_strata cem2s

. rename cem_matched cem2m

. rename cem_weights cem2w

. lab var cem2s "cem2 assigned strata"

. lab var cem2m "observation matched in cem2"

. lab var cem2w "cem2 stratum weight - 0=unmatched, 1=pv"

.
. *cem 3 - with bgnum
. set seed 20555444 //was not sure if this mattered

. cem sfla(0 1000 2000 5000) age(0 1 10 20 100) acres(0.05 0.15 0.5 1 10) ///
> saleyear(#0) bgnum(#0) , tr(pv)
(using the  break method for imbalance)

Matching Summary:
-----------------
Number of strata: 1510
Number of matched strata: 249

               0      1
      All  22142    437
  Matched   8838    384
Unmatched  13304     53


Multivariate L1 distance: .93327024

Univariate imbalance:

                L1      mean       min       25%       50%       75%       max
    sfla    .10464     39.94         2        22        19        44       -51
     age    .08811    .35752         1        -1        -1        -1         0
   acres    .08478      .086     .0098     .0074     -.001    -.0009      -1.4
saleyear   4.0e-15  -5.8e-11         1         0         0         0         0
   bgnum   3.6e-15  -1.2e+08         0  -6.3e+08    -20900    -50020         0

.
. rename cem_strata cem3s

. rename cem_matched cem3m

. rename cem_weights cem3w

. lab var cem3s "cem3 assigned strata"

. lab var cem3m "observation matched in cem3"

. lab var cem3w "cem3 stratum weight - 0=unmatched, 1=pv"

.
. keep fipscode apnunformatted sfla age acres saleyear bgname bgcode bgnum pv cem*

.
. cd "B:\OtherDatabase\pvp3\data\cem"
B:\OtherDatabase\pvp3\data\cem

. save cemtest2_070714.dta, replace
file cemtest2_070714.dta saved

.
. log close
      name:  <unnamed>
       log:  B:\OtherDatabase\pvp3\output\logs\matchtest2_070714.smcl
  log type:  smcl
 closed on:   8 Jul 2014, 10:28:20
-------------