You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT sector, SUM(income * count) / SUM(count) AS mean_income
40
+
FROM data
41
+
WHERE year = ${mostRecentYear}
42
+
GROUP BY sector
43
+
ORDER BY mean_income DESC
44
+
`).then(data=>data.map(d=>d.sector));
42
45
```
43
46
44
47
```js
45
-
constincome=Generators.observe((change) => {
46
-
constquery=`
47
-
SELECT income, count, sector FROM data
48
-
WHERE year = ${selectedYear} AND puma = '${selectedPUMA}'
49
-
`;
50
-
db.query(query).then(change);
51
-
});
48
+
constincome=db.query(`
49
+
SELECT income, count, sector FROM data
50
+
WHERE year = ${selectedYear} AND puma = ${selectedPUMA}
51
+
`);
52
52
```
53
53
54
54
```js
@@ -83,13 +83,14 @@ function incomeChart(income, width) {
83
83
```
84
84
85
85
<divclass="card">
86
-
<h2>The sectors in which people earn the most money have shifted over the past two decades</h2>
87
-
<h3>How much income per year x million people reported earning in the 2000–2022 American Community Surveys run by the United States' Census Bureau, categorized by their sector of employment, specifically for PUMAs overlapping with the New York-Newark CBSA in 2020.</h3>
86
+
<h2>The sectors in which people earn the most money shift across time and space</h2>
87
+
<h3>How much income per year x million people reported earning in the 2010–2022 American Community Surveys run by the United States' Census Bureau, categorized by their sector of employment, specifically for areas overlapping with the New York-Newark-Jersey City core-based statistical area in 2020.</h3>
88
88
<h3><codestyle="font-size: 90%;"><ahref="https://github.com/jaanli/exploring_american_community_survey_data/blob/main/american_community_survey/models/public_use_microdata_sample/figures/income-histogram-with-sector-historical-inflation-adjusted-industry-mapped.sql">Code for data transform</a></code></h3>
0 commit comments