Research in Applied Econometrics Chapter 0. Organization 2017-18
Pr. Philippe Polomé, Université Lumière Lyon 2
M1 APE Analyse des Politiques Économiques M1 RISE Gouvernance des Risques Environnementaux
2017 – 2018
Plan
I
Presentation
I
Motivation
I
Organisation
Myself gate.cnrs.fr/spip.php?article44
I
All the slides available via this page
Master RISE http://risques-environnement.universite-lyon.fr Parcours “Gouvernance des Risques Environnementaux”
risques-environnement.universite-lyon.fr
Course Objectives & Motivations
I
Class in Econometrics
I In a unit of English language
I
Goal: Expose students to applied econometrics in English
I Applied examples with environmental economics data
I Students should improve both their applied econometrics skills and their English level
I Attendance and interactions in class
I
Focus on applied techniques: Introduction to R
I More on that later
I
Context : ex ante valuation of public (environmental) policies
I Contingent valuation / stated preferences
I In econometrics details
I With R commands
I With data & examples
The relevance of valuation studies
I
Cost-benefit analysis
I Newly in France: public project with a “déclaration d’utilité publique” have to justify that Benefit > Cost
I For market and nonmarket goods & services
I Including e.g. value of human life, ecosystem services, patrimonial
& heritage values
I In principle
I How do we compute that ?
I That includes environmental “services”, e.g. ecosystem functions
I But also all kinds of benefits & costs, e.g. a prison removes criminal from society and helps their rehabilitation
I “valeurs tutélaires” (guidelines) & consensual discount rate
I
Damage assessment for non-market goods
I France introduced a few years ago the principles of environmental damage and compensation in kind
I well-embodied in US legislation
I not so much in EU legislation I
Greening the National Accounts
Course Plan
1.
Introduction to R
2.
Nonmarket valuation basic theory
I French tend to say “évaluation”
I English stresses the idea of valuing
I “assigning a value”
3.
Contingent valuation
I Most well-known technique 4.
(Choice experiment)
I Harder econometrics
Course Organization
I
6 lectures of 3.5 hours each
I Every week
I “Dispense d’assiduité” not possible for language courses
I Bring your laptop as much as possible
I
Do not forget it is a language course
I Please interrupt me when you don’t understand
Evaluation: “Contrôle continu” in class for 100%
I
About 20’ at some point of each lecture
I Beginning, end or middle
I On what we have seen during that lecture&the previous one (not several)
I
If you miss one, you get zero at that one
I The 1st one is just practice
I
No final exam in “first session” in Decembre
I “Rattrapage” in June
I
It is super important that you read / study the class notes before coming to class
I That is why we do CC
References
I
Aizaki et.al. Stated Preference Methods Using R. Chapman and Hall/CRC, 20140815. VitalBook file.
I Use DCchoice-package {DCchoice} in R
I Base documentation in R
I
Kleiber & Zeilis, Applied Econometrics with R, Springer, 2008
I
Wooldridge, J. Introductory Econometrics : A Modern Approach, Michigan State University, 2012
I Click this link
I BU Chevreul[330.015.2 WOO] (1)
I Not [330.015.2 WOO] (2) Econometric analysis of cross section and panel data
Install R
I
Come to class w/ a laptop
I R & R-studio installed & up-to-date
I
R @ www.r-project.org/
I R-Studio https://www.rstudio.com/
I IDE (integrated development environment)
I Not a Graphical User Interface, but more useful
I Packages “add functionalities”
I Most often from within R-studio
I Start R-Studio
I R-Studio calls R
Presenting R-studio: 4 windows
R-Studio Upper Left Window: editor
I
Invoked with any of 2 leftmost buttons of the toolbar (New or Load)
I Color-coded, with online help & command recognition
I
Programming is written in the editor
I Programming = sequence of commands in a text file “script”
I with an .R extension
I This file is saved for further use, between “sessions”
I Commandsare passed by e.g.plot(x)
I The editor recognizes command and colors them inblue
I Commands are executed in the editor byCMD -row by row
I Command results may be stored inobjectswith <-
I y_lm <- lm(y~x1+x2)
I Several command files may be simultaneously open
I tabs
R-studio Windows
I
Lower Left :
consoleI Print out command results from editor
I Usual way to write code : write one or a few lines, test it
I Write commands for immediate execution (with -)
I Does not stay in memory I
Upper Right
I Environment: List in memory
I Can be data or results or functions
I Within a project (later) or not
I Command history
I Can be reused
R-studio Lower Right Window : 5 tabs
I
Files within the project
I
Visualisations of Plots
I
Packages that are present
I Loaded if checked square
I Install button
I Click it (you must be connected)
I Type swirl & follow instructions I
Help
I
Viewer
I to view local web content (if you edit webpages)
I
These 5 tabs have in common the Search window
First commands: Project
I
A project is a file that refers to a collection of files
I R command files .R, data files, results
I
There’s an icon in the upper-right corner of R-Studio
I Click it & create a project “Research in Applied Econometrics”
I Where you create it is your work directory
I Do not use the desktop, the root, or any hard-to-find location
I Download the RAE2017.R on my courses’ site
I Into the same directory as your project
I Open it from R-studio Editor : Icon upper left I
R-Studio recalls the projects
I You can go from one to another
I All the files written on disk remain available
First commands
I
Some manipulation in Console
I writeSys.setenv(LANG = "fr")
I Sets R Console in French, only for “core”, not for most package
I R-Studio is only in English
I writeinstall.views("Econometrics")
I For about all the packages we will ever need
I This is long : don’t do that in class !
I In the futureupdate.views("Econometrics") I
Editor
I Write here things that you intend to reuse
I AvoidFrench symbols é, è, ê, ë, à, ù, ç, ...
I Avoidsymbols like #, $, &, -... if you are unsure of their use
I Try to stickto unaccented latin characters (i.e. US alphabet)
I CAPITALISATION is important
I
Starting a row w/ # indicates to R that it is a commentary
I Green-colored, will not be executed
SWIRL: set of basic training modules
I
Install swirl as any package from R-studio (should be installed by now)
I Then type
I install_course("R Programming")
I install_course("Regression_Models")
I Other courses https://github.com/swirldev/swirl_courses
I About SWIRL: http://swirlstats.com/students.html
I Slides https://github.com/DataScienceSpecialization/courses
I
Self-training : Type
swirl( )in concole
I do course 1: R programming, Lessons 1-9 + 14
I By yourself, from home, before 1st class
I We will redo Lesson 1 in class
Some ressources about R on the web
I
Use Google !
I Ask question based on English keywords
I e.g. “R read Stata data”
I
From R home page www.r-project.org
I Getting help, Manuals, FAQS...
I
A few interesting links
I Quick-R www.statmethods.net/index.html
I http://stats.idre.ucla.edu/r/
I http://varianceexplained.org/RData/
I www.r-bloggers.com
I R for economists
I www.mayin.org/ajayshah/KB/R/R_for_economists.html I
En français: forget about French for R
To sum up
I
For the 1st course you have to have
I installed R & R-Studio on your machines
I From R-Studio
I install.views("Econometrics")
I install swirl
I In swirl :
I install the 2 modules (programming & regressions)
I do course 1: R programming, Lessons 1-9 + 14 I
Install packages : DCchoice, Ecdat, stats
I
Created your project & opened RAE2017.R
I
Classes are mandatory
I There is CC in each one, no final exam