Announcement

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

  • test

    Hello everyone,

    At the moment I am trying to create a variable that captures the industry sector's code that contains the most jobs in a city, for each year. I am using a dataset full of companies' information such as the city it is located in, the year, the number of jobs, the industry the company operates in, and the corresponding industry. I have created a sample of the dataset below.
    I already created the variable MostJobsSector, which gives the highest number of jobs that is located by one industry, per city, per year. The following code was used:

    Code:
    egen MostJobsSector= max(SBIBanenGEM), by (plaats year)
    Now, i do want to create a variable (IndustryMostJobs) that captures the corresponding industry code of the industry that contained the most jobs per city and per year.

    company | city | year | industryCode | jobsCompany | TotalJobsSector | MostJobsSector | IndustryMostJobs
    1 Chicago 1997 01 5 8 8 01
    2 Chicago 1997 01 3 8 8 01
    3 Chicago 1997 02 2 3 8 01
    4 Chicago 1997 02 1 3 8 01
    5 Chicago 1998 01 4 7 9 02
    6 Chicago 1998 01 2 7 9 02
    7 Chicago 1998 01 1 7 9 02
    8 Chicago 1998 02 9 9 9 02
    9 Chicago 1998 03 6 6 9 02

    10 Miami 1997 01 3 9 9 01
    11 Miami 1997 01 4 9 9 01
    12 Miami 1997 01 2 9 9 01
    13 Miami 1997 02 8 8 9 01
    14 Miami 1998 01 1 1 8 03
    15 Miami 1998 02 5 5 8 03
    16 Miami 1998 03 4 8 8 03
    17 Miami 1998 03 4 8 8 03
Working...
X