Announcement

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

  • Issue with Synth2

    I have a dataset with years, quarters, the 50 states, and other variables like income (MHI). I have created a value yq, from,gen yq = yq(year, quarter). I then rounded yq to be a whole number. My states are listed under state_id as 1 to 50. I have done xtset state_id yq and Stata recognizes it as :
    Panel variable: state_id (strongly balanced)
    Time variable: yq, 68 to 260, but with gaps
    Delta: 1 unit

    I am now trying to run synth2 command as follows:
    synth2 MHI, trunit(23) trperiod(220) xperiod(181(1)219).

    It keeps saying invalid syntax. I think the issue is trperiod, but the numbers are whole numbers. I have also tried doing egen State1 = group(state_id), and then using State1 as the xtset, but that also has not worked. I am happy to add any more info if that is helpful, but i I don't know why it keeps saying invalid syntax.

  • #2
    synth2 is a wrapper for synth, both from SSC (FAQ Advice #12).

    Originally posted by Yehuda Potash View Post
    I have created a value yq, from,gen yq = yq(year, quarter). I then rounded yq to be a whole number.
    Quarter dates are already integers, so rounding is not needed. Your issue likely arises as you do not have any predictor variables.

    synth2 MHI, trunit(23) trperiod(220) xperiod(181(1)219)

    I do not think that the command allows you to estimate a model without predictors. See

    Code:
    help synth
    for help with the syntax.

    Comment

    Working...
    X