Air Pollution is getting worse. No it really isn’t!

Originally posted to LinkedIn on October 26, 2022

A student today told me that air pollution was up. The fact is, that is not even close to the truth. Typically students (and many people) lean toward the pessimistic. It is little wonder with the constant blaring of bad news and fear-mongering from those whose agenda is attracting eyeballs or votes (or both). The truth, however, is a stubborn thing, but it is not always front and center.

Check out this graph from the US EPA from their report on Air Quality (https://www.epa.gov/air-trends/air-quality-national-summary, accessed October 26, 2022).


Source: EPA.gov image source https://www.epa.gov/system/files/images/2022-06/1970-2021%20Baby%20Graph_1.png

From 1970, aggregate emissions from 6 common pollutants are down 78%. CO2 alone is down 9%.

At the same time, we consumed 43% more energy, had a 62% growth in population, almost a 200% increase in miles traveled by gas-powered vehicles, and nearly a 300% growth in GDP. At the same time, our standard of living (measured by real GDP per capita) rose 244%. (source US BEA)

Most would conclude, I would observe, that with population and vehicle miles and GDP rising, of course, air quality has to suffer. But that is not the case. Why are people so pessimistic? The evidence everywhere is that the world improves.  

I am not trying to simplify or dismiss real problems, but I am pointing out that the US is one of the world’s best examples of clean air. As countries get rich, they can spend more on cleaning their environment.

Ourworldindata.com says, “Death rates from air pollution are highest in low-to-middle income countries, with more than 100-fold differences in rates across the world.” Air quality is a normal good. As incomes rise and residents can move beyond mere survival demands, it becomes something they will demand. (https://ourworldindata.org/air-pollution).

The following graph shows worldwide death rates due to air pollution on the vertical axis. As countries become rich, they can afford to demand clean air. In the first graph below, countries defined as low-income are shown. The trend is downward for indoor air pollution, but the death rate due to all air pollution stands at 189 per 100,000 residents.

In the second graph, a similar trend is shown for countries the world bank classifies as rich, showing death rates from air pollution is falling. In 2019 the death rate from all air pollution in these high-income countries is 15 per 100,000 residents or less than 8 percent of the low-income countries. In other words, low-income countries, as of 2019, have shown a great reduction in air pollution deaths over time but have a death rate of almost 13 times the high-income countries.

When a country becomes richer, air quality gets better.

How to be the best Economic Data Scientist: The Seven Tools of Causal Inference and Ethics

Originally published on November 21, 2019, on LinkedIn, updated lightly October 29, 2022

My blog tagline is economists put the science into data science. Part of the reason I make this claim is many applied econometricians (sadly not all) place a high value on causality and causal inference. Further, those same economists will follow an ethic of working with data that is close to the 2002 guidance of Peter Kennedy and myself.

Judea Pearl discusses “The Seven Tools of Causal Inference with Reflections on Machine Learning” (cacm.acm.org/magazines/2019/3/234929), a Contributed Article in the March 2019 CACM.

This is a great article with three messages.

The first message is to point out the ladder of causation.

  1. As shown in the figure, the lowest rung is an association, a correlation. He writes it as given X, what then is my probability of seeing Y?
  2. The second rung is intervention. If I do X, will Y appear?
  3. The third is counterfactual in that if X did not occur, would Y not occur?

In his second message, he discusses an inference engine, of which he says AI people and I think economists should be very familiar. After all, economists are all about causation, being able to explain why something occurs, but admittedly not always at the best intellectual level. Nevertheless, the need to seek casualty is definitely in the economist’s DNA. I always say the question “Why?” is an occupational hazard or obsession for economists.

People who know me understand that I am a huge admirer, indeed a disciple of the late Peter Kennedy (Guide to Econometrics, chapter on Applied Econometrics, 2008). Kennedy in 2002 set out the 10 rules of applied econometrics in his article “Sinning in the Basement: What are the rules.” I think they imply practices of ethical data use and are of wider application than with Kennedy’s intended audience. I wrote about Ethical Rules in Applied Econometrics and Data Science here.

Kennedy’s first rule is to use economic theory and common sense when articulating a problem and reasoning a solution. Pearl in his Book of Why explains that one cannot advance beyond rung one without other outside information. I think Kennedy would wholeheartedly agree. I want to acknowledge Marc Bellemare for his insightful conversation on the combination of Kennedy and Pearl in the same discussion of rules in applied econometrics. Perhaps I will write about that later.

Pearl’s third message is to give his seven (7) rules or tools for Causal Inference. They are

  1. Encoding causal assumptions: Transparency and testability.
  2. Do-calculus and the control of confounding.
  3. The algorithmization of counterfactuals. 
  4. Mediation analysis and the assessment of direct and indirect effects.
  5. Adaptability, external validity, and sample selection bias.
  6. Recovering from missing data. 
  7.  Causal discovery.

I highly recommend this article, followed by the Book of Why (lead coauthor) and Causal Inference in Statistics: A Primer. (lead coauthor). Finally, I include a plug for a book in which I contributed a chapter on ethics in econometrics, Bill Franks, 97 Things About Ethics Everyone in Data Science Should Know: Collective Wisdom from the Experts.

Avoiding Pitfalls in Regression Analysis

(Updated with links and more Dec 1, 2020. Updated with SAS Global Forum announcement on Jan. 22, 2021.)

Professors reluctant to venture into these areas do no service to their students for preparation to enter the real world of work.

Today (November 30, 2020)  I presented: “Avoiding Pitfalls in Regression Analysis” during the Causal Inference Webinar at the Urban Analytics Institute in the Ted Rogers School of Management, Ryerson University. I was honored to do this at the kind invitation of Murtaza Haider, author of Getting Started with Data Science.  Primary participants are his students in Advanced Business Data Analytics in Business. This is an impressive well-crafted course (taught in R) and at the syllabus-level covers many of the topics in this presentation. I met Murtaza some time ago online and have come to regard him as a first-rate Applied Econometrician.

Ethics and moral obligation to our students

Just as Peter Kennedy developed rules for the ethical use of Applied Econometrics, this presentation is the first step to developing a set of rules for avoiding pain in one’s analysis. A warning against Hasty Regression (as defined) is prominent.

(Update 1/22/2021: My paper, “Haste Makes Waste: Don’t Ruin Your Reputation with Hasty Regression,” has been accepted for a prerecorded 20 minute breakout session at SAS Global Forum 2021, May 18-20, 2021. More on this in a separate post later.)

Kennedy said in the original 2002 paper, Sinning in the Basement, “… my opinion is that regardless of teachability, we have a moral obligation to inform students of these rules, and, through suitable assignments, socialize them to incorporate them into the standard operating procedures they follow when doing empirical work.… (I) believe that these rules are far more important than instructors believe and that students at all levels do not accord them the respect they deserve.”– Kennedy, 2002, pp. 571-2”  See my contribution to the cause, an essay on Peter Kennedy’s vision in Bill Frank’s book cited below.

While the key phrase in Peter’s quote seems to be the “moral obligation,” the stronger phrase is “regardless of teachability.” Professors reluctant to venture into these areas do no service to their students when they enter the real world of work. As with Kennedy, some of the avoidance of pitfall rules are equally difficult to teach leading faculty away from in-depth coverage.

The Presentation

A previous presentation has the subtitle, “Don’t let common mistakes ruin your regression and your career.” I only dropped that subtitle here for space-saving and not to disavow the importance of these rules in a good career trajectory.

cover slide

This presentation highlights seven of ten pitfalls that can befall even the technically competent and fully experienced. Many regression users will have learned about regression in courses dedicating a couple of weeks to much of a semester, and could be self-taught or have learned on the job. The focus of many curricula is to perfect estimation techniques and studiously learn about violations of the classical assumptions.  Applied work is so much more and one size does not always fit. The pitfalls remind all users to think fully through their data and their analysis. Used properly, regression is one of the most powerful tools in the analyst’s arsenal. Avoiding pitfalls will help the analyst avoid fatal results.

The Pitfalls in Regression Practice?

  1. Failure to understand why you are running the regression.
  2. Failure to be a data skeptic and ignoring the data generating process.
  3. Failure to examine your data before you regress.
  4. Failure to examine your data after you regress.
  5. Failure to understand how to interpret regression results.
  6. Failure to model both theory and data anomalies, and to know the difference.
  7. Failure to be ethical.
  8. Failure to provide proper statistical testing
  9. Failure to properly consider causal calculus
  10. Failure to meet the assumptions of the classical linear model.

How to get this presentation

Faculty, if you would like this presentation delivered to your students or faculty via webinar, please contact me.  Participants of the webinar can request a copy of the presentation by emailing me at myers@uakron.edu. Specify the title of the presentation and please give your name and contact information. Let me know what you thought of the presentation as well.

You can join me on LinkedIn at https://www.linkedin.com/in/stevencmyers/. Be sure to tell me why you are contacting me so I will be sure to add you.

I extend this to those who have heard the presentation before when first presented to the Ohio SAS Users Group 2020 webinar series on August 26, 2020.

Readings, my papers:

Recommended Books:

Other Readings and references:

Myers on Educating Economics Students, SAS Global Forum Proceedings

I am an Award Winner, educating economics students with SASI am a presenter, educating economics students with SAS

This year the SAS Global Forum canceled for good reasons. I was looking forward to walking amongst the cherry blossoms with my wife Kimberly. I remain excited about the opportunity to speak to SAS Educators about educating economics students and to highlight our SAS partnership at the University of Akron, College of Business Administration, Department of Economics. Thanks go to Josh Horstman for his invitation on behalf of the Global Forum Content Advisory Team.  I missed meeting up with all of the great people of the SAS Global Academic Programs including Lynn Letukas, director, and Rochelle Fisher, our program manager for the University of Akron. 

I had hoped to expand friendships with colleagues met and those to be met and those who I have met only online.  And, perhaps most of all, I am disappointed that I missed being presented with the 2020 SAS Distinguished Educator award. 

Honored and humbled

I am still honored and humbled by the 2020 SAS Distinguished Educator award and recall the congratulatory call from Lynn with the same original shock and pleasure. Also, I am honored to be invited to speak at the SAS Global Forum. Thanks to all involved, especially the conference chair, Lisa Mendez, who worked so hard to coordinate this gigantic global event. I was pleased to meet her at SCSUG and hear so much of the news about the upcoming event.

My Published Paper

Nevertheless, I want to announce that my paper is now published in the 2020 SAS Global Forum Proceedings. My paper titled Show Me the Money! (thanks to Josh for that part) Preparing Economics Students for Data Science Careers is embedded below and a link to download is on the floating menu bar. The paper is a combination of my journey over my four-decade career and description of our programs and SAS use in the Department of Economics and why economists make great data scientists.

If you take time to read it I would appreciate any feedback you have. We can discuss curriculum or whatever, and I hope to leave this as I retire from UA as a roadmap for faculty that follow.

Click to access 4705-2020.pdf

Enjoy and please contact me to discuss.

Other posts on educating economics students with SAS

Please check out other SAS education-related blog posts. A few examples of educating economics students:

SAS Boot Camp
SAS Coding, Problem Based Learning and preparing economists for data science careers: frustration to elation
SAS Certificate in Economic Data Analytics
Economic Freedom: Solve Problems, Tell Stories
Importance of Economic Analysis to Data Science

SAS Boot Camp

So this should be fun! We have some students who need a quick dive into SAS programming so they can succeed in their required classes. So starting Friday, January 24, I will offer four 2-hour sessions trying to get them up to speed. I have opened it to any student or faculty at the University of Akron. This boot camp will cover four sessions shown to the right and will acquaint the participant with issues and problems in economic business data analysis. The sessions will progress from raw data-step programming into exploratory and data cleaning and finally through applied econometrics. 

Sessions 2, 3, and 4 are based on the first three papers on My Analytic Papers Using SAS page. See that page for links to the data and code on my github.

Four 2-hour Sessions:

Fri., Jan. 24
Introduction to SAS Programming
Fri., Jan. 31
Time Series Data
Fri., Feb. 7
Cross Section Data
Fri., Feb. 14
Evaluating Decisions

The University of Akron
College of Business Administration
Analytics Lab 176

10:00 am to 12:00 pm. 

Seating is limited and priority will be given to the students and faculty of the CBA. 

Only those with current student or faculty status and a valid university of Akron email address may register.  Those getting seats will be notified on January 22. 

ASSA2020 – Teaching econometric students with SAS(r)

As the new decade begins, I am preparing for my flight to San Diego where my colleague, Sucharita, and I will be interviewing for the Department of Economics as we seek to hire two tenure-track assistant professors for the department to replace the three faculty who are leaving in May. I always enjoy the ASSA (Allied Social Science Association) meetings, but this time I will miss all of the sessions and activities as we have a full interview schedule. As I have reported Data Scientist Jobs Are Increasing For Economists: Evidence from the AEA. We are looking for those who will teach data science to our students.

S285_sas100KIt has been 41 years since I began my academic career. I leave it at the end of this Spring semester and I will miss teaching econometrics and data science to our students. Those who know me understand my passion for SAS(r) in the econometrics curriculum and I am not dissuaded by the presence and importance of R and Python.  Students who learn to program in SAS, learn far more than the analytic power of the worlds leading analytical solution. They learn in one environment how to acquire data, to manipulate and manage that data, to analyze it with powerful procedures and to visualize and report results from that data.

SAS is a great skill for students and their proficiency with SAS prepares them both for careers in SAS and for careers using other languages and systems. I argue from the experience of my students that SAS provides a platform from which those students may easily learn any other language or system that an employer will have. I cannot say the same for R and Python, partly out of ignorance and partly because I have not heard or read that R and Python provide the same firm foundation for future learning of other languages and systems.

Every new Ph.D. economist we interview will be proficient in STATA, few will be proficient in SAS, and many will not list SAS in their skill set.  The willingness of the candidate to learn and teach SAS is critical to our Economics  and Business Data Analytics programs. The University of Akron partners with SAS Global Academic Programs and offers a joint Certificate in Economic Data Analytics to each qualified graduate. Our students are ready to turn data into action using SAS and the unique qualities of critical thinking, problem solving and story telling that is part of all economic curriculums. Economists do put the science into data science. Data Science is far more than predictive analytics. You can make predictive analytics work beautifully in many cases, but there is no substitution for knowing why something works. Economists are masters of explanation and causality, and have the statistical prowess to back it up.

In an earlier blog posting I reviewed the data science textbook I used last semester (A Data Science Book Adoption: Getting Started with Data Science) and in one of the figures I showed that in Ohio while there were over 600 jobs lisiting ‘SAS; there were just fewer than 30 listing ‘STATA.’  Today as I write this there are 521 SAS listings and only 15 STATA listings in Ohio, and nationwide the numbers are 17K SAS jobs to 1.5K STATA jobs. (Indeed.com). I think we are on the right track.

Teaching economics and econometrics with SAS gives students a firm foundation for productive and profitable analytic careers in all data science fields. And our students have done very well in that space.

Wish us luck as we look for two new assistant professors of economics who will contribute to our students’ success. And for those who have read this far, I have been honored as the SAS Distinguished Educator for 2020 and will receive that award at the SAS Global Forum in Washington DC (March 29-April 1). I will also speak on educating economics students for data science careers. You too can attend, register here. Message me at LinkedIn if you are coming, I would love to see you. – Steven C. Myers (Akron)

Economic Freedom: Solve Problems, Tell Stories

Time and time again we hear employers wanting two qualities out of their data scientists, be able to solve problems and tell stories. How important is economic freedom? Does it lead to greater standards of living? The answer can be shown in tables of results well laid out, but visualizing those results has an even greater impact and better tells the story.

If a “picture is worth a thousand words” then a SAS SGPLOT is worth many pages of tables or results. Can you see the story here?

Economic Freedom is shown to be associated with ever higher standards of living across countries.

The problem is whether countries with higher levels of economic freedom also have higher standards of living. It appears that is true. The association seems undeniable. Is it causal? That is another question that the visual begs. Chicken and Egg reasoning doesn’t seem likely here. It does appeal that the association is one way. For that to be established, we have to answer is economic freedom necessary for higher standards of living. And we have to determine that if the economic freedom had not been accomplished would the standard of living not been as high.

More on that in a future post on the importance of “why.” For now, enjoy the fact that their seems to be a key to make the world better off. Oh, not just from this graph, but from countless successes in countries in the past. My undergraduate analytic students are expanding on this finding to see if their choices from the 1600 World Development Indicators of the World Bank hold up in the same way as GDP per-capita does here in this graph. We/they modify the question to “Do countries that have higher economic freedom also have greater human progress?” I am anxious to see what they find.

The Economic Freedom data comes to us from The Heritage Foundation. Let me know what you think about the visual.

This is a followup to my post on my blog at econdatascience.com “Bubble Chart in SAS SGPLOT like Hans Rosing.”

The SAS PROC SGPLOT code to create the graph is on my GITHUB repository. It makes use of Block command for the banding and selective labeling based on large residuals from a quadratic regression. The quadratic parametric regression and the loess non-parametric regression are to suggest the trend relationship.

Sorry Data not included.

Bubble Chart in SAS SGPLOT like Hans Rosing

Robert Allison blogs as the SAS Graph Guy. He recreates using SAS PROC SGPLOT the famous bubble chart from Hans Rosing of Gapminder Institute. Hans shows that life expectancy and income per person have dramatically changed over the years. Because Hans Rosing is a ot the father of visualizations, Robert produces this graph (shown here) and this very cool animation.

I can’t wait to see  Economic Freedom and income per person soon in one of these graphs. My students are trying to do this right now.  At this point in the term they are acquiring two datasets from Heritage on 168 countries, which contain the index of economic freedom for 2013 and 2018. Then they are cleaning and joining them so they can reproduce the following figure and table in SAS PROC SGPLOT for each year.

 

 

 

 

 

 

 

 

 

 

 

 

I have written about this project in prior terms here. Once they have this data joined and the above figures reproduced then they will move on to the final project for this semester. They will be looking through the 1600 World Development Indicators of the World Bank.  Each team of students will choose 5 and will join that to their data to answer the question:

Does Economic Freedom lead to greater Human Progress?

I may share their results, for now this is some pretty cool graphics from the SAS Graph Guy. 

 

 

 

My time with the MS Analytics Students at LSU

Last week I had the pleasure of presenting two papers at the 2019 South Central SAS Users Group Educational Forum in Baton Rouge on the campus of the E. J. Ourso College of Business at Louisiana State University. My thanks to Joni Shreve and Jimmy DeFoor who chaired this conference and treated this traveler so well. (Especially want to call out the chicken and sausage gumbo). I want to reflect on two things. The students and SAS.

As a LSU Professor, Joni Shreve had an outsized role in not only serving the forum as its academic chair, but in also encouraging her MS Analytics students to attended over the two days, October 17-18, 2019. Many of those students attended one or both of my papers. I met most of them and had long side conversations with a few. To a person I was impressed with their interest in analytics and what this economist from up north had to say about the state of applied analytics. These students each have very solid futures. Of course I encouraged them to add an applied econometrics course to their studies (see here or here or even here).

When I started writing the papers for this conference I was focused on SAS. It is after all a SAS conference. I was happy to contribute what may be new SAS techniques to the participants, but the fuller message was not about SAS techniques, but about the process of problem solving, and turning insights into solutions. It is about telling the story, not of SAS, but of the problem and solution. Firm articulation of the problem and the development of a full on testing strategy are messages that rise above any particular software. I am grateful to participants, students and faculty alike who in conversation after assured me that they got the message.

The student are currently in a practicum where Blue Cross and Blue Shield of LA, Director of IT, Andres Calderon, as an Adjunct Professor at LSU, is directing them in a consultative role helping them solve a real business problem. This is ideal education for analytics students. I want to thank Andres for his kind words about my presentations and the value of them to the wider analytic community. I know our conversations will continue and I will be the better for them, better than that, so will the students.

I was made to feel a part of the LSU MS Analytics program if even for two days and I am grateful to Joni Shreve for letting me have that rewarding opportunity.

And about the picture, my wife has threatened to tell Zippy (UA mascot).

Data Scientist Jobs Are Increasing For Economists: Evidence from the AEA

Economists, especially Econometricians, are in hot demand in the field of Data Science. Last March I posted Amazon’s Secret Weapon:  Economic Data Sciences which was one of many similar articles on the high demand. It is the entire premise of this blog and my work at university is to highlight this and point economists and our business data analytic students in that direction. Our curriculum is centered on SAS because having the students learning to program at a base level and to learn the power of SAS is a good basis for future job employment (see Data Analytic Jobs in Ohio – May/June 2019).

Because we are looking for a couple of PhD economists for tenure track positions, I thought to wander around in JOE (Job Openings for Economists) and eventually wandered into wondering how many Data Science jobs were directly advertising in the JOE competing with academic positions (including ours). 

So to sharpen my SAS SGPLOT skills i collected some data and found that indeed Data Scientists are in increasing demand over time in JOE , bur not as much as exists in the general market of Indeed.com.  Clearly in JOE job listings in the August to December timeline are the best time to find a data science job, and August 2019 should grow as more jobs are added leading up to the ASSA meetings in San Diego in January. If you’re there look me up, but I suspect I will be in an interviewing room from dawn to dusk. 

Enjoy! Comments welcomed. 

 

Updated to final 2019-2020 numbers
Preliminary 2019-2020 numbers
What do you think about the SGPLOT?
5/5

For those wanting to see the SAS code

My apologies, Elementor does not handle txt code so well, or I have not yet figured that out. (Small amount of research shows the lack of a code widgit  is a problem with Elementor.)

Code with data and image are available at https://github.com/campnmug/SGPLOT_Jobs

data ds;
input date MMDDYY10. total DStitle NotDStitle;
t=_n_;
Datalines;
2/1/2014 0 0 0
8/1/2014 2 2 0
2/1/2015 0 0 0
8/1/2015 5 2 3
2/1/2016 1 1 0
8/1/2016 11 5 6
2/1/2017 1 1 0
8/1/2017 12 6 6
2/1/2018 2 1 1
8/1/2018 14 11 3
2/1/2019 7 4 3
8/1/2019 12 6 6
;
run;
Title1 bold 'Data Scientist Jobs Are Increasing For Economists: Evidence from the AEA';
Title2 color=CX666666 'Advertisement for Data Scientists in Job Openings for Economists (JOE)';
title3 color=CX666666 "Counts shown are the result of a search of all listings for 'Data Scientist'";
proc sgplot;
vbar date / response = total discreteoffset=-.0 datalabel DATALABELATTRS=(Family=Arial Size=10 Weight=Bold)
legendlabel="Total Data Scientist Jobs" dataskin=gloss;
vbar date / response = DStitle transparency=.25 discreteoffset=+.0 datalabel DATALABELATTRS=(Family=Arial Size=10 Weight=Bold)
legendlabel="Job title is 'Data Scientist' " dataskin=gloss;
yaxis display = none ;
xaxis display = ( nolabel);
inset "To put this in perspective:" " "
"Most 'Data Scientist' and 'Economist' jobs"
"are not advertised in JOE"
"A search for 'Economist' and 'Data Scientist'"
"on Indeed.com yields 514 jobs on Oct 14, 2019"
/ position=topleft border
TEXTATTRS=(Color=maroon Family=Arial Size=8
Style=Italic Weight=Bold);
inset "Aug 2019" "preliminary"
/ position=topright noborder
TEXTATTRS=(Color=black Family=Arial Size=8
Style=Italic );

format date worddate12.;
footnote1 Justify=left 'JOE listings are at https://www.aeaweb.org/joe/listings';
footnote2 Justify=left 'Only active listings in either the Aug-Jan or Feb-Jul timeline were searched.';
footnote3 Justify=left 'Search conducted on Oct 14, 2019, so the last count will grow as new jobs are entered into the system.';
footnote4 ' ';
footnote5 Justify=left bold Italic color = CX666666 'Created by Steven C. Myers at EconDataScience.com' ;
run;
run cancel