+20 votes
asked ago in General Economics Questions by (520 points)
Despite my deep and abiding personal love for Stata, I've recently made the push for our department to switch to R for undergrads, and we're going forward with it. It's a little harder  to use, but students can actually get their own copy without paying, and it has a better chance of being a useful job market skill (perhaps not as good a chance as Python or, uh, Excel, but I don't really want to be teaching econometrics with either). Plus it's multi-domain, so this switch is allowing us to phase out a complicated Stata/EViews/SPSS mix for one package across all classes.

I'm curious what others think about this. What have you found the most useful for teaching? Which is a better skill for students to come out of the degree with? The answer doesn't just have to be Stata or R either. You could be some strange soul teaching SAS to juniors.
commented ago by (110 points)
I love this question. But I suggest you don't overthink it. I'm late in my career as a business economist (with a Ph.D.) and have had to learn the following languages:

Basic/Fortran (not for econometrics but a great building block)
APL (used a European econometrics package from the 1970s called EPL written in this)
Shazam (if anybody knows what it is)
AREMOS (a proprietary package from Wharton Econometric Forecasting Associates)

I now use Eviews in a business context and it is perfectly satisfactory. Also, you need it if you want to do traditional Klein-style models. These may not be popular in academia but are widely used in business.

I tested STATA and thought that Eviews was a better time series vehicle, but maybe that's me.

No Excel, please. I have spent too much time watching people create complex and undecipherable spreadsheets.

The real point is that once you learn one language, and understand the logic of what you are trying to do, the skills are transferable. That's why I suggest not overthinking it.

16 Answers

0 votes
answered ago by (3.5k points)
We use EViews in the introductory course. (I should remark that I have some conflict of interest about this.) Ease of use trumps other concerns. Also, EViews for students is only $50, so that is not a major issue. We do use Stata in more advanced courses.
commented ago by (3.3k points)
I was taught EViews in an introductory course and would like to strongly suggest you stop this practice! I understand it is cheap and easy for students to learn, but it was a complete waste of my time (as well as the time of students who did not go on to study economics). For basic basic intro courses, simply use Excel. For anything else use R, Python, or Stata depending on the audience. These poor kids need to get jobs someday you know!
commented ago by (3.5k points)
The number of students who go on to use econometrics in their jobs is trivial. As it happens EViews is widely used in business, although Stata is more widely used in academia and some areas of consulting. Using Excel to teach econometrics is a bad idea.

The main point though is that you have to decide if you are teaching econometrics or teaching software. Nothing wrong with the latter, but it's not my aim.
commented ago by (3.3k points)
I definitely agree most students don't use econometrics in their jobs. And I also agree the aim of an econometric course should be econometrics.

BUT if you are requiring them to learn/use a new software already you have an obligation to choose a software that will be most beneficial to the students in their employment  search, considering access, learning costs, financial costs,..... It is in OUR best interest to not have unemployed econ majors.

That being said, may be EViews is a good choice for this... I am not really qualified to say. I have never used it beyond that course and none of my friends and colleagues in the business world use it (or probably have even heard of it). But that's anecdotal. I will say there a few blogs on the topic of usage and popularity of statistical software/languages. One I can't find now but will post if I can find it and another here: http://r4stats.com/articles/popularity/ which doesn't even have EViews as having enough share to be considered as a choice.
commented ago by (100 points)
I used eviews professionally for about 9 months because my boss was taught eviews in an econometrics course. We did pretty complex ETL to set up a database of economic and financial time series. Since we used the eviews scripting language, it was a nightmare to code in. No way to run a script from the terminal without opening the GUI, really tough to debug except with print statements, really tough to get help, no community of users, no way to see source code, ugly namespacing and environments, etc. I think it's really risky to use in business because you need solutions which are easy to document, scale well, and are easy to reproduce, and eviews has none of those properties.
+5 votes
answered ago by (1.8k points)
I would say Julia as my top choice and R as second.
commented ago by (2.3k points)
I was wondering about Python. The reason would be the same as for Julia--- to teach them a  little about a general purpose programming language at the same time as how to do regressions. And it's free.   Has anyone tried that?
commented ago by (110 points)
I consider myself fortunate to have taken Intro to Econometrics with a professor who taught in both Stata and R.  During the following semester I began exploring Python because I have interests in oceanography and astronomy as well as economics.  The comparison between R and Python is back-and-forth; each has strengths.  For me, the balance is in favor of Python due to its more "normal" syntax, wide-ranging community, and an endemic sense of humor.
+8 votes
answered ago by (380 points)
R: the learning curve is a bit steeper, but its price (free) and flexibility make it my preferred software for almost any econometrics class or project.  Most of my students have no programming experience, and this gives them new skills they can take with them into business world or graduate school.
commented ago by (100 points)
I have ben using MICRIFIT (Oxford University) -from Pesaran Bross- for years, the learning curve is flat and short, and gives the ultimate econometris with everythinh included, old, new advanced..try it!!
+4 votes
answered ago by (500 points)
STATA, easy to learn and you can pretty much do anything with it.
+7 votes
answered ago by (400 points)
Since most undergraduate Economics majors will not go into academia, I definitely think teaching them R is the way to go. While you could argue that it's better to use STATA or EViews for an Econometrics class since they're easier to learn and you can therefore focus more on teaching then econometrics rather than programming, I think it makes the major more valuable overall to students if you teach them some R due to the fact that R is somewhat common in industry (unlike STATA or EViews). It's also just closer to a more "traditional" programming language like Python, so it would be easier for them to pick up Python after learning R than after learning STATA. Plus, since R can be downloaded for free, they may even choose to learn more about R prior to entering the job market.

TL;DR: I think the marginal benefit for students of learning some R is much higher than the marginal benefit of being able to teach a little more econometrics while using STATA or EViews. I also really just think that, except for the students looking to go into academia, the overall benefit of learning STATA or EViews is close to zero.
commented ago by (110 points)
I used R in my undergarduate econometrics courses last year. I think the programming language capabilities of R give the students a better intuition of econometric modeling compared to Eviews or Stata. I observed that students were excited by finding ways to code solutions for selected problems.  Since coding requires some experience, practicing should be encouraged.
commented ago by (400 points)
Yea, that is true. I can see how using R may actually give students better econometric intuition than using Stata since you have to more-so set up the model than in Stata.
+1 vote
answered ago by (3.3k points)
FORTRAN 77                                .
commented ago by (3.3k points)
updating my priors... jokes are not allowed on EconSpark.
commented ago by (280 points)
But they should be!  (I thought it was funny.)
+3 votes
answered ago by (350 points)
edited ago by
I'm an undergraduate who's benefited tremendously from learning R. The concern about "R is a programming language, this class is not about teaching them how to program" is generally off the mark. My professor attached a brief R tutorial for those with no exposure to it at the beginning of the class. While teaching the material, he appends notes on the requisite commands to do certain tasks in R. That is the sum total of his time spent teaching R - it has hardly hijacked the class.

R can be covered without going into its sophistication as a programming language, leaving the focus squarely on the material. It's similar to how Stata has some sophistication as a language, but little of that sophistication actually needs to be covered to use Stata in a class. Incidentally, I struggled far more with learning Stata than with learning R due to the wealth of online resources that could answer any doubts I had about R.

Edit: https://ocw.mit.edu/courses/economics/14-381-statistical-method-in-economics-fall-2013/study-materials/MIT1 is a model of teaching metrics with R. Reading this should be enough to illustrate that extensive focus on the programming aspects of R is not needed to use it.
commented ago by (2.3k points)
Link doesn't work for me.
+2 votes
answered ago by (190 points)
I am currently taking Econometrics. We are "learning" Matlab, and STATA.  We are all struggling with Matlab, the professor, unfortunately, talk the screen how to use it, and I don't think anyone has figure out how to run a regression.  STATA is really easy. Does anyone use Matlab? The other Econometrics professor at my university is using R instead and the TA knows R but not Matlab.
commented ago by (520 points)
Matlab is I believe common for graduate level econometrics since it makes it fairly straightforward to program the estimators yourself rather than having the package do it for you. I've never heard of it for undergrad econometrics before.
commented ago by (3.5k points)
First, I agree with what Nick_HK says.

Past that, here's a hint. If y is a vector with the dependent variable and X is a matrix where the columns are the independent variables (possibly including a column of ones), then

betaHat = X\y;

gives the regression coefficients. The residuals are

resid = y-X*betaHat;

and the variance-covariance matrix is

vcov = (sum(resid.^2)/(length(y)-size(X,2)))*inv(X'*X);

So the standard errors are

se = sqrt(diag(vcov));

%warning: this is from the top of my head; could be typos.
commented ago by (190 points)
How about running a regression. That's what my whole class couldn't figure out.
commented ago by (3.5k points)
That's the code for a basic regression that I just posted. If you have the statistics toolbox available, there is a built-in function called regress.

I suspect this exchange is evidence that Matlab may not be the best way to teach most undergraduate econometrics courses.
+2 votes
answered ago by (710 points)
I have been using SAS to teach undergrad econometrics -- SAS on Demand is free for students, and being cloud-based, it's platform-independent. That being said, I much prefer R & Stata for my own use and would rather teach the course in R. I've been sticking with SAS to improve my students' employability, but if R is gaining  popularity in the corporate world I would much rather use it. I've been trying to get a sense of when/whether to switch; our Analytics masters program is now all R & Python.  

I do actually introduce econometrics with Excel, but I show them its limitations early on and then we move onto SAS. I'd like them to be able to run regressions in Excel because every place they work at will have it.

FWIW the default SAS "proc reg" output is actually great for building intuition about what the numbers really mean & what the implications of violated assumptions are. It's just that the code is so inelegant compared to R!

I have also decided to take the plunge & use Angrist & Pischke's Mastering Metrics to teach it starting Spring '19, rather than Wooldridge. So now would be a good time to make a switch.
+1 vote
answered ago by (250 points)
Gretl is opensource software dedicated to econometrics (R isn't dedicated to econometrics). It has the click-to-select functionality that lures the uninitiated, but also a very easy language with which one can code pretty sophisticated things. It has passed the tests for numerical accuracy and random number generation. In my experience  it is the ideal program for undergraduate studies, leaving the R-behemoth for postgraduate and research, even though once having used Gretl, the temptation to keep using it for as many projects as possible will be very strong.

+2 votes
answered ago by (630 points)
We were taught EViews in the first year of my undergrad program then Stata in the second year. It was pretty confusing to switch from EViews to Stata when none of us knew much econometrics or coding, and I know *no-one* who has ever used EViews since. I don't have a view on Stata vs R, but I don't think EViews is particularly useful!
+5 votes
answered ago by (350 points)
I am a HUGE fan of R -- one of my many grad school dreams is to successfully push our dept to teach it to undergrads. (So nice job doing that!)

I learned R after undergrad when I was a pre-doc RA before my PhD. I originally learned it because I wanted to try out data visualization techniques and the R ggplot2 package is famous for this... but then eventually I started doing everything with it. And I mean everything... data cleaning/analysis, visualization, (use R notebooks!) but ALSO I write my papers and presentations right out of RStudio as well using R markdown. Even my personal website is made and maintained using the R blogdown package. One of the amazing things about R is that it's not just a statistics thing. It can be an incredible tool for almost every dimension of your workflow and there are tons of templates and code examples on Github that are publicly accessible.

On a community level, R has an amazing community on twitter (#rstats) and on StackOverflow. I can get questions answered with code examples within a few minutes of searching StackOverflow. On a technical level, R lets you play around with more than one data frame at once. It makes you insanely more productive I believe and much more flexible when cleaning/organizing your data. On a philosophical level, using something that is free and open source means for a more open and collaborative research style. I want anyone to be able to run my code for replication's sake... not just someone with a license via private industry or university access.

PS: I actually gave a presentation once about using R, so if you're curious at all... here's that presentation: https://thelittledataset.com/about_files/Albright_rladies.pdf

PPS: If anyone wants any R templates for papers/presentations or notebook code examples, message me and I'm happy to help out.
+2 votes
answered ago by (380 points)
I was originally slated to teach a stats/data analysis/research methods class this year, but it was cancelled at the last moment.  (At my school a “course” meets 12-16 hours a week for 10-30 weeks, so it’s possible to cover a lot of ground.)  Like others responding to this question, I debated which way to go on software, mainly over whether the learning curve with R was worth it.

What I finally decided was to go with R but with a twist: for each topic/function a student team would be assigned to scour the web for the best online tutorial resources, especially video.  I hoped this would be a learning activity for them as well as a public service.  At the end of the course I would post the entire curated set of links.

But then the course was cancelled—low enrollment.  (We had a massive enrollment drop at our institution, so many faculty were in the same boat.)  I’m posting this with the hope the idea will be picked up somewhere else.
commented ago by (520 points)
Oh that's a cool idea. After all, the most important programming skill you can really teach is "if you don't know it, here's how you can use the internet to figure it out." I may have to give that a shot.
+1 vote
answered ago by (890 points)
edited ago by
At the ReplicationWiki
that I founded we have an overview of software used in the applied economics literature:

I described this in my 2017 paper Replication and Economics Journal Policies, American Economic Review, Papers and Proceedings, https://doi.org/10.1257/aer.p20171032

More recent numbers are provided in the corresponding discussion on StackExchange:

As you see, Stata is rather dominant, so for economists who want to go into research learning how to use it is a valuable skill. Statisticians more often use R, and I completely agree about the benefit of open software. We should not use black boxes that do things we cannot really check. Different versions of Stata in some cases give different results, and not every student has the competence to discover the reasons behind. Researchers who use macro models prefer software like dynare. An advantage of Stata over for example EViews is that it allows to easily document one's work in do- or log-files. And yes, some researchers still do use Fortran. There are certain time trends for software use as there are time trends in what kind of research is en vogue. I doubt there will be options to integrate artificial intelligence into software like Stata but who knows. For python colleagues of mine have set up a page Python for Econometrics: https://pyecon.org/

If you ever happen to run replications of published empirical studies with your students, please encourage them to add their results to the ReplicationWiki!
–1 vote
answered ago by (160 points)
I, as a current undergraduate double majoring in Economics and Data Science would strongly encourage you to adopt either R or python as your base software to teach students. For three reasons, 1) as you mentioned, they are both free an open source, 2) they are supported by an incredible community that makes significant contributions to both languages as well as provide open-source packages to facilitate specific tasks (there are some packages for econometrics for example), and 3) both R and Python provides the students the capability of experimenting with Machine and Deep learning models which, as we progress in the Data era, will become more and more important to understand in order to make significant contributions to the field.

This is my personal opinion, let me know if any of you agree or disagree.