Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73184

Synthetic control - synth2: invalid syntax error

$
0
0
Hi everyone,

I am struggling with a SSC command called -synth2-. Basically, when I run this, I got an error:


Code:
xtset idprovdis moyr_matricula


foreach a in HEV{
preserve
ge `a'=(d_dum_`a'/tot)    
synth2 `a'  car_pct pp_euro hh_t frac_age_15to59 frac_age_under15 avgHHmem frac_Male ///
    , trunit(29) trperiod(`=tm(2018m5)') xperiod(`=tm(2016m1)'(1)`=tm(2019m12)') nested frame(`a')    
matrix R = e(U_wt)
mat2txt, matrix(R) saving("${resultd}/T2_`a'W.txt") replace format(%6.1f)

matrix R = e(bal)
matselrc R R1, row(1,2,3,4,5,6,7) col(1,2,3)
mat list R1 , format(%12.2f)
matmap R1 R, map(round(@, 0.001))
local att : di %6.3f  scalar(`e(att)')
di "`att'"

esttab matrix(R) using "$resultd/T2_baltab_`a'.tex",  ///
    nomtitle replace nonote label booktabs star(* 0.10 ** 0.05 *** 0.01) ///
    stats("`att'", labels("Avg effects: `att'") fmt(0 3 0 0))
restore
}
Here is a dataex:



Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input int moyr_matricula float(idprovdis d_dum_HEV d_dum_ZERO) long tot float(car_pct age_t0014 age_t1529) double(male pp_euro hh_t p_t) int dum_HEV
672 1  31  -1  3555  .3368989 1589.2397  1622.082 5234.175438596491 11651.068591234956 4315.0935672514615  10552.12865497076  66
673 1  22   0  5790  .5470662 1597.5385 1630.1775 5249.881656804734  11589.04063402938  4321.449704142012 10583.727810650887  43
674 1  58 -16 11719 1.0836304  1629.006 1662.9337 5363.493975903614 11692.594201406531  4422.879518072289 10814.572289156626  79
675 1  27   1  4716  .4371363 1626.6205 1658.9097 5350.704819277108  11660.94775176064  4411.704819277108 10788.397590361446  51
676 1 141  -2  8291  .7751926 1614.6946 1647.2395 5304.790419161676 11512.580575615591  4366.904191616766 10695.407185628743 161
677 1  90   1  8198  .7737827    1596.4 1628.5177 5255.535294117647 11636.280418159304  4331.729411764706  10594.70588235294 116
678 1  35  -1  4408  .4249181  1563.155  1594.207 5145.781609195402 11651.257659136743  4241.350574712644 10373.764367816091  75
679 1  24  -1  2509 .22847965 1659.6173 1692.9198 5446.246913580247 11617.824744020807  4481.333333333333 10981.283950617284  59
680 1  33  -2  3064 .28978604 1593.8823    1626.7  5244.64705882353  11598.39329241222 4320.6882352941175 10573.317647058824  81
681 1  58  -2  3310  .3255998 1531.8757  1564.548 5042.864406779661  11558.32863221045  4153.299435028249 10165.853107344632  70
end
format %tm moyr_matricula
label values idprovdis idprovdis
label def idprovdis 1 "A", modify


The error I got every time:

Code:
invalid syntax
r(198);

Could anyone help me with that, please?

Thanks a lot!

Viewing all articles
Browse latest Browse all 73184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>