Announcement

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

  • generating a new variable based on variables of different dates

    Hello Stata Experts

    I`m unable to generate a logic code that would generate 2 new variables
    Variable C = A(t) / B(t-1)
    Variable D = [D(t-2)-D(t-1)]/D(t-2)
    t is date representing years as in the year 2010, 2011,...

    I tried lagging variable B by one year but I got some weird outputs
    if you have any other suggestions I would really appreciate it

    Thank you

  • #2
    Please show example data and the code you tried.

    Comment

    Working...
    X