Announcement

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

  • Adjust for wage increase

    Hello everyone,

    Please see below. I would want to adjust for wage inflation for the 3 years my data is on. Specifically, I would want to use June 2018 as a base, according to a year on year data, the average earnings is said to have increased 3.9% in June 2019, and changed by -1.3% in June 2020. How would I apply this to all of my salary data?


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input long salary str7 academicyear
       1 "2019-20"
       1 "2019-20"
       1 "2019-20"
      10 "2017-18"
      14 "2017-18"
      17 "2017-18"
      23 "2017-18"
      26 "2018-19"
      28 "2017-18"
      30 "2017-18"
      40 "2017-18"
      40 "2017-18"
      40 "2017-18"
      40 "2018-19"
      45 "2017-18"
      48 "2017-18"
      50 "2017-18"
      50 "2017-18"
      50 "2017-18"
      91 "2017-18"
     100 "2019-20"
     120 "2017-18"
     200 "2019-20"
     300 "2017-18"
     520 "2018-19"
     600 "2019-20"
     684 "2019-20"
     800 "2018-19"
     850 "2019-20"
     900 "2018-19"
    1000 "2018-19"
    1000 "2019-20"
    1000 "2019-20"
    1200 "2018-19"
    1200 "2018-19"
    1200 "2018-19"
    1200 "2019-20"
    1350 "2018-19"
    1500 "2017-18"
    1500 "2017-18"
    1500 "2017-18"
    1500 "2018-19"
    1500 "2018-19"
    1680 "2017-18"
    1800 "2019-20"
    2000 "2017-18"
    2000 "2017-18"
    2000 "2017-18"
    2000 "2018-19"
    2000 "2018-19"
    2000 "2018-19"
    2500 "2018-19"
    2600 "2019-20"
    3000 "2017-18"
    3000 "2017-18"
    3000 "2017-18"
    3000 "2017-18"
    3000 "2017-18"
    3000 "2017-18"
    3000 "2018-19"
    3000 "2018-19"
    3000 "2018-19"
    3000 "2018-19"
    3000 "2019-20"
    3252 "2019-20"
    3300 "2019-20"
    3423 "2018-19"
    3500 "2018-19"
    3500 "2018-19"
    3600 "2018-19"
    3624 "2018-19"
    3800 "2017-18"
    3840 "2018-19"
    4000 "2017-18"
    4000 "2017-18"
    4000 "2017-18"
    4000 "2017-18"
    4000 "2017-18"
    4000 "2017-18"
    4000 "2017-18"
    4000 "2019-20"
    4000 "2019-20"
    4320 "2018-19"
    4500 "2018-19"
    4500 "2019-20"
    4800 "2018-19"
    4814 "2019-20"
    5000 "2017-18"
    5000 "2017-18"
    5000 "2017-18"
    5000 "2017-18"
    5000 "2017-18"
    5000 "2017-18"
    5000 "2017-18"
    5000 "2017-18"
    5000 "2017-18"
    5000 "2017-18"
    5000 "2017-18"
    5000 "2017-18"
    5000 "2018-19"
    end


  • #2
    Code:
    gen adjusted_salary = salary/cond(academicyear == "2019-20", 1.039, 1)
    The change in June 2020 is irrelevant since your data does not extend beyond that time point.

    Added: I suppose that since you mentioned the change in June 2020, your full data set might include observations with academicyear = "2020-21" or beyond, even though the example you showed didn't. So, if it does, then you need an additional command after what was shown above:
    Code:
    replace adjusted_salary = adjusted_salary/cond(academicyear >= "2020-21", 1-.013, 1)
    Last edited by Clyde Schechter; 07 Feb 2023, 11:53.

    Comment

    Working...
    X