Announcement

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

  • Filling up missing observations in an upwards cascade

    Hi,

    At the process of matching various datasets, I have encountered that many of my data has missings. For that reason, I would like to know whether you might know a good approach for it. I have already tried with the formulas exposed here ( https://www.stata.com/support/faqs/d...issing-values/ ) but none go forwards one period (eg.
    by person_id (year month), sort: replace myvar = myvar[_n-1] if myvar >= . ). My main intention is to take upwards my first non missing data (in this case 1995 month 1) to span all over the time period for every individual in the sample.
    My data has the following structure:
    person_id Year Month myvar
    1 1980 1 .
    1 1980 2 .
    1 1980 3 .
    1 1980 4 .
    1 1980 5 .
    1 1980 6 .
    1 1980 7 .
    1 1980 8 .
    1 1980 9 .
    1 1980 10 .
    1 1980 11 .
    1 1980 12 .
    1 .... .... ....
    1 1995 1 50
    1 1995 2 52
    1 ... .... ...

    If you could provide me any hint on how to fill it up for every person id, I would be really grateful,

    Regards,
    Miguel

  • #2
    Your explanation of what you want is confusing to me. The FAQ you cite covers copying forwards -- and backwards. But have a look at

    https://www.statalist.org/forums/for...-interpolation

    Comment


    • #3
      Dear Nick Cox, thanks for the recommendation and link. Really helpful.

      Comment

      Working...
      X