+19 votes
asked ago in General Economics Questions by (500 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.

13 Answers

0 votes
answered ago by (3.3k 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 (2k 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.3k 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 (2k 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.
+4 votes
answered ago by (1.7k points)
I would say Julia as my top choice and R as second.
commented ago by (1.8k 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?
+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!!
+2 votes
answered ago by (460 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.
–2 votes
answered ago by (2k points)
FORTRAN 77                                .
commented ago by (2k points)
updating my priors... jokes are not allowed on EconSpark.
+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 (1.8k 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 (500 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.3k 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.3k 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.
+1 vote
answered ago by (670 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.

 http://gretl.sourceforge.net/
+1 vote
answered ago by (610 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) 1 flag
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 (360 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 (500 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.
...