Announcement

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

  • Negative values when interpolating

    Hello Statalisters,

    I have quarterly data for sale price and year. I am trying to fill in the gaps by interpolating and extrapolating, but I receive negative numbers which doesn't make much sense based on what I'm looking at. Here is my code:

    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str7 year float(sale_price)
    "2000q1" .
    "2000q2" .
    "2000q3" .
    "2000q4" .
    "2001q1" .
    "2001q2" .
    "2001q3" .
    "2001q4" 5.0
    "2002q1" 6.2
    "2002q2" 7.0
    "2002q3" .
    "2002q4" 8.4
    "2003q1" .
    "2003q2" .
    "2003q3" 8.8
    "2003q4" 7.8
    end
    
    gen qdate = quarterly(year, "YQ")
    format qdate %tq
    
    ipolate sale_price qdate, generate(sale_price2) epolate
    I would appreciate any assistance with this!

    Thanks,
    Anoush K.

  • #2
    Well, if you look at the sequence of values of sales_price between 2001q4 and 2002q2, you can see that the price is increasing steadily at a rate of about 1 per quarter. So when you extrapolate back in time for 6 quarters, it is not surprising that the results head into negative territory. If negative values of this variable are not possible, then the conclusion is that linear extrapolation is inappropriate for this data. This is not very surprising since, in general, extrapolation is a hazardous way of dealing with missing values. You need to use some other approach to imputing your missing values on this variable.

    Comment


    • #3
      Clyde Schechter Thank you for your help! That makes sense.

      Anoush

      Comment

      Working...
      X