R for econometrics

Learn econometrics by actually doing it in R

A free, hands-on companion to your econometrics course. Every topic comes with runnable R code, real data and plots you can reproduce line by line. The focus is less on the math behind the methods and more on getting them to work.

Start with the basics Browse all topics

58 articles · free and without registration · every example runs on your own machine

New here? Three steps to your first regression

  1. 1

    Set up R and RStudio

    Install both, learn what the four panes are for and how to keep a workspace tidy.

    Install R
  2. 2

    Get data into shape

    Import data sets, reshape them with dplyr and plot what you find with ggplot2.

    Wrangle data
  3. 3

    Run your first regression

    Estimate an OLS model, read the summary output and test whether it holds up.

    Estimate OLS

Introduction to R — the short version

An under-30-page introduction that walks through one realistic workflow and the packages dplyr, ggplot2 and openxlsx. Free PDF, no sign-up.

Download the PDF

From the blog All posts →

  • How Long Will Services Inflation in Austria Stay High?

    Hochmuth and Petz (2026) explain persistent services inflation in the euro area with services prices catching up with goods. This post applies their error correction model to Austria, where the catch-up is already over, and takes a closer look at the role of gastronomy.

  • Is Services Inflation a Catch-Up Story Everywhere in the Euro Area?

    Hochmuth and Petz (2026) explain persistent services inflation in the euro area with the price of services catching up with that of goods. This post estimates their error correction model for each of the 21 euro area countries to see where the explanation holds.

  • Can a Bayesian VAR Beat Professional Forecasters?

    A forecast horse race for Austria, where three Bayesian VAR models from the bvartools package compete against the published projections of six institutions and against a no-change benchmark.

About this site

r-econometrics is written and maintained by Franz X. Mohr. It grew out of the notes taken while learning to use the free statistical software R for econometric work, and it is meant to give you an intuition for the structure of the program and for the statistical functions needed to pass an introductory or intermediate course in econometrics.

It is not a replacement for a good textbook. The math behind the methods is kept short on purpose, so that you can get to a working example quickly and then look up the theory wherever your course expects you to. Everything here is free to read, and the code on every page can be copied straight into your own R session.

About and disclaimer Further resources