Skip to content

Problem Set 2, exercise 2: detrending #13

Description

@rickecon

OK, I made an error in simulating the IncomeIntel.txt dataset. I just updated that dataset in the repo, and it should be fixed. The new scatterplot should look like the following.
income_scatter
Because these data are not panel data, you cannot use differencing or log differencing methods to detrend them. The solution here is to:

  • Treat the first year of the data grad_year=2001 equal to the base year.
  • Calculate the average growth rate in salary by:
    • Calculate the mean salary each year
      avg_inc_by_year = IncomeIntel['salary_p4'].groupby(IncomeIntel['grad_year']).mean().values
    • Calculate the average growth rate in salaries across all 13 years
      avg_growth_rate = ((avg_inc_by_year[1:] - avg_inc_by_year[:-1]) / avg_inc_by_year[:-1]).mean()
  • Divide each salary by (1 + avg_growth_rate) ** (grad_year - 2001). This means that all grad_year=2001 salaries will not change. All grad_year=2003 salaries will be divided by (1 + avg_growth_rate) ** 2. And all grad_year=2013 salaries will be divided by (1 + avg_growth_rate) ** 12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Problem SetProblem Set question, clarification, or modification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions