Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error while using synth_runner

    Hello STATAlist!

    I have a data of 8 states for the years of 2005-2017. My data is balanced across years, one state is treated:
    Click image for larger version

Name:	Screenshot 2023-10-02 at 5.29.42 PM.png
Views:	1
Size:	11.9 KB
ID:	1728863


    When I use the synth_runner for estimation, I receive an error of "Error estimating treatment effect for unit 13 invalid syntax". I use set trace on to see the error and:
    Click image for larger version

Name:	Screenshot 2023-10-02 at 5.31.47 PM.png
Views:	1
Size:	11.1 KB
ID:	1728864


    I do not know how to move from there, thanks in advance







  • #2
    Can you post the data using dataex and include the command you used? Otherwise, it will be impossible or very hard to diagnose what's going wrong.

    Comment


    • #3
      Sure my data ex:


      Code:
      input byte stateicp float(d_emp age_mom agesq d_ofmar n_kids educcat racecat real_family_inc_2005 year_)
       4  .6225429 33.992783 1193.3091  .8275691 1.8908932  2.069669  .4325703  97722.12 2005
       4  .7138088 34.612263 1228.1073  .7382291 1.9822558 2.1431835 .17340127  87865.04 2006
       4  .6999115 36.083553 1326.8845  .8757426 2.1323473 2.0589054 .18821894  93674.02 2007
       4  .7501005  34.72286 1232.9038  .7782469 2.3116205 2.0637314 .11891837  83230.49 2008
       4  .6596317 33.208572 1139.3619  .6161301 2.0012922 2.0211048 .16743836  68376.46 2009
       4   .707846 33.245377 1147.8837  .7401658 1.9294068  1.826281 .25706995  70791.44 2010
       4  .6426944 36.287384 1346.0974  .8459129 2.0273426  2.385645  .4720877  94581.47 2011
       4  .7269849 34.269615 1194.8544 .58625543 2.1109416 2.0586374  .2331418  68280.47 2012
       4  .7598351  33.82025 1173.5034  .6097789 1.9256276  2.163919  .1656051   86921.2 2013
       4  .6469848 32.642704 1103.2893  .5900793 2.0285785   1.92912 .40287045  75837.89 2014
       4  .7345612  33.10211 1127.8656  .6408451 1.9995937  2.097779 .53358614 73962.586 2015
       4  .7968575  34.66923 1216.7196  .7232644 2.1011705 1.9844476 .51002085 100967.48 2016
       4  .6867607  32.46715 1089.5363  .5740345 2.0788085 1.8924042  .1921049  105188.6 2017
      13  .5980265  34.28546 1210.9543  .6693674  2.069261 1.7869273 1.1045276  77756.54 2005
      13  .6305875 34.179367 1204.7618  .6897163 2.1013079 1.7054485 1.1058419  72417.37 2006
      13   .599062 34.307514  1211.852  .7010666 2.0675662 1.7982987   .995384  78792.63 2007
      13  .6417923 34.249264 1209.9258  .6971883 2.0109904 1.8184017 1.0260825  77334.48 2008
      13  .6039123  34.71301 1240.0906  .6624686 2.0266314 1.8499974   1.11263  80225.67 2009
      13  .5895364 34.176365 1204.4803  .6203563 2.0654223 1.7272936 1.1777148  68436.03 2010
      13  .6584397  34.27689 1210.4694  .6243628 2.0165513  1.908673 1.1478276  73026.31 2011
      13  .6315764   34.1762 1204.8383  .6373869 2.0956502  1.853596 1.1748055  69733.44 2012
      13  .6069895 34.207375 1206.2183  .6359243 2.0772781  1.837158 1.1743898 77560.805 2013
      13  .6694835 34.796513  1245.165  .6204635 2.0920873  1.887237  1.276852 75770.555 2014
      13   .653001 34.640522 1234.9045  .6177253 2.0282688 1.9465064 1.1413703  80474.33 2015
      13  .6182925 34.467106 1223.6936 .58453435  2.037208 1.9152153 1.2363067  78499.23 2016
      13  .6724656  34.62927 1237.2755  .6524082  1.973051  1.893594 1.1880343  87871.15 2017
      36  .7083427  33.03176 1121.1927  .8107806  2.257213  1.888392  .6806084  75482.23 2005
      36  .6793131  34.08267 1190.9708   .869409  2.384585 2.0419328  .3194888  51257.08 2006
      36  .9028554 32.649284 1100.5513  .6495965  2.049348  2.080385         0  57664.26 2007
      36  .6855544 31.161945 1005.4586  .6991955  2.009269 1.8683106  .4783141  53960.99 2008
      36  .6389428 30.090204  940.9326  .6981086  2.057711  1.650582 1.0133365  61035.75 2009
      36  .7900813 32.002098 1041.5234  .8483338 2.2256625 1.9483075 .13224876  64543.05 2010
      36 .55266184  34.90387 1250.8326  .8226733  2.536959  2.296821  .2374569  95107.15 2011
      36  .6763926  31.81786  1044.642  .5061892 1.8545535 2.1368258  .3065871  69141.81 2012
      36  .9065614  32.81312 1098.6399  .7030731 1.9499584 2.3438537  .2061877  60232.09 2013
      36 .59397376 34.100834 1179.1295  .8129475  2.405131 2.3123507  .4874702  94566.38 2014
      36  .6199221 32.863384 1109.8901  .8441848 2.4440734 2.1814134  .6919866 102955.02 2015
      36  .6617446 33.315014 1131.2024  .7074105 2.3593109 2.1044571  .4965819  55088.44 2016
      36  .7536639  32.66533 1105.4375  .7032725  2.234491 1.8590645   .392893  75943.24 2017
      37  .8937768 30.791845    985.48  .7210301 2.2528613 1.8226037 .14628041  65418.41 2005
      37  .7646201  33.07087 1130.3702   .626708 2.2858443  2.149754 .23027875  63117.64 2006
      37  .6318923 32.131763 1061.2454  .7432048 2.1019933 1.8400207 1.0574683  44507.15 2007
      37  .7287303 32.249546 1075.2844  .6265839 2.0175848  1.746315  .7530385  61519.38 2008
      37  .7540178  32.03195 1065.3411    .72301 2.1493666  2.092267  .6710153  55623.45 2009
      37  .8403996 34.138645 1202.7921  .6866472 2.1966374 2.0852826 .18128654  56863.25 2010
      37  .7479294 32.047535 1048.7832  .7952827  2.546093 2.0405114 .57526106   55290.6 2011
      37  .6613643 33.536533 1151.9938  .6629819  2.610407 1.9555136  .5796711  55132.09 2012
      37  .8614879 32.058365 1052.7135  .6528977 2.4889026  1.742499  .7780518  47196.27 2013
      37   .936478  33.12107 1112.2651  .4440252 1.7301887 1.8654088  .2235849  60275.87 2014
      37  .5955597 33.238007 1139.0082  .5357864  2.403819 1.9759355  .6098432  59927.22 2015
      37  .7427473 33.663754 1171.7368  .7944775 2.3039148 1.9730864  .6906676  58713.21 2016
      37  .7960756 31.939484 1046.9294   .725839   2.04713  2.032826  .8030442  59638.11 2017
      63  .6362415  33.03628 1128.4825  .7034264   2.59689 1.7111048   .611671  55845.81 2005
      63  .6246282 33.722107 1167.5853  .9123251 2.1942945 1.8704703  .5242868  63390.05 2006
      63  .6786771 32.758293 1105.0856  .8388282  2.491987 1.6533632 .58436257  62047.73 2007
      63  .7304497 31.424147 1015.9352  .7504967 2.4183674 1.5636626   .697309  49925.68 2008
      63  .5730291 32.873882 1108.3254  .8873471  2.620105 1.7271045  .8023435   66685.6 2009
      63  .6421033 33.196945 1138.5275  .6526574  2.207595 1.7801546  .6856389   55812.2 2010
      63  .5129791 32.907143 1118.8005  .7066202  2.412282 1.7043554  .8012195  48471.25 2011
      63  .5868702 32.732418 1102.1122  .7605327  2.325364 1.8456507  .6667705  58192.23 2012
      63  .6308663 33.094242 1116.7926   .777744 2.3799345 1.8544154  .7543166  56641.93 2013
      63  .6855853 33.117584 1120.1265   .714096  2.502922 1.6294492  .7506641  60058.59 2014
      63  .6338113  33.38775 1146.0038  .7393964  2.492831  1.750426  .6379224  64236.02 2015
      63  .5606948 34.966904 1250.6178  .8452051  2.968034  2.048823  .6356254  79507.79 2016
      63  .6837485 33.123215 1122.1667  .6814006 2.4720294 1.8587178  .3905676 72335.664 2017
      64  .6790811 32.563347 1100.5992  .7718413 2.2878525  1.521058  .9653672  48322.06 2005
      64  .6077431 33.303684 1135.8147  .8661001  2.259868 1.8100095  .3728045  50913.55 2006
      64  .8587393 32.801003 1103.6047  .6118911   2.12149 1.6982808  .3624642  42990.41 2007
      64  .6197535  32.63904 1110.8838  .6499375 2.1452045 1.6945883  .8444365  55105.08 2008
      64  .6181617  32.30024 1084.7511  .7334684  1.983054 1.4291767 1.0679684  37630.29 2009
      64  .7571754   33.4328 1144.1454  .7230068 2.3506453 2.0463173  .5889142  58762.14 2010
      64       .73 34.430637 1210.5327  .7074468  2.377447      2.11 1.0089362  46238.95 2011
      64  .6106038 34.570545 1219.7352  .7755523  2.818557 1.9575847 .08159058  64674.59 2012
      64  .8332026  31.69041 1028.5898  .6014436  1.985564 1.7279147  .7685549  45102.88 2013
      64  .6436931 34.803967  1248.877 .57087123 2.3813393 1.9071846 1.3315995  48726.74 2014
      64  .6991166  34.31134 1200.3179  .9120245  2.610781  1.985578  .4716063  67159.45 2015
      64  .7958222  33.39312 1144.2714  .6539972 1.9853934 2.0332966  .3397204  62095.88 2016
      64  .7303477 33.524754 1146.1521   .600907  2.425737  1.909864  .7637944  56525.41 2017
      67  .6255674 33.275234 1143.4249  .7457827   2.55512  1.652749  .5969848  57379.96 2005
      67  .6415901 33.172188 1135.7423   .802829 2.6081674 1.9001882 .59071463  72384.77 2006
      67  .5932954 32.493855 1089.6553  .7349778  2.416599 1.7429295  .8175206  66328.71 2007
      67  .6413313 33.092197 1123.9586  .8296851  2.563848 1.8193997   .455773  66442.65 2008
      67  .6082521 34.065083 1186.4305  .8314906  2.716906 1.8380742  .7025832  70507.64 2009
      67  .5869985  33.21787 1127.0902  .8210363  2.432261  1.871696  .7704873  60892.85 2010
      67 .56404096  32.81957  1102.768  .7577955  2.604378 1.7915156  .6678753  56879.52 2011
      67  .6132573 33.933025 1181.5502  .8039371  2.853388  1.772852  .4799979 66555.914 2012
      67  .5361913 32.710075  1099.688  .7442746  2.473617  1.858738  .9680781  62836.74 2013
      67 .56833726  34.05072 1189.5487  .7330179  2.676016 2.0143256   .606324  68942.13 2014
      67  .5836326 33.438675 1146.3676  .8244096  2.755142 1.9795407 .58336055  70540.18 2015
      67 .58227736 34.144703 1191.8617   .778316  2.676599 1.9473684  .6989145  68103.85 2016
      67 .58219117 34.457428 1216.9158  .7753018  2.493374 1.9970953  .8103386  72877.95 2017
      68 .57569295 32.149963 1060.4122   .732054  2.137882 1.5579246  .4655295   44827.3 2005
      68  .7239594  29.81971  926.2842  .5990943 1.9370283  1.349795  .4934225  45318.91 2006
      68  .6959694   30.7262  972.0028  .4492703 2.1674774  1.814107  .3728284  48382.39 2007
      68  .6444127 31.774366 1049.5901  .8218493 1.8964655  1.723313  .2906105  57253.76 2008
      68  .8070282  34.57316 1232.0466  .8018782 2.3453498 2.1026962   .177219  75565.46 2009
      68  .8334212 33.080654 1122.5557  .7967844 2.1251976 1.7453874 .27095413  65681.52 2010
      68  .8199714 33.632526 1159.5304  .6915835 2.2890158 1.7352353  .6750357   67138.8 2011
      68  .5672918 30.442636  948.6335  .6268616 2.1718147 1.8678985  .6047987   53856.8 2012
      68  .7141293  33.14896 1132.2078  .6807229 2.3251185 2.0717416   .632165  67011.25 2013


      and my code:


      Code:
      xtset stateicp
      
      tsset stateicp year_
      
       
       synth_runner d_empl age_mom(2005(1)2010)  agesq(2005(1)2013)  d_ofmar(2005(1)2013)   n_kids(2005(1)2013)  educcat(2005(1)2013) racecat(2005(1)2013)   real_family_inc_2005(2005(1)2013) d_empl(2005) d_empl(2010) , trunit(13) trperiod(2014) gen_vars

      Comment


      • #4
        Works for me.
        Code:
        clear *
        input byte stateicp float(d_emp age_mom agesq d_ofmar n_kids educcat racecat real_family_inc_2005 year_)
         4  .6225429 33.992783 1193.3091  .8275691 1.8908932  2.069669  .4325703  97722.12 2005
         4  .7138088 34.612263 1228.1073  .7382291 1.9822558 2.1431835 .17340127  87865.04 2006
         4  .6999115 36.083553 1326.8845  .8757426 2.1323473 2.0589054 .18821894  93674.02 2007
         4  .7501005  34.72286 1232.9038  .7782469 2.3116205 2.0637314 .11891837  83230.49 2008
         4  .6596317 33.208572 1139.3619  .6161301 2.0012922 2.0211048 .16743836  68376.46 2009
         4   .707846 33.245377 1147.8837  .7401658 1.9294068  1.826281 .25706995  70791.44 2010
         4  .6426944 36.287384 1346.0974  .8459129 2.0273426  2.385645  .4720877  94581.47 2011
         4  .7269849 34.269615 1194.8544 .58625543 2.1109416 2.0586374  .2331418  68280.47 2012
         4  .7598351  33.82025 1173.5034  .6097789 1.9256276  2.163919  .1656051   86921.2 2013
         4  .6469848 32.642704 1103.2893  .5900793 2.0285785   1.92912 .40287045  75837.89 2014
         4  .7345612  33.10211 1127.8656  .6408451 1.9995937  2.097779 .53358614 73962.586 2015
         4  .7968575  34.66923 1216.7196  .7232644 2.1011705 1.9844476 .51002085 100967.48 2016
         4  .6867607  32.46715 1089.5363  .5740345 2.0788085 1.8924042  .1921049  105188.6 2017
        13  .5980265  34.28546 1210.9543  .6693674  2.069261 1.7869273 1.1045276  77756.54 2005
        13  .6305875 34.179367 1204.7618  .6897163 2.1013079 1.7054485 1.1058419  72417.37 2006
        13   .599062 34.307514  1211.852  .7010666 2.0675662 1.7982987   .995384  78792.63 2007
        13  .6417923 34.249264 1209.9258  .6971883 2.0109904 1.8184017 1.0260825  77334.48 2008
        13  .6039123  34.71301 1240.0906  .6624686 2.0266314 1.8499974   1.11263  80225.67 2009
        13  .5895364 34.176365 1204.4803  .6203563 2.0654223 1.7272936 1.1777148  68436.03 2010
        13  .6584397  34.27689 1210.4694  .6243628 2.0165513  1.908673 1.1478276  73026.31 2011
        13  .6315764   34.1762 1204.8383  .6373869 2.0956502  1.853596 1.1748055  69733.44 2012
        13  .6069895 34.207375 1206.2183  .6359243 2.0772781  1.837158 1.1743898 77560.805 2013
        13  .6694835 34.796513  1245.165  .6204635 2.0920873  1.887237  1.276852 75770.555 2014
        13   .653001 34.640522 1234.9045  .6177253 2.0282688 1.9465064 1.1413703  80474.33 2015
        13  .6182925 34.467106 1223.6936 .58453435  2.037208 1.9152153 1.2363067  78499.23 2016
        13  .6724656  34.62927 1237.2755  .6524082  1.973051  1.893594 1.1880343  87871.15 2017
        36  .7083427  33.03176 1121.1927  .8107806  2.257213  1.888392  .6806084  75482.23 2005
        36  .6793131  34.08267 1190.9708   .869409  2.384585 2.0419328  .3194888  51257.08 2006
        36  .9028554 32.649284 1100.5513  .6495965  2.049348  2.080385         0  57664.26 2007
        36  .6855544 31.161945 1005.4586  .6991955  2.009269 1.8683106  .4783141  53960.99 2008
        36  .6389428 30.090204  940.9326  .6981086  2.057711  1.650582 1.0133365  61035.75 2009
        36  .7900813 32.002098 1041.5234  .8483338 2.2256625 1.9483075 .13224876  64543.05 2010
        36 .55266184  34.90387 1250.8326  .8226733  2.536959  2.296821  .2374569  95107.15 2011
        36  .6763926  31.81786  1044.642  .5061892 1.8545535 2.1368258  .3065871  69141.81 2012
        36  .9065614  32.81312 1098.6399  .7030731 1.9499584 2.3438537  .2061877  60232.09 2013
        36 .59397376 34.100834 1179.1295  .8129475  2.405131 2.3123507  .4874702  94566.38 2014
        36  .6199221 32.863384 1109.8901  .8441848 2.4440734 2.1814134  .6919866 102955.02 2015
        36  .6617446 33.315014 1131.2024  .7074105 2.3593109 2.1044571  .4965819  55088.44 2016
        36  .7536639  32.66533 1105.4375  .7032725  2.234491 1.8590645   .392893  75943.24 2017
        37  .8937768 30.791845    985.48  .7210301 2.2528613 1.8226037 .14628041  65418.41 2005
        37  .7646201  33.07087 1130.3702   .626708 2.2858443  2.149754 .23027875  63117.64 2006
        37  .6318923 32.131763 1061.2454  .7432048 2.1019933 1.8400207 1.0574683  44507.15 2007
        37  .7287303 32.249546 1075.2844  .6265839 2.0175848  1.746315  .7530385  61519.38 2008
        37  .7540178  32.03195 1065.3411    .72301 2.1493666  2.092267  .6710153  55623.45 2009
        37  .8403996 34.138645 1202.7921  .6866472 2.1966374 2.0852826 .18128654  56863.25 2010
        37  .7479294 32.047535 1048.7832  .7952827  2.546093 2.0405114 .57526106   55290.6 2011
        37  .6613643 33.536533 1151.9938  .6629819  2.610407 1.9555136  .5796711  55132.09 2012
        37  .8614879 32.058365 1052.7135  .6528977 2.4889026  1.742499  .7780518  47196.27 2013
        37   .936478  33.12107 1112.2651  .4440252 1.7301887 1.8654088  .2235849  60275.87 2014
        37  .5955597 33.238007 1139.0082  .5357864  2.403819 1.9759355  .6098432  59927.22 2015
        37  .7427473 33.663754 1171.7368  .7944775 2.3039148 1.9730864  .6906676  58713.21 2016
        37  .7960756 31.939484 1046.9294   .725839   2.04713  2.032826  .8030442  59638.11 2017
        63  .6362415  33.03628 1128.4825  .7034264   2.59689 1.7111048   .611671  55845.81 2005
        63  .6246282 33.722107 1167.5853  .9123251 2.1942945 1.8704703  .5242868  63390.05 2006
        63  .6786771 32.758293 1105.0856  .8388282  2.491987 1.6533632 .58436257  62047.73 2007
        63  .7304497 31.424147 1015.9352  .7504967 2.4183674 1.5636626   .697309  49925.68 2008
        63  .5730291 32.873882 1108.3254  .8873471  2.620105 1.7271045  .8023435   66685.6 2009
        63  .6421033 33.196945 1138.5275  .6526574  2.207595 1.7801546  .6856389   55812.2 2010
        63  .5129791 32.907143 1118.8005  .7066202  2.412282 1.7043554  .8012195  48471.25 2011
        63  .5868702 32.732418 1102.1122  .7605327  2.325364 1.8456507  .6667705  58192.23 2012
        63  .6308663 33.094242 1116.7926   .777744 2.3799345 1.8544154  .7543166  56641.93 2013
        63  .6855853 33.117584 1120.1265   .714096  2.502922 1.6294492  .7506641  60058.59 2014
        63  .6338113  33.38775 1146.0038  .7393964  2.492831  1.750426  .6379224  64236.02 2015
        63  .5606948 34.966904 1250.6178  .8452051  2.968034  2.048823  .6356254  79507.79 2016
        63  .6837485 33.123215 1122.1667  .6814006 2.4720294 1.8587178  .3905676 72335.664 2017
        64  .6790811 32.563347 1100.5992  .7718413 2.2878525  1.521058  .9653672  48322.06 2005
        64  .6077431 33.303684 1135.8147  .8661001  2.259868 1.8100095  .3728045  50913.55 2006
        64  .8587393 32.801003 1103.6047  .6118911   2.12149 1.6982808  .3624642  42990.41 2007
        64  .6197535  32.63904 1110.8838  .6499375 2.1452045 1.6945883  .8444365  55105.08 2008
        64  .6181617  32.30024 1084.7511  .7334684  1.983054 1.4291767 1.0679684  37630.29 2009
        64  .7571754   33.4328 1144.1454  .7230068 2.3506453 2.0463173  .5889142  58762.14 2010
        64       .73 34.430637 1210.5327  .7074468  2.377447      2.11 1.0089362  46238.95 2011
        64  .6106038 34.570545 1219.7352  .7755523  2.818557 1.9575847 .08159058  64674.59 2012
        64  .8332026  31.69041 1028.5898  .6014436  1.985564 1.7279147  .7685549  45102.88 2013
        64  .6436931 34.803967  1248.877 .57087123 2.3813393 1.9071846 1.3315995  48726.74 2014
        64  .6991166  34.31134 1200.3179  .9120245  2.610781  1.985578  .4716063  67159.45 2015
        64  .7958222  33.39312 1144.2714  .6539972 1.9853934 2.0332966  .3397204  62095.88 2016
        64  .7303477 33.524754 1146.1521   .600907  2.425737  1.909864  .7637944  56525.41 2017
        67  .6255674 33.275234 1143.4249  .7457827   2.55512  1.652749  .5969848  57379.96 2005
        67  .6415901 33.172188 1135.7423   .802829 2.6081674 1.9001882 .59071463  72384.77 2006
        67  .5932954 32.493855 1089.6553  .7349778  2.416599 1.7429295  .8175206  66328.71 2007
        67  .6413313 33.092197 1123.9586  .8296851  2.563848 1.8193997   .455773  66442.65 2008
        67  .6082521 34.065083 1186.4305  .8314906  2.716906 1.8380742  .7025832  70507.64 2009
        67  .5869985  33.21787 1127.0902  .8210363  2.432261  1.871696  .7704873  60892.85 2010
        67 .56404096  32.81957  1102.768  .7577955  2.604378 1.7915156  .6678753  56879.52 2011
        67  .6132573 33.933025 1181.5502  .8039371  2.853388  1.772852  .4799979 66555.914 2012
        67  .5361913 32.710075  1099.688  .7442746  2.473617  1.858738  .9680781  62836.74 2013
        67 .56833726  34.05072 1189.5487  .7330179  2.676016 2.0143256   .606324  68942.13 2014
        67  .5836326 33.438675 1146.3676  .8244096  2.755142 1.9795407 .58336055  70540.18 2015
        67 .58227736 34.144703 1191.8617   .778316  2.676599 1.9473684  .6989145  68103.85 2016
        67 .58219117 34.457428 1216.9158  .7753018  2.493374 1.9970953  .8103386  72877.95 2017
        68 .57569295 32.149963 1060.4122   .732054  2.137882 1.5579246  .4655295   44827.3 2005
        68  .7239594  29.81971  926.2842  .5990943 1.9370283  1.349795  .4934225  45318.91 2006
        68  .6959694   30.7262  972.0028  .4492703 2.1674774  1.814107  .3728284  48382.39 2007
        68  .6444127 31.774366 1049.5901  .8218493 1.8964655  1.723313  .2906105  57253.76 2008
        68  .8070282  34.57316 1232.0466  .8018782 2.3453498 2.1026962   .177219  75565.46 2009
        68  .8334212 33.080654 1122.5557  .7967844 2.1251976 1.7453874 .27095413  65681.52 2010
        68  .8199714 33.632526 1159.5304  .6915835 2.2890158 1.7352353  .6750357   67138.8 2011
        68  .5672918 30.442636  948.6335  .6268616 2.1718147 1.8678985  .6047987   53856.8 2012
        68  .7141293  33.14896 1132.2078  .6807229 2.3251185 2.0717416   .632165  67011.25 2013
        end
        
        
        drop if state == 68
        xtset stateicp year, y
        cls
        
        synth d_emp ///
            age_mom(2005(1)2010)  ///
            agesq(2005(1)2013)  /// Why are we squaring age?
            d_ofmar(2005(1)2013)   ///
            n_kids(2005(1)2013)  ///
            educcat(2005(1)2013) ///
            racecat(2005(1)2013)   /// Race category???? This doens't make sense.
            real(2005(1)2013) ///
            d_emp(2005) d_emp(2010) , ///
            trunit(13) trperiod(2014) fig nested
        By the way, I think you should not use SCM here (not vanilla SCM anyways). You have a very very very short pre-intervention time period, and I do not believe the basic identification assumptions holds in this scenario.

        Comment


        • #5
          Hello, thanks for your response, I know some categories do not make sense, since it was a cross sectional unbalanced data, every state has multiple observations for each year, so I saw in a forum suggested as getting the weighted mean values by collapse command to move forward with synth command.

          I am not sure why it gives me an error, I will try again and see. but the code doesnt work for me (even after I drop state 68)

          Comment


          • #6
            Well, I have other reasons for why SCM shouldn't be used here beyond the code-- note that d_empl is NOT the same as d_emp (the variable you gave us). When I correctly spell the variable it works fine.


            But beyond that, I'm telling you that it's a bad idea to use SCM here, even if we discount your categorical outcome predictors.

            Comment


            • #7
              yes, the typo is not the issue, is there any other way to use SCM with multiple units, I searched but couldnt find anything. thank you for your response. I think main difference is using either synth or
              synth_runner, which I will try to learn. But I am aware it has other problems related to data. Thanks!
              Last edited by mehlika oz; 04 Oct 2023, 15:41.

              Comment

              Working...
              X