Hello,
I have the following data where each row represents a job created. The jobs created are organized by company name, economic sector, and the month. I would like to still keep this same data structure if possible, but also generate variables that count the number of jobs created in each quarter, by economic sector.
The data look as follows:
```
dataex sector company_name month
"Information Technology" "Agfa Healthcare" "Nov_2020"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "March_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "Feb_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "Feb_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "March_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "March_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "March_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "Feb_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "Feb_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "March_2021"
"Aerospace & Defense" "Airbus S.A.S." "Nov_2020"
"Accounting & Legal" "Al-FARIS IT & Communications Company" "Nov_2020"
"Accounting & Legal" "Al-FARIS IT & Communications Company" "Jan_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "March_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "Feb_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "Feb_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "March_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "March_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "March_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "March_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "Feb_2021"
"E-commerce" "Amazon.com, Inc." "Dec_2020"
"E-commerce" "Amazon.com, Inc." "Dec_2020"
"E-commerce" "Amazon.com, Inc." "Dec_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Dec_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "March_2021"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
```
Ideally, I want the dataset to look something as follows:
```
quarter sector quarterly_jobs
Q4_2020 "E-commerce" 80
Q4_2020 "Manufacturing" 30
Q4_2020 "Manufacturing" 45
Q1_2021 "E-commerce" 200
```
I have been able to create a variable that counts total jobs created by economic sector, but not by quarter, which is what I am looking for.
```
** Generate a variable that counts job postings by Sector group
// Sorting by Sector. Now n1 is the observation number within each Industry group and total_jobs_industry is the total number of observations for each Sector group.
sort sector
by sector: generate total_jobs_sector = _N
order total_jobs_sector, a(sector)
```
I have the following data where each row represents a job created. The jobs created are organized by company name, economic sector, and the month. I would like to still keep this same data structure if possible, but also generate variables that count the number of jobs created in each quarter, by economic sector.
The data look as follows:
```
dataex sector company_name month
"Information Technology" "Agfa Healthcare" "Nov_2020"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "March_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "Feb_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "Feb_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "March_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "March_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "March_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "Feb_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "Feb_2021"
"Restaurants, Bars & Food Services" "Ahmad A. Abed Co." "March_2021"
"Aerospace & Defense" "Airbus S.A.S." "Nov_2020"
"Accounting & Legal" "Al-FARIS IT & Communications Company" "Nov_2020"
"Accounting & Legal" "Al-FARIS IT & Communications Company" "Jan_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "March_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "Feb_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "Feb_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "March_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "March_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "March_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "March_2021"
"Manufacturing" "Al-Obaid Plastic Manufacturer" "Feb_2021"
"E-commerce" "Amazon.com, Inc." "Dec_2020"
"E-commerce" "Amazon.com, Inc." "Dec_2020"
"E-commerce" "Amazon.com, Inc." "Dec_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Dec_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "March_2021"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
"E-commerce" "Amazon.com, Inc." "Nov_2020"
```
Ideally, I want the dataset to look something as follows:
```
quarter sector quarterly_jobs
Q4_2020 "E-commerce" 80
Q4_2020 "Manufacturing" 30
Q4_2020 "Manufacturing" 45
Q1_2021 "E-commerce" 200
```
I have been able to create a variable that counts total jobs created by economic sector, but not by quarter, which is what I am looking for.
```
** Generate a variable that counts job postings by Sector group
// Sorting by Sector. Now n1 is the observation number within each Industry group and total_jobs_industry is the total number of observations for each Sector group.
sort sector
by sector: generate total_jobs_sector = _N
order total_jobs_sector, a(sector)
```
Comment