Announcement

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

  • Regarding Interval data (generating more years and duplicating values)

    Dear,

    Can anyone help me to manage the data?
    I have interval data. Since the data are only available at five-year intervals, I want you to fill out the in-between years as follows: between 1950 and 1955. For example, I want to set the missing values for 1951, 1952, 1953, and 1954, equal to the 1950 values. So, for example, the one of variables, LPC (Percentage of Primary Complete) for Australia would take the value of 27.15% for 1950, 1951, 1952, 1953, and 1954. The same variable LPC will take the value of 22.58% for 1955, 1956, 1957, 1958, and 1959.
    So, I need to generate missing years and duplicate values.

    Data looks as follows.

    Many Thanks,

    Attached Files

  • #2
    If BLcode and year uniquely identify the observations,

    Code:
    forvalues i = 1950 / 2019 {
    g year2`i' = `i'
    }
    
    reshape long year2 ,i(BLcode year) j(x)
    
    bys BLcode (year2): keep if inrange(year2,year,year+4)

    Comment


    • #3
      The only good reason I can think of for interpolation here is that you have other variables on a finer mesh (e.g. every year) and wish to bring those together with these. Even if so, the method of interpolation you describe is almost the worst method that is ever used in practice, as there is never (sounds dogmatic, but I feel confident) a reason for thinking that variables like lu to lhc change in this way. As your data are compositional, care is needed especially to preserve the total and to keep values between 0 and 100%. Your method would do that, but that doesn't make it good.

      I would start with the ipolate command here assuming that you really need to do this.

      Comment


      • #4
        #2

        Dear Seinfeld fan: Thanks for your contribution but please note https://www.statalist.org/forums/help#realnames

        Comment


        • #5
          Dear Seinfeld fan,
          Thank you for your help.

          Comment


          • #6
            Dear Cox,

            Thank you for your suggestion!
            I will start with the command (ipolate).

            Best,

            Comment

            Working...
            X