Announcement

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

  • Logical operation using generate

    I have a database with three variables: 27 states, 10 years and a GDP for each year. I want to generate a variable with the resulting logical operation: if year=2017, then GDP*2 & if year=2018, then GDP*7 & if year=2019, then GDP*15, and so on.
    How can I do that, please?
    Last edited by Edison Jr; 29 Jul 2022, 15:13.

  • #2
    Duplicate post. Asked and answered at https://www.statalist.org/forums/for...-with-generate.

    Comment

    Working...
    X