my-markdown-library 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. checksums.yaml +7 -0
  2. data/F24LS_md/ Lecture 4 - Public.md +347 -0
  3. data/F24LS_md/Lecture 1 - Introduction and Overview.md +327 -0
  4. data/F24LS_md/Lecture 10 - Development_.md +631 -0
  5. data/F24LS_md/Lecture 11 - Econometrics.md +345 -0
  6. data/F24LS_md/Lecture 12 - Finance.md +692 -0
  7. data/F24LS_md/Lecture 13 - Environmental Economics.md +299 -0
  8. data/F24LS_md/Lecture 15 - Conclusion.md +272 -0
  9. data/F24LS_md/Lecture 2 - Demand.md +349 -0
  10. data/F24LS_md/Lecture 3 - Supply.md +329 -0
  11. data/F24LS_md/Lecture 5 - Production C-D.md +291 -0
  12. data/F24LS_md/Lecture 6 - Utility and Latex.md +440 -0
  13. data/F24LS_md/Lecture 7 - Inequality.md +607 -0
  14. data/F24LS_md/Lecture 8 - Macroeconomics.md +704 -0
  15. data/F24LS_md/Lecture 8 - Macro.md +700 -0
  16. data/F24LS_md/Lecture 9 - Game Theory_.md +436 -0
  17. data/F24LS_md/summary.yaml +105 -0
  18. data/F24Lec_MD/LecNB_summary.yaml +206 -0
  19. data/F24Lec_MD/lec01/lec01.md +267 -0
  20. data/F24Lec_MD/lec02/Avocados_demand.md +425 -0
  21. data/F24Lec_MD/lec02/Demand_Steps_24.md +126 -0
  22. data/F24Lec_MD/lec02/PriceElasticity.md +83 -0
  23. data/F24Lec_MD/lec02/ScannerData_Beer.md +171 -0
  24. data/F24Lec_MD/lec02/demand-curve-Fa24.md +213 -0
  25. data/F24Lec_MD/lec03/3.0-CubicCostCurve.md +239 -0
  26. data/F24Lec_MD/lec03/3.1-Supply.md +274 -0
  27. data/F24Lec_MD/lec03/3.2-sympy.md +332 -0
  28. data/F24Lec_MD/lec03/3.3a-california-energy.md +120 -0
  29. data/F24Lec_MD/lec03/3.3b-a-really-hot-tuesday.md +121 -0
  30. data/F24Lec_MD/lec04/lec04-CSfromSurvey-closed.md +335 -0
  31. data/F24Lec_MD/lec04/lec04-CSfromSurvey.md +331 -0
  32. data/F24Lec_MD/lec04/lec04-Supply-Demand-closed.md +519 -0
  33. data/F24Lec_MD/lec04/lec04-Supply-Demand.md +514 -0
  34. data/F24Lec_MD/lec04/lec04-four-plot-24.md +34 -0
  35. data/F24Lec_MD/lec04/lec04-four-plot.md +34 -0
  36. data/F24Lec_MD/lec05/Lec5-Cobb-Douglas.md +131 -0
  37. data/F24Lec_MD/lec05/Lec5-CobbD-AER1928.md +283 -0
  38. data/F24Lec_MD/lec06/6.1-Sympy-Differentiation.md +253 -0
  39. data/F24Lec_MD/lec06/6.2-3D-utility.md +287 -0
  40. data/F24Lec_MD/lec06/6.3-QuantEcon-Optimization.md +399 -0
  41. data/F24Lec_MD/lec06/6.4-latex.md +138 -0
  42. data/F24Lec_MD/lec06/6.5-Edgeworth.md +269 -0
  43. data/F24Lec_MD/lec07/7.1-inequality.md +283 -0
  44. data/F24Lec_MD/lec07/7.2-historical-inequality.md +237 -0
  45. data/F24Lec_MD/lec08/macro-fred-api.md +313 -0
  46. data/F24Lec_MD/lec09/lecNB-prisoners-dilemma.md +88 -0
  47. data/F24Lec_MD/lec10/Lec10.2-waterguard.md +401 -0
  48. data/F24Lec_MD/lec10/lec10.1-mapping.md +199 -0
  49. data/F24Lec_MD/lec11/11.1-slr.md +305 -0
  50. data/F24Lec_MD/lec11/11.2-mlr.md +171 -0
  51. data/F24Lec_MD/lec12/Lec12-4-PersonalFinance.md +590 -0
  52. data/F24Lec_MD/lec12/lec12-1_Interest_Payments.md +267 -0
  53. data/F24Lec_MD/lec12/lec12-2-stocks-options.md +235 -0
  54. data/F24Lec_MD/lec13/Co2_ClimateChange.md +139 -0
  55. data/F24Lec_MD/lec13/ConstructingMAC.md +213 -0
  56. data/F24Lec_MD/lec13/EmissionsTracker.md +170 -0
  57. data/F24Lec_MD/lec13/KuznetsHypothesis.md +219 -0
  58. data/F24Lec_MD/lec13/RoslingPlots.md +217 -0
  59. data/F24Lec_MD/lec15/vibecession.md +485 -0
  60. data/F24Textbook_MD/00-intro/index.md +292 -0
  61. data/F24Textbook_MD/01-demand/01-demand.md +152 -0
  62. data/F24Textbook_MD/01-demand/02-example.md +131 -0
  63. data/F24Textbook_MD/01-demand/03-log-log.md +284 -0
  64. data/F24Textbook_MD/01-demand/04-elasticity.md +248 -0
  65. data/F24Textbook_MD/01-demand/index.md +15 -0
  66. data/F24Textbook_MD/02-supply/01-supply.md +203 -0
  67. data/F24Textbook_MD/02-supply/02-eep147-example.md +86 -0
  68. data/F24Textbook_MD/02-supply/03-sympy.md +138 -0
  69. data/F24Textbook_MD/02-supply/04-market-equilibria.md +204 -0
  70. data/F24Textbook_MD/02-supply/index.md +16 -0
  71. data/F24Textbook_MD/03-public/govt-intervention.md +73 -0
  72. data/F24Textbook_MD/03-public/index.md +10 -0
  73. data/F24Textbook_MD/03-public/surplus.md +351 -0
  74. data/F24Textbook_MD/03-public/taxes-subsidies.md +282 -0
  75. data/F24Textbook_MD/04-production/index.md +15 -0
  76. data/F24Textbook_MD/04-production/production.md +178 -0
  77. data/F24Textbook_MD/04-production/shifts.md +296 -0
  78. data/F24Textbook_MD/05-utility/budget-constraints.md +166 -0
  79. data/F24Textbook_MD/05-utility/index.md +15 -0
  80. data/F24Textbook_MD/05-utility/utility.md +136 -0
  81. data/F24Textbook_MD/06-inequality/historical-inequality.md +253 -0
  82. data/F24Textbook_MD/06-inequality/index.md +15 -0
  83. data/F24Textbook_MD/06-inequality/inequality.md +226 -0
  84. data/F24Textbook_MD/07-game-theory/bertrand.md +257 -0
  85. data/F24Textbook_MD/07-game-theory/cournot.md +333 -0
  86. data/F24Textbook_MD/07-game-theory/equilibria-oligopolies.md +96 -0
  87. data/F24Textbook_MD/07-game-theory/expected-utility.md +61 -0
  88. data/F24Textbook_MD/07-game-theory/index.md +19 -0
  89. data/F24Textbook_MD/07-game-theory/python-classes.md +340 -0
  90. data/F24Textbook_MD/08-development/index.md +35 -0
  91. data/F24Textbook_MD/09-macro/CentralBanks.md +101 -0
  92. data/F24Textbook_MD/09-macro/Indicators.md +77 -0
  93. data/F24Textbook_MD/09-macro/fiscal_policy.md +36 -0
  94. data/F24Textbook_MD/09-macro/index.md +14 -0
  95. data/F24Textbook_MD/09-macro/is_curve.md +76 -0
  96. data/F24Textbook_MD/09-macro/phillips_curve.md +70 -0
  97. data/F24Textbook_MD/10-finance/index.md +10 -0
  98. data/F24Textbook_MD/10-finance/options.md +178 -0
  99. data/F24Textbook_MD/10-finance/value-interest.md +60 -0
  100. data/F24Textbook_MD/11-econometrics/index.md +16 -0
  101. data/F24Textbook_MD/11-econometrics/multivariable.md +218 -0
  102. data/F24Textbook_MD/11-econometrics/reading-econ-papers.md +25 -0
  103. data/F24Textbook_MD/11-econometrics/single-variable.md +483 -0
  104. data/F24Textbook_MD/11-econometrics/statsmodels.md +58 -0
  105. data/F24Textbook_MD/12-environmental/KuznetsHypothesis-Copy1.md +187 -0
  106. data/F24Textbook_MD/12-environmental/KuznetsHypothesis.md +187 -0
  107. data/F24Textbook_MD/12-environmental/MAC.md +254 -0
  108. data/F24Textbook_MD/12-environmental/index.md +36 -0
  109. data/F24Textbook_MD/LICENSE.md +11 -0
  110. data/F24Textbook_MD/intro.md +26 -0
  111. data/F24Textbook_MD/references.md +25 -0
  112. data/F24Textbook_MD/summary.yaml +414 -0
  113. metadata +155 -0
@@ -0,0 +1,206 @@
1
+ - week: 1
2
+ count: 1
3
+ notebooks:
4
+ - file: lec01/lec01.md
5
+ title: lec01
6
+ type: lecture-notebook
7
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec01/lec01.ipynb
8
+ - week: 2
9
+ count: 5
10
+ notebooks:
11
+ - file: lec02/Avocados_demand.md
12
+ title: Avocados_demand
13
+ type: lecture-notebook
14
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec02/Avocados_demand.ipynb
15
+ - file: lec02/demand-curve-Fa24.md
16
+ title: demand-curve-Fa24
17
+ type: lecture-notebook
18
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec02/demand-curve-Fa24.ipynb
19
+ - file: lec02/Demand_Steps_24.md
20
+ title: Demand_Steps_24
21
+ type: lecture-notebook
22
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec02/Demand_Steps_24.ipynb
23
+ - file: lec02/PriceElasticity.md
24
+ title: PriceElasticity
25
+ type: lecture-notebook
26
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec02/PriceElasticity.ipynb
27
+ - file: lec02/ScannerData_Beer.md
28
+ title: ScannerData_Beer
29
+ type: lecture-notebook
30
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec02/ScannerData_Beer.ipynb
31
+ - week: 3
32
+ count: 5
33
+ notebooks:
34
+ - file: lec03/3.0-CubicCostCurve.md
35
+ title: 3.0-CubicCostCurve
36
+ type: lecture-notebook
37
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec03/3.0-CubicCostCurve.ipynb
38
+ - file: lec03/3.1-Supply.md
39
+ title: 3.1-Supply
40
+ type: lecture-notebook
41
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec03/3.1-Supply.ipynb
42
+ - file: lec03/3.2-sympy.md
43
+ title: 3.2-sympy
44
+ type: lecture-notebook
45
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec03/3.2-sympy.ipynb
46
+ - file: lec03/3.3a-california-energy.md
47
+ title: 3.3a-california-energy
48
+ type: lecture-notebook
49
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec03/3.3a-california-energy.ipynb
50
+ - file: lec03/3.3b-a-really-hot-tuesday.md
51
+ title: 3.3b-a-really-hot-tuesday
52
+ type: lecture-notebook
53
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec03/3.3b-a-really-hot-tuesday.ipynb
54
+ - week: 4
55
+ count: 6
56
+ notebooks:
57
+ - file: lec04/lec04-CSfromSurvey.md
58
+ title: lec04-CSfromSurvey
59
+ type: lecture-notebook
60
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec04/lec04-CSfromSurvey.ipynb
61
+ - file: lec04/lec04-CSfromSurvey-closed.md
62
+ title: lec04-CSfromSurvey-closed
63
+ type: lecture-notebook
64
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec04/lec04-CSfromSurvey-closed.ipynb
65
+ - file: lec04/lec04-four-plot.md
66
+ title: lec04-four-plot
67
+ type: lecture-notebook
68
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec04/lec04-four-plot.ipynb
69
+ - file: lec04/lec04-four-plot-24.md
70
+ title: lec04-four-plot-24
71
+ type: lecture-notebook
72
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec04/lec04-four-plot-24.ipynb
73
+ - file: lec04/lec04-Supply-Demand.md
74
+ title: lec04-Supply-Demand
75
+ type: lecture-notebook
76
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec04/lec04-Supply-Demand.ipynb
77
+ - file: lec04/lec04-Supply-Demand-closed.md
78
+ title: lec04-Supply-Demand-closed
79
+ type: lecture-notebook
80
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec04/lec04-Supply-Demand-closed.ipynb
81
+ - week: 5
82
+ count: 2
83
+ notebooks:
84
+ - file: lec05/Lec5-Cobb-Douglas.md
85
+ title: Lec5-Cobb-Douglas
86
+ type: lecture-notebook
87
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec05/Lec5-Cobb-Douglas.ipynb
88
+ - file: lec05/Lec5-CobbD-AER1928.md
89
+ title: Lec5-CobbD-AER1928
90
+ type: lecture-notebook
91
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec05/Lec5-CobbD-AER1928.ipynb
92
+ - week: 6
93
+ count: 5
94
+ notebooks:
95
+ - file: lec06/6.1-Sympy-Differentiation.md
96
+ title: 6.1-Sympy-Differentiation
97
+ type: lecture-notebook
98
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec06/6.1-Sympy-Differentiation.ipynb
99
+ - file: lec06/6.2-3D-utility.md
100
+ title: 6.2-3D-utility
101
+ type: lecture-notebook
102
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec06/6.2-3D-utility.ipynb
103
+ - file: lec06/6.3-QuantEcon-Optimization.md
104
+ title: 6.3-QuantEcon-Optimization
105
+ type: lecture-notebook
106
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec06/6.3-QuantEcon-Optimization.ipynb
107
+ - file: lec06/6.4-latex.md
108
+ title: 6.4-latex
109
+ type: lecture-notebook
110
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec06/6.4-latex.ipynb
111
+ - file: lec06/6.5-Edgeworth.md
112
+ title: 6.5-Edgeworth
113
+ type: lecture-notebook
114
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec06/6.5-Edgeworth.ipynb
115
+ - week: 7
116
+ count: 2
117
+ notebooks:
118
+ - file: lec07/7.1-inequality.md
119
+ title: 7.1-inequality
120
+ type: lecture-notebook
121
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec07/7.1-inequality.ipynb
122
+ - file: lec07/7.2-historical-inequality.md
123
+ title: 7.2-historical-inequality
124
+ type: lecture-notebook
125
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec07/7.2-historical-inequality.ipynb
126
+ - week: 8
127
+ count: 1
128
+ notebooks:
129
+ - file: lec08/macro-fred-api.md
130
+ title: macro-fred-api
131
+ type: lecture-notebook
132
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec08/macro-fred-api.ipynb
133
+ - week: 9
134
+ count: 1
135
+ notebooks:
136
+ - file: lec09/lecNB-prisoners-dilemma.md
137
+ title: lecNB-prisoners-dilemma
138
+ type: lecture-notebook
139
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec09/lecNB-prisoners-dilemma.ipynb
140
+ - week: 10
141
+ count: 2
142
+ notebooks:
143
+ - file: lec10/lec10.1-mapping.md
144
+ title: lec10.1-mapping
145
+ type: lecture-notebook
146
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec10/lec10.1-mapping.ipynb
147
+ - file: lec10/Lec10.2-waterguard.md
148
+ title: Lec10.2-waterguard
149
+ type: lecture-notebook
150
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec10/Lec10.2-waterguard.ipynb
151
+ - week: 11
152
+ count: 2
153
+ notebooks:
154
+ - file: lec11/11.1-slr.md
155
+ title: 11.1-slr
156
+ type: lecture-notebook
157
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec11/11.1-slr.ipynb
158
+ - file: lec11/11.2-mlr.md
159
+ title: 11.2-mlr
160
+ type: lecture-notebook
161
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec11/11.2-mlr.ipynb
162
+ - week: 12
163
+ count: 3
164
+ notebooks:
165
+ - file: lec12/lec12-1_Interest_Payments.md
166
+ title: lec12-1_Interest_Payments
167
+ type: lecture-notebook
168
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec12/lec12-1_Interest_Payments.ipynb
169
+ - file: lec12/lec12-2-stocks-options.md
170
+ title: lec12-2-stocks-options
171
+ type: lecture-notebook
172
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec12/lec12-2-stocks-options.ipynb
173
+ - file: lec12/Lec12-4-PersonalFinance.md
174
+ title: Lec12-4-PersonalFinance
175
+ type: lecture-notebook
176
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec12/Lec12-4-PersonalFinance.ipynb
177
+ - week: 13
178
+ count: 5
179
+ notebooks:
180
+ - file: lec13/Co2_ClimateChange.md
181
+ title: Co2_ClimateChange
182
+ type: lecture-notebook
183
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec13/Co2_ClimateChange.ipynb
184
+ - file: lec13/ConstructingMAC.md
185
+ title: ConstructingMAC
186
+ type: lecture-notebook
187
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec13/ConstructingMAC.ipynb
188
+ - file: lec13/EmissionsTracker.md
189
+ title: EmissionsTracker
190
+ type: lecture-notebook
191
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec13/EmissionsTracker.ipynb
192
+ - file: lec13/KuznetsHypothesis.md
193
+ title: KuznetsHypothesis
194
+ type: lecture-notebook
195
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec13/KuznetsHypothesis.ipynb
196
+ - file: lec13/RoslingPlots.md
197
+ title: RoslingPlots
198
+ type: lecture-notebook
199
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec13/RoslingPlots.ipynb
200
+ - week: 15
201
+ count: 1
202
+ notebooks:
203
+ - file: lec15/vibecession.md
204
+ title: vibecession
205
+ type: lecture-notebook
206
+ source_path: /Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec15/vibecession.ipynb
@@ -0,0 +1,267 @@
1
+ ---
2
+ title: "lec01"
3
+ type: lecture-notebook
4
+ week: 1
5
+ source_path: "/Users/ericvandusen/Documents/Data88E-ForTraining/F24Lec_NBs/lec01/lec01.ipynb"
6
+ ---
7
+
8
+ <table style="width: 100%;" id="nb-header">
9
+ <tr style="background-color: transparent;"><td>
10
+ <img src="https://data-88e.github.io/assets/images/blue_text.png" width="250px" style="margin-left: 0;" />
11
+ </td><td>
12
+ <p style="text-align: right; font-size: 10pt;"><strong>Economic Models</strong>, Fall 24 <br>
13
+ Dr. Eric Van Dusen <br>
14
+ Rohan Jha, Matt Yep, Alan Liang<br>
15
+ <br>
16
+ </table>
17
+
18
+ # The Financial Benefits of Your Major
19
+
20
+ ```python
21
+ #%pip install ipywidgets datascience
22
+ import ipywidgets as widgets
23
+ from datascience import *
24
+ import numpy as np
25
+ from ipywidgets import interact, interactive, fixed, interact_manual
26
+ import ipywidgets as widgets
27
+ from IPython.display import display
28
+ import pandas as pd
29
+ %matplotlib inline
30
+ import matplotlib.pyplot as plt
31
+ plt.style.use('fivethirtyeight')
32
+ ```
33
+
34
+ Welcome to Data 88E: *Economics Models*! This class will explore the intersection of Data Science and Economics.
35
+ Specifically, we will utilize methods and techniques in data science to examine both basic and upper-division Economics concepts.
36
+ Throughout the course, we will consider a variety of economic problems both on the macro and micro level.
37
+
38
+ In the first demo of the course, we hope to give you a sense of the types problems you can expect to explore this semester by considering a problem that may be of personal relevance to you: the post-graduate incomes of different majors at Cal.
39
+
40
+ We will be using various visualization techniques to analyze the median incomes of different majors at UC Berkeley, in addition to the median incomes of those same majors at other colleges.
41
+ If you forgot, the median income is the "middle" value: if you sorted all the individual incomes of a major in ascending order, the median would be the value that's exactly in the middle. The median is also called the 50th percentile -- at the median, exactly 50% of the individuals have an income lower than the median.
42
+
43
+ Do not be concerned if you don't understand the code below: this entire exercise is purely a demo to motivate many profound concepts in Economics.
44
+ If you're interested, you may choose to come back to this demo at the end of the course and consider all the different techniques utilized in it - it'd be a great way of reflecting upon how much you've learnt!
45
+
46
+ ## Data Collection
47
+
48
+ Before we can use data science to tackle any issue, we must–well–obtain data (kind of mind-boggling, I know).
49
+ Recall that we want to examine the median incomes of different majors at UC Berkeley as well as the median incomes of those same majors at other colleges.
50
+ The term 'other colleges' is a fairly general one, and in this case we shall consider the average median incomes of those majors at alll other colleges in the United States.
51
+
52
+ In order to obtain a dataset, you can either collect it yourself (via surveys, questionnaires, etc.) or you can use datasets that others have gathered for you.
53
+ In this demo, we are combining 3 different datasets:
54
+ - The median income for each major at Cal was obtained from [Cal's 2019 First Destination survey](https://career.berkeley.edu/survey/survey).
55
+ - The median income for each major overall was obtained from surveys conducted by the American Community Survey (ACS) from 2010 to 2012, a very popular data source for Economics Research! In the survey, ACS essentially calls college graduates and asked them their income as well as what they majored in at college. (As a side note, FiveThirtyEight later published this [article](https://fivethirtyeight.com/features/the-economic-guide-to-picking-a-college-major/) using the results of the survey.) In this project, we will be using a modified version of the ACS survey - we will only be looking at the respondents who are 28 or younger. Can you think of why we would do this?
56
+ - The longitudinal data on long-run outcomes of UC Berkeley alumni was obtained from the [University of California webpage](https://www.universityofcalifornia.edu/infocenter/berkeley-outcomes). We will use this dataset later for a slightly different analysis.
57
+
58
+ Take a moment to consider the ways in which the 3 different datasets were created.
59
+ Is it fair to draw direct comparisons between the datasets? What would be some potential issues and how could the differences in our datasets affect our analysis?
60
+
61
+
62
+ ### Mean vs Median
63
+ Before proceeding further, it is important to consider why we are choosing to look at the median, and not the average, income.
64
+ In order to answer this question, let us think about what the *distribution* of incomes for a population would look like.
65
+ Most likely, you would see a high amount of incomes around or slightly below the mean, with a few massive outlier incomes above the mean.
66
+ For example, consider a theatre major who becomes a star on Broadway - while they'd be doing absolutely fantastic in their career, they are not representative of the average theatre graduate from Berkeley and would likely pull the average income way up.
67
+ For this reason, using the median is more *robust*: it gives us a better idea of what the typical graduate for any major can generally expect to earn.
68
+
69
+ Now we'll load in all the data.
70
+ Take a look at the tables for each dataset.
71
+ Note that `P25th` referes to the 25th percentile of incomes (the income level at which exactly 25% of incomes are lower) and `P75th` refers to the 75th percentile of incomes (the income level at which exactly 75% of incomes are lower).
72
+ You may not know what all the different columns in the tables mean. That's okay!
73
+ As data scientists, we often encounter a lot of irrelevant data that we will discard later.
74
+
75
+ ```python
76
+ # Load in table of all majors' median incomes at Cal
77
+ cal_income = Table.read_table("cal_income.csv")
78
+ cal_income.show(10)
79
+ ```
80
+
81
+ ```python
82
+ # Load in table of all other universities' average major median incomes
83
+ other_income = Table.read_table("recent-grads.csv")
84
+ other_income.show(10)
85
+ ```
86
+
87
+ To make direct comparisons across majors, we combined all the tables above into a single one for us to use below.
88
+
89
+ ```python
90
+ majors = Table.read_table("cal_vs_all.csv")
91
+ majors.show(10)
92
+ ```
93
+
94
+ Our combined table above dropped the columns in above tables that we didn't need to conduct our exploration.
95
+ It has a column `Median Income Difference`: this column is the Berkeley median income minus the overall median income for each major.
96
+ It gives us a sense of the value of Cal over the average university: the difference is the additional income we recieve from obtaining a Cal degree.
97
+
98
+ Before moving forward, take a second to consider how well the above tables would match with each other.
99
+ For example, Electrical Engineering and Computer Science (EECS) is a popular major at Berkeley. However, the `majors` dataset didn't have a direct equivalent for it.
100
+ Instead, the `majors` dataset had Electrical Engineering, Electrical Engineering Technologies and Computer Engineering as separate majors.
101
+ Since in theory students in EECS focus more on computer engineering, we chose to use the computer engineering data for drawing comparions in our final, combined table.
102
+ However, there's room for ambiguity here and that is another potential flaw in our exploration!
103
+
104
+ The interactive widgets below allows you to select majors to compare them. Play around with this for a bit; what do you observe?
105
+
106
+ ```python
107
+ def display_major_table(major):
108
+ selected = majors.where("Major", are.contained_in(major))
109
+ selected.show()
110
+
111
+ ind = np.arange(selected.num_rows)
112
+ width = 0.35
113
+
114
+ fig, ax = plt.subplots()
115
+ rects1 = ax.bar(ind - width/2, selected.column("Cal Median"), width,
116
+ label='Cal Median', color = "navy")
117
+ rects2 = ax.bar(ind + width/2, selected.column("Overall Median"), width,
118
+ label='Overall Median', color = "goldenrod")
119
+
120
+ ax.set_ylabel('Income')
121
+ ax.set_xticks(ind)
122
+ ax.set_xticklabels(selected.column("Major"))
123
+ ax.set_title("Median Incomes for Selected Majors at Cal (Blue) and Other Universities (Gold)", fontsize= 13)
124
+ plt.xticks(rotation=90)
125
+
126
+
127
+ dropdown_majors = widgets.SelectMultiple(
128
+ options=majors.column("Major"),
129
+ description="Major",
130
+ disabled=False
131
+ )
132
+ display(widgets.interactive(display_major_table, major=dropdown_majors))
133
+ ```
134
+
135
+ ## The most lucrative major
136
+
137
+ Let's imagine that Belfort is a freshman at Berkeley.
138
+ Belfort is a very unique individual - he is someone who would be equally good at all majors and enjoys all majors equally.
139
+ He also believes that money is the most important thing in the world.
140
+ These assumptions are vastly oversimplifcations and not the case for anyone in real life; but in Economics you'll find that we end up making significant simplifications to abstract away all the potential complications!
141
+
142
+ Since Belfort is equally good at and happy with all majors at Cal, the major he chooses is purely dependent on how much money he can earn after college with that major.
143
+ Therefore, he will choose the major with the highest median income.
144
+
145
+ Let us sort our table by the `Cal Median` column in descending order to see which major that would be.
146
+
147
+ ```python
148
+ majors.sort('Cal Median',descending=True).show(10)
149
+ ```
150
+
151
+ However, what if instead of just wanting the maximum amount of cash after college, Belfort was super proud of getting into Berkeley and instead wanted to maximise the amount of additional benefit he recieves from attending Berkeley over other universities?
152
+ Let's sort our table by the `Median Income Difference` column in descending order to see which major would give Belfort the highest additional income from going to Berkeley.
153
+
154
+ Do any values in either of our sorted table surprise you? Why might that be?
155
+
156
+ ```python
157
+ majors.sort("Median Income Difference",descending=True).show(10)
158
+ ```
159
+
160
+ Let's now do the opposite and sort our table by the `Median Income Difference` column in ascending order.
161
+
162
+ ```python
163
+ majors.sort("Median Income Difference").show(10)
164
+ ```
165
+
166
+ As you can see in the table, the median income difference for both nuclear engineering and astrophysics is negative.
167
+ This is rather peculiar, especially since Cal has great programs for both those majors.
168
+ Why would Cal graduates earn less income than the graduates of the average college for those 2 majors?
169
+
170
+ *Hint*: consider what each of our datasets describes. Is it an apples-to-apples comparison?
171
+
172
+ The answer is because the dataset with the median incomes for all colleges actually described recent graduates (people who are 28 and younger, rather than just fresh college graduates.
173
+ It is likely that most people who graduate with Nuclear Engineering and Astrophysics degrees in other colleges tend to stay in the industry for their fields and keep accumulating experience. This would explain why a dataset that includes data from 28 year olds would have a higher median income than fresh Cal graduates in the same field.
174
+
175
+ ### Generalization and Causal Inference
176
+
177
+ While Belfort would be equally good at and enjoy all majors equally, the implications for him may not generalize for anyone else.
178
+
179
+ If you decide to major in EECS, it does not mean that you will have more income post-grad than that from majoring in anything else. For example, someone who is a fantastic artist but not very good at computer science would probably make far more money majoring in art than in EECS. In addition, just because EECS has the highest median income overall doesn't mean that any individual is guaranteed a high median income if they decide to major in EECS. Overall, our results are not completely *generalizable* to others.
180
+
181
+ The causal effect of majoring in EECS on incomes may also be overstated. Consider the fact that those who major in EECS tend to come from families whose parents are already in working in tech. As a result, these students will likely also find better jobs post-grad. This is what we call a confounding variable -- it is positively correlated with our treatment variable of majoring in EECS. If we do not observe this confounding factor, our analysis would likely overstate the effect of an EECS degree on post-grad incomes.
182
+
183
+ ### A brief discourse on utility
184
+
185
+ From seeing our results, you may be wondering: *why doesn't everyone just major in EECS then*?
186
+
187
+ For Belfort, money is the only thing in the world that derives happiness.
188
+ However, this is once again an oversimplication for the vast majority of people in the real world.
189
+ People derive utility from sources other than just their bank account; often, we choose relatively lower-paying jobs in order to derive more happiness in our lives.
190
+
191
+ **Utility** is a measure of 'satisfaction' or 'happiness' when we consume a good, while **disutility** is a measure of 'unsatisfaction' or 'harm' when we consume a *bad*. In economics, one assumption we will always make is that people will always seek to maximize their utility and minimize their disutility.
192
+
193
+ However, we encounter *diminishing marginal utility* as we consume more and more of a good. For example, the utility of the first cookie you eat is likely much higher than the 20th cookie you eat. Similarly, we may encounter *increasing marginal disutility* as we consume more and more of a bad. For example, the disutility of the first hour doing something you dread is probably not as bad as the 10th hour of doing something you dread.
194
+
195
+ For many of us, money provides a source of utility, while working or the studying required to get there may provide a source of disutility. This presents a tradeoff: for some, the disutility from studying EECS or working as a programmer greatly outweights the utility from the money. Perhaps another job in a different field requires significantly lower disutility to achieve, without much impact on the utility of the income associated with it. This phenomenon would explain why not everyone decides to major in EECS!
196
+
197
+ ## Incomes Over Time: Computer Science vs Economics
198
+
199
+ So far our exploration of the data has considered a rather general timeframe of "post graduation", but perhaps it would be more insightful if we dove in and took a look at how incomes differed across various ages. We can do so using the table below that consists of data collected by the [UC ClioMetric History Project](http://uccliometric.org/).
200
+ By compiling a database of digital student transcripts of all UC undergraduates and then linking California wages to individuals in the transcript database,
201
+ they were able to produce comprehensive dashboards that visualize demographics, major choices, and long-run incomes of each UC campus’s alumni over the past 70 years.
202
+
203
+
204
+ You can learn more about how they collected the data [here](https://www.universityofcalifornia.edu/infocenter/long-run-methodology), but for now we will just focus on a snapshot of the data.
205
+ In particular, we are interested in exploring how percentile incomes compare between Cal alumni who majored in computer science versus those who majored in economics. Run the following cell to check it out.
206
+
207
+ ```python
208
+ cs_vs_econ=Table.read_table("cs_econ_by_age.csv")
209
+ cs_vs_econ.show(10)
210
+ ```
211
+
212
+ Here we have a table where each row corresponds to a certain age.
213
+ It begins with age 23 (typically how old people are when getting their first job out of college), and goes up until age 62 (when people retire from the workforce).
214
+
215
+ Let's graph our data using some line plots: line plots are especially useful when trying to visualize trends that change over time.
216
+
217
+ Run the following cell to visualize the data. The yellow lines correspond to CS incomes, while the blue lines correspond to Econ incomes.
218
+
219
+ ```python
220
+ df = cs_vs_econ.to_df()
221
+ df.plot("Age",color=["goldenrod","gold","yellow","khaki","navy","mediumblue","royalblue","cornflowerblue"])
222
+ plt.ylabel("Annual Income in Dollars")
223
+ plt.title("Comparing Incomes of Computer Science Majors vs Economics Majors");
224
+ fig = plt.gcf()
225
+ fig.set_size_inches(15, 11)
226
+ ```
227
+
228
+ Let's take a look at how the incomes compare at each percentile. The most notable trend is probably the fact that for the most the part, CS majors typically make more money than Econ majors.
229
+ We especially observe this trend in the 25th and 50th percentiles, and this follows accordingly with our exploration earlier in the notebook that students who majored in L&S Computer Science on average had a higher median income than pretty much every other major.
230
+
231
+ The graph above helps explain why CS is one of the most popular majors here at Berkeley.
232
+ Software engineering and related disciplines have a huge demand for fresh talent, so that individuals entering these fields are duly compensated. This in and of itself is a big appeal of students wanting to major in computer science.
233
+
234
+ Right off the bat out of college, fresh CS graduates are looking at a six figure income: even the 25th percentile of CS majors are making over $103,000 by the time they are 25. At any given percentile level, CS graduates outearn their Economics counterparts immediately post-graduation.
235
+
236
+ ### Intertemporal Effects
237
+
238
+ However, we don't just choose our majors based off of the immediate post-graduation income. Intuitively, we would want to maximize our total lifetime income we make. This idea is called *intertermporal utility maximization*: Economists often take into account one's utility across all possible time periods.
239
+
240
+ Considering lifetime income, which major would be better? Well, it depends: if you are at the bottom 25th or 50th percentile, CS is better. This suggests that the typical Economics major will likely never outearn the the typical CS major.
241
+
242
+ However, we observe that Economics majors at higher percentiles ultimately overtake CS majors in earnings. Intuitively, this should make sense. Perhaps top Economics majors are more likely to become successful executives later on in their careers while make more money than top CS majors, who continue to stay as software engineers or become engineering managers.
243
+
244
+ ### Risk
245
+ We observe that Economics majors have a much larger spread in their lifetime earnings than CS majors: top Economics graduates make significantly more than bottom Economics graduates, compared to top CS and bottom CS graduates.
246
+
247
+ This brings to the light the notion of risk. Majoring in CS carries relatively lower variance: whether you are
248
+ a top notch developer in the 75th percentile or a subpar developer in the 25th percentile, you will probably make a solid living. Since most CS majors typically end up pursuing similar careers in the realms of software development, there is less **variance** in the occupations. There is also less **risk**: most CS majors can expect to land a software engineering job and continue working as one twenty years into their career.
249
+
250
+ The same story is less true for Economics majors: a top-notch Economics major will significantly out-earn a subpar Economics major. This is partly due to the vastly differing occupation types Economics majors become: analysts, bankers, consultants, just to name a few (Economics is a very versatile degree, afterall). Twenty years down the line, the top Economics majors will have higher ceilings perhaps with a lot of opportunity for leadership or executive positions. There is a lot more **variance** in the types of jobs and thus salaries that Economics majors will attain. In addition, there is a lot more **risk**: not every Economics major will become a top executive, and most end up with more 'average' jobs that earn less than that of similar percentile CS majors.
251
+
252
+ This means that if you know you are at the top regardless of your major, you will tend to ultimately earn more income as an Economics major than a CS major. But a caveat: it's impossible to guarantee that you will be in the top, no matter how hard you work. Often, life has uncertainties and involves a great deal of luck to become successful.
253
+
254
+ The table and graph above only considered the percentile incomes of CS and Economics majors, but if you're interested in drawing more comparisons, check out [this page](https://www.universityofcalifornia.edu/infocenter/berkeley-outcomes). You can compare between all types of popular majors at UC Berkeley, and even toggle around with more features like gender, ethnicity, or even specific courses.
255
+
256
+ ## An Afterword
257
+
258
+ In this demo, we've covered a series of fundamental Economics ideas such as income, utility, and risk. We've also gone over a series of more statistical concepts that are also at the heart of empirical Economics such as causal inference, generalization, and unobserved variables. We did this all using data science techniques and visualizations, while being cognizant of potential sources of error. We will be revisiting a lot of these themes in later parts of the course.
259
+
260
+ From this exercise you may have noticed that pursuing either Economics, Data Science, or both are great options in terms of post-graduation incomes. This means you've probably chosen wisely to have ended up in this class.
261
+
262
+ Welcome to Data 88E!
263
+
264
+ ```python
265
+
266
+ ```
267
+