Skip to content
Undergraduate textbook for Econometrics with R
HTML R Other
Branch: master
Clone or download
Latest commit ac1f1e6 Oct 10, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update issue templates Jan 16, 2019
R finished. transition to modenrdive. Oct 10, 2019
_archive moved interactions to after intro of dummy vars. changing most exampl… Sep 30, 2019
_tex finished testing Nov 3, 2018
_to_be_done finished. transition to modenrdive. Oct 10, 2019
data add data Oct 10, 2019
images finished. transition to modenrdive. Oct 10, 2019
inst closes issue #144 Oct 10, 2019
man final version this branch Nov 15, 2018
teachers update with debriefing notes. moved meta from /inst/teachers to /teac… Jan 9, 2019
tests require shiny 1.2. updates CI completely. [nobook] Nov 5, 2018
.Rbuildignore only ignore top level Rmd files Apr 3, 2019
.gitignore update slides Oct 30, 2018
.travis.yml mac os failing Oct 10, 2019
01-R.Rmd removed engine.opts in chapter 6, fixed chapter 1 issue with refs and… Aug 16, 2019
02-SummaryStats.Rmd echo false Nov 6, 2018
03-linear-reg.Rmd closes issue #144 Oct 10, 2019
04-MultipleReg.Rmd add stargazer correct latex output if pdf Sep 30, 2019
05-Categorial-Vars.Rmd add stargazer correct latex output if pdf Sep 30, 2019
06-StdErrors.Rmd finished. transition to modenrdive. Oct 10, 2019
07-Causality.Rmd rearranged chapters and started with opportunity atlas exercise Aug 16, 2019
08-projects.Rmd finished. transition to modenrdive. Oct 10, 2019
09-references.Rmd removed slides from book. changed build and deploy to account for tha… Aug 28, 2019
DESCRIPTION pierre's name Oct 10, 2019
GA-tracker.html added googel tracker Apr 3, 2018
LICENSE updated license and readme for attribution Apr 10, 2018
NAMESPACE finished. transition to modenrdive. Oct 10, 2019 add slides [skip ci] Aug 19, 2019
ScPo.jpg added googel tracker Apr 3, 2018
ScPoEconometrics.Rproj converted into working R package. Jun 6, 2018
_bookdown.yml changed ymls Apr 3, 2018 removed slides from book. changed build and deploy to account for tha… Aug 28, 2019 removed slides from book. changed build and deploy to account for tha… Aug 28, 2019
_output.yml re-enabled pdf of the book. added new environments for info, warning … Aug 23, 2018
appveyor.yml fix failing appveyor as suggested in krlmlr/r-appveyor#135 Aug 16, 2019
book.bib here is the minimal example Nov 10, 2015
favicon.gif added googel tracker Apr 3, 2018
index.Rmd rearranged chapters and started with opportunity atlas exercise Aug 16, 2019
packages.bib updated references. trigger full rebuild. Oct 10, 2018
preamble.tex added hypothesis testing Nov 2, 2018
style.css wip [skip ci] Sep 24, 2018
toc.css smaller font size for the top menu Mar 19, 2016

ScPo UG Econometrics

This is the git repo for the UG Econometrics book taught to 2nd year students at SciencesPo.

Slides? If you are looking for the slides, they are in the ScPoEconometrics-Slides repo.


  1. Status
  2. Usage and Installation
  3. Meta Infos for Teachers
  4. How to Contribute
  5. License and Copyright


Tests on MacOS and Linux: Build Status

Tests on Windows: Build status

Usage and Installation

In order to participate in the course and to use the course material, you need to

  1. install R: download for free at
  2. install the RStudio IDE at
  3. We recommend to use our code exclusively via RStudio.
  4. install this R package in your computer. To do so, just copy and paste those lines into your RStudio console:
if (!require(devtools)) {install.packages("devtools"); library(devtools)}
install_github(repo = "ScPoEcon/ScPoEconometrics")

Shiny Apps

A key part of this course are a series of interactive applications (or apps) that we developed with the shiny framework. You launch the apps from a running R session on your computer. The app will run in your web browser. You launch an app like this from R:

library(ScPoEconometrics)   # load our library
launchApp('SSR_cone')       # runs the `SSR_cone` app in browser

launchApp()                 # no arg produces an error that shows all available apps
Error: Please run `launchApp()` with a valid app as an argument.
Valid apps are: 'anscombe', 'confidence_intervals', 'corr_continuous', 
'datasaurus', 'reg_constrained', 'reg_dummy', 'reg_dummy_example', 
'reg_full', 'reg_multivariate', 'reg_simple', 'reg_standardized', 
'sampling', 'SSR_cone', 'standard_errors_changeN', 'standard_errors_simple'

Here is a screenshot of the SSR_cone app:



In order to run the accompanying tutorials you would type, for example:


Meta Information for Teachers

This section is only relevant if you want to teach this course.

All material of this course is open source, and you are free to use it. Please refer to the license section below for the precise wording and terms of the agreement. In particular, please stick to the agreement about proper citation of this repository.

There is some relevant material in the teachers folder. In particular, the document contains a detailed explanation of the course structure, as well as a section on student feedback from the first iteration of the course. The few other documents in there should be self explanatory.

As outlined in the license section, you are free to use and re-use any parts of the content as you see fit. For instance, you could re-use our slides, and modify them, or publish a different version of our textbook (with proper attribution). However, it could be valuable to integrate your changes/additions to the project. In this case, please read on in the next section about how to make contributions.

Contribution Workflow - Developers only!

This section is only for people who want to contribute code to this project.

  1. fork this repository
  2. clone your fork to your computer: git clone url_of_your_fork
  3. Start to work on your things on a new branch: git checkout -b new_branch
  4. commit your work to that new branch!
  5. Place your new stuff on top of the most recent upstream/master:
    1. add the upstream repo as a remote: git remote add upstream
    2. Use the rebase command
    # git add your stuff
    # git commit your stuff
    git fetch upstream   # get stuff from upstream
    git rebase upstream/master  # merge upstream master and put your commits on top of it
  6. push that branch to your fork: git push origin new_branch
  7. create pull request on upstream (from your fork at


The book is made using bookdown. You can find the preview of an example at


This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

You are free to:

  • Share — copy and redistribute the material in any medium or format
  • Adapt — remix, transform, and build upon the material

under the following terms:

  1. Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. We are happy to suggest the following citation if you use our material in your work:
> citation("ScPoEconometrics")

Oswald F, Robin J, Viers V (2018).
Introduction to Econometrics with
R. SciencesPo Department of
Economics, Paris, France. <URL:>.

A BibTeX entry for LaTeX users is

    title = {Introduction to Econometrics with R},
    author = {Florian Oswald and Jean-Marc Robin and Vincent Viers},
    organization = {SciencesPo Department of Economics},
    address = {Paris, France},
    year = {2018},
    url = {},
  1. NonCommercial — You may not use the material for commercial purposes.
  2. ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.


Under the CC licence above, we are obliged to attribute any material that this book uses and which was shared under the same license:

  1. Large parts of Chapter 1 Introduction to R are copied appliedstats by David Dalpiaz. I added a couple of practical tasks and made some minor edits.
  2. Chapter 2 is partly based on appliedstats, but only up to scatterplots.
You can’t perform that action at this time.