Announcement

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

  • Help writing loop to fill in the blanks

    I have a datafile like this. I would like to fill in the blanks between 2014 and 2013 as 2014. There are 23 years from 2014 to 1992. How do I fill in the blanks in between?

    The problem is that the number of blanks in between available observations is not equal.
    Attached Files

  • #2
    Welcome to Statalist! Unfortunately, you're in the wrong forum. Use this forum to make test posts, practice with the formatting features of the forum software, etc. Post questions about Stata in the General Forum. Before you do, be sure to read the FAQ,especially FAQ 12 about how to ask a good question. In particular, don't use screen shots! Post example using the dataex command and present code and results between [CODE] and [/CODE] delimiters.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Hi Min,

      As Steve mentioned, you should post this in the General Forum if you want people to answer it. (Most responders don't read here). Since there is an easy solution to your question, I will just post it here.

      Code:
      replace Year = Year[_n-1] if Year==.

      Comment

      Working...
      X