Research in Applied Econometrics Chapter 0. Organization

Size: px
Start display at page:

Download "Research in Applied Econometrics Chapter 0. Organization"

Transcription

1 Research in Applied Econometrics Chapter 0. Organization Pr. Philippe Polomé, Université Lumière Lyon 2 M1 APE Analyse des Politiques Économiques M1 RISE Gouvernance des Risques Environnementaux

2 Plan I Presentation I Motivation I Organisation

3 Myself gate.cnrs.fr/spip.php?article44 I All the slides available via this page

4 Master RISE Parcours Gouvernance des Risques Environnementaux risques-environnement.universite-lyon.fr

5 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

6 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

7 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

8 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

9 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

10 References I Aizaki et.al. Stated Preference Methods Using R. Chapman and Hall/CRC, 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[ WOO] (1) I Not [ WOO] (2) Econometric analysis of cross section and panel data

11 Install R I Come to class w/ a laptop I R & R-studio installed & up-to-date I I R-Studio 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

12 Presenting R-studio: 4 windows

13 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 Commands are passed by e.g. plot(x) I The editor recognizes command and colors them in blue I Commands are executed in the editor by CMD - row by row I Command results may be stored in objects with <- I I y_lm <- lm(y~x1+x2) Several command files may be simultaneously open I tabs

14 R-studio Windows I Lower Left : console I 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

15 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

16 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

17 First commands I Some manipulation in Console I write Sys.setenv(LANG = "fr") I Sets R Console in French, only for core, not for most package I R-Studio is only in English I write install.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 future update.views("econometrics") I Editor I Write here things that you intend to reuse I Avoid French symbols é, è, ê, ë, à, ù, ç,... I Avoid symbols like #, $, &, -... if you are unsure of their use I 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

18 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 I About SWIRL: I Slides I Self-training : Type swirl( ) in concole I do course 1: R programming, Lessons I I By yourself, from home, before 1st class We will redo Lesson 1 in class

19 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 I Getting help, Manuals, FAQS... I A few interesting links I Quick-R I I I I R for economists I I En français: forget about French for R

20 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 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