Announcement

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

  • what does carryforward in reverse years mean?

    Hi all, I saw this code somewhere trying to carryforward the ID and ID names after applying tsfill. But I don't understand why they create a years_reverse and carry forward by years_reverse. What does this mean?




    Code:
        tsset ID_adm2_num year
    
        tsfill, full 
        *//fill out data gaps
        gen years_reverse =-year
        *// carryforward, countryname etc
        bysort ID_adm2_num (year): carryforward ID_adm* name* iso3c ID_* id* , replace 
        bysort ID_adm2_num (years_reverse): carryforward ID_adm* ID_adm2 name* iso3c ID_*, replace

  • #2
    carryforward is a community-contributed command from SSC. I didn't write it and don't use it, but it seems reasonable to guess that by first negating (thus reversing) time, you're carrying backwards, i.e fitting in observations for earlier times from observations for later times.

    https://journals.sagepub.com/doi/pdf...6867X231196519 gives an independent take on this, as does https://www.stata.com/support/faqs/d...issing-values/

    Comment

    Working...
    X