Announcement

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

  • treated unit not found in panelvar - check tr(). error help

    Hello,

    I am using the synth.ado file and I am attempting to run a placebo test and I continue to get the following error: treated unit not found in panelvar - check tr().

    Here is my code which I am using from a previous stata post and it is a proper format. Any advice on what I may be doing wrong?

    tsset statenum quarterdate

    foreach var of varlist teen_logwage lnteen_emp overall_logwage lnemp{
    forvalues i=1/36{
    synth `var' `var'(92) `var'(93) `var'(94) `var'(95) `var'(96) `var'(97) `var'(98) `var'(99) `var'(100) `var'(101) `var'(102) `var'(103) `var'(104) `var'(105) `var'(106) `var'(107) `var'(108) `var'(109) `var'(110) `var'(111) `var'(112) `var'(113), trunit(`i') trperiod(114) keep(2Biii_`var'_`i', replace)

    }
    }

  • #2
    I do not use synth, but I can draw some conclusions.

    You code requires that your panel variable statenum take the values 1 through 36. Does it - do you get the results below if you run this command?
    Code:
    . levelsof statenum
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
    Perhaps your statenum looks more like this example, which has 36 values but with gaps.
    Code:
    . levelsof statenum
    1 2 3 4 6 7 8 9 11 13 14 16 17 18 19 20 22 23 24 26 27 28 29 30 32 33 35 36 37 38 40 42 45 47 48 50
    In that case you should replace
    Code:
    forvalues i=1/36{
    with
    Code:
    levelsof statenum
    foreach i in `r(levels)' {
    If that isn't your problem, then your problem really isn't clear without more detail, or at a minimum it is too difficult to guess at a good answer from what you have shared. Please help us help you. Show example data. Include a link to the post whose work you copied. The Statalist FAQ provides advice on effectively posing your questions, posting data, and sharing Stata output..

    Comment

    Working...
    X