Announcement

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

  • How to do price indexing?

    Hi members,

    I would like to adjust a price variable (p) for inflation and quality change over 4 year period from Feb. 2010 to Jan. 2015. My datset is an unbalanced panel identified by a panel id ( SKUcode) and month of purchase (m). I collected data for the relevant price index and re-referenced this to Feb. 2010 (as =100).

    For those of you who may wish to know more about the index used it is Laspayers index used by the UK Office of National Statistics. Data for re-referenced index is copied below (see last column).

    Question: how I can write and run a code allowing me to adjust price variable for inflation?

    Thanks,
    Mohamud
    2010 FEB 123.3 100
    2010 MAR 123.1 99.8
    2010 APR 123.5 100.2
    2010 MAY 122.7 99.5
    2010 JUN 122.3 99.2
    2010 JUL 123.2 99.9
    2010 AUG 123.4 100.1
    2010 SEP 123.9 100.5
    2010 OCT 123.8 100.4
    2010 NOV 125 101.4
    2010 DEC 126.9 102.9
    2011 JAN 126.4 102.5
    2011 FEB 128.3 104.1
    2011 MAR 127.1 103.1
    2011 APR 127.8 103.6
    2011 MAY 129.1 104.7
    2011 JUN 131 106.2
    2011 JUL 131.4 106.6
    2011 AUG 132.2 107.2
    2011 SEP 131.9 107.0
    2011 OCT 130.9 106.2
    2011 NOV 133 107.9
    2011 DEC 133.5 108.3
    2012 JAN 133.7 108.4
    2012 FEB 133.9 108.6
    2012 MAR 134.9 109.4
    2012 APR 134.3 108.9
    2012 MAY 135.5 109.9
    2012 JUN 134.7 109.2
    2012 JUL 134.5 109.1
    2012 AUG 134.3 108.9
    2012 SEP 134.9 109.4
    2012 OCT 135.2 109.7
    2012 NOV 136.4 110.6
    2012 DEC 138.9 112.7
    2013 JAN 137.9 111.8
    2013 FEB 139.4 113.1
    2013 MAR 138.1 112.0
    2013 APR 138.7 112.5
    2013 MAY 139 112.7
    2013 JUN 140.1 113.6
    2013 JUL 141 114.4
    2013 AUG 140.9 114.3
    2013 SEP 141.9 115.1
    2013 OCT 142.2 115.3
    2013 NOV 142 115.2
    2013 DEC 142.4 115.5
    2014 JAN 141.5 114.8
    2014 FEB 142.6 115.7
    2014 MAR 142.6 115.7
    2014 APR 142.3 115.4
    2014 MAY 140.8 114.2
    2014 JUN 140.9 114.3
    2014 JUL 141 114.4
    2014 AUG 141.1 114.4
    2014 SEP 141.7 114.9
    2014 OCT 140.1 113.6
    2014 NOV 139.1 112.8
    2014 DEC 139.8 113.4
    2015 Jan 140.8 114.2


  • #2
    If -price- is the unadjusted price and -index- the price index, calculate the adjusted price -price_a- with:
    Code:
    generate price_a = price/index

    Comment


    • #3
      Usual spelling is Laspeyres. Svend has the answer in one line, but for related technique see http://www.stata-journal.com/sjpdf.h...iclenum=dm0055

      Comment


      • #4
        I think the bigger problem with this question is how to populate the column 'index' with the right index values: individual observations may not be one each for each of the months specified in this list. I dont know how to do this but am interested. I would usually do this in a spreadsheet before importing to stata.

        Comment


        • #5
          Jorrit: You could put the price index in a dataset and merge on the monthly date variable (not column!). Or type the numbers into the observations for one complete panel and copy them elsewhere.

          Code:
           
          bysort m (index) : replace index = index[_n-1] if missing(index)

          Comment


          • #6
            Many thanks all.

            Svend, if I use the command line suggested the prices is adjusted by scale factor of 100; see my index referenced

            Would your command line need to be adjusted is slightly as:


            generate price_a = price*100/index


            Thanks, Mohamud
            Last edited by Mohamud Hussein; 04 Feb 2015, 11:35.

            Comment


            • #7
              You are absolutely right, Mohamud,

              Svend

              Comment

              Working...
              X