Upload
others
View
35
Download
0
Embed Size (px)
Citation preview
Research in Applied EconometricsChapter 0. Organization 2017-18
Pr. Philippe Polomé, Université Lumière Lyon 2
M1 APE Analyse des Politiques ÉconomiquesM1 RISE Gouvernance des Risques Environnementaux
2017 – 2018
Master RISE http://risques-environnement.universite-lyon.frParcours “Gouvernance des Risques Environnementaux”
risques-environnement.universite-lyon.fr
Course Objectives & Motivations
I Class in EconometricsI In a unit of English language
I Goal: Expose students to applied econometrics in English
I Applied examples with environmental economics dataI Students should improve both their applied econometrics skills
and their English levelI Attendance and interactions in class
I Focus on applied techniques: Introduction to R
I More on that laterI Context : ex ante valuation of public (environmental) policies
I Contingent valuation / stated preferencesI In econometrics detailsI With R commandsI With data & examples
The relevance of valuation studiesI 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 & servicesI Including e.g. value of human life, ecosystem services, patrimonial
& heritage valuesI In principle
I How do we compute that ?I That includes environmental “services”, e.g. ecosystem functionsI But also all kinds of benefits & costs, e.g. a prison removes
criminal from society and helps their rehabilitationI “valeurs tutélaires” (guidelines) & consensual discount rate
I Damage assessment for non-market goodsI France introduced a few years ago the principles of
environmental damage and compensation in kindI well-embodied in US legislationI not so much in EU legislation
I Greening the National Accounts
Course Plan
1. Introduction to R2. Nonmarket valuation basic theory
I French tend to say “évaluation”I English stresses the idea of valuing
I “assigning a value”
3. Contingent valuationI Most well-known technique
4. (Choice experiment)I Harder econometrics
Course Organization
I 6 lectures of 3.5 hours eachI Every week
I “Dispense d’assiduité” not possible for language coursesI Bring your laptop as much as possible
I Do not forget it is a language courseI Please interrupt me when you don’t understand
Evaluation: “Contrôle continu” in class for 100%
I About 20’ at some point of each lectureI Beginning, end or middle
I On what we have seen during that lecture & the previous one (notseveral)
I If you miss one, you get zero at that oneI The 1st one is just practice
I No final exam in “first session” in DecembreI “Rattrapage” in June
I It is super important that you read / study the class notes before
coming to classI That is why we do CC
References
I Aizaki et.al. Stated Preference Methods Using R. Chapman andHall/CRC, 20140815. VitalBook file.
I Use DCchoice-package {DCchoice} in RI Base documentation in R
I Kleiber & Zeilis, Applied Econometrics with R, Springer, 2008I Wooldridge, J. Introductory Econometrics : A Modern
Approach, Michigan State University, 2012I Click this linkI BU Chevreul[330.015.2 WOO] (1)
I Not [330.015.2 WOO] (2) Econometric analysis of cross sectionand panel data
Install R
I Come to class w/ a laptopI 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-StudioI R-Studio calls R
R-Studio Upper Left Window: editor
I Invoked with any of 2 leftmost buttons of the toolbar (New orLoad)
I Color-coded, with online help & command recognitionI Programming is written in the editor
I Programming = sequence of commands in a text file “script”I with an .R extensionI This file is saved for further use, between “sessions”
ICommands are passed by e.g. plot(x)
I The editor recognizes command and colors them in blueI Commands are executed in the editor by CMD - row by row
I Command results may be stored in objects with <-I y_lm <- lm(y~x1+x2)
I Several command files may be simultaneously openI tabs
R-studio Windows
I Lower Left : console
I Print out command results from editorI 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 RightI Environment: List in memory
I Can be data or results or functionsI Within a project (later) or not
I Command historyI Can be reused
R-studio Lower Right Window : 5 tabs
I Files within the projectI Visualisations of PlotsI Packages that are present
I Loaded if checked squareI Install button
I Click it (you must be connected)I Type swirl & follow instructions
I HelpI 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 filesI R command files .R, data files, results
I There’s an icon in the upper-right corner of R-StudioI Click it & create a project “Research in Applied Econometrics”
I Where you create it is your work directoryI Do not use the desktop, the root, or any hard-to-find location
I Download the RAE2017.R on my courses’ siteI Into the same directory as your projectI Open it from R-studio Editor : Icon upper left
I R-Studio recalls the projectsI You can go from one to anotherI All the files written on disk remain available
First commands
I Some manipulation in ConsoleI write Sys.setenv(LANG = "fr")
I Sets R Console in French, only for “core”, not for most packageI R-Studio is only in English
I write install.views("Econometrics")I For about all the packages we will ever needI This is long : don’t do that in class !I In the future update.views("Econometrics")
I EditorI Write here things that you intend to reuseI
Avoid French symbols é, è, ê, ë, à, ù, ç, ...I
Avoid symbols like #, $, &, -... if you are unsure of their useI
Try to stick to 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 installedby now)
I Then typeI install_course("R Programming")I install_course("Regression_Models")
I Other courses https://github.com/swirldev/swirl_coursesI About SWIRL: http://swirlstats.com/students.htmlI Slides https://github.com/DataScienceSpecialization/courses
I Self-training : Type swirl( ) in concoleI do course 1: R programming, Lessons 1-9 + 14
I By yourself, from home, before 1st classI 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.htmlI http://stats.idre.ucla.edu/r/I http://varianceexplained.org/RData/I www.r-bloggers.comI 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 haveI installed R & R-Studio on your machinesI 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, statsI Created your project & opened RAE2017.RI Classes are mandatory
I There is CC in each one, no final exam