c Essentials of Regression Analysis Using R coursepage

Coursepage of Introductory Econometrics 1

Linear Models with R


The class on Friday October 13th is postponed to Tuesday November 21st 1限9:00-10:30

Location: Mita 422

Time slot: Friday 4限13:00-14:30

Semester: Fall 2023

Description of the class

The emphasis of this class is on linear models with R. The objective is to learn what methods are available and more importantly, when they should be applied. Many examples are presented to clarify the use of the techniques and to demonstrate what conclusions can be made.


The evaluation will be based on three homeworks (each will count for 1/3 of the final grade).

Class material

The class follows Linear Models with R (from Julian J. Faraway) book content. We aim to cover Ch. 1-4 of the book. Students may notice that in those chapters, matrix notation and calculation are used quite often. In an ideal world, the student should have some background on matrix notation, but this is also possible to get through with no prerequisite. It will be slightly tougher for the student, although she/he will not be asked about matrix calculation or any other theoretical aspect of the class in the homework.

Software R

This class is not all about R, yet (some) learning of this programming language is key to understand thoroughly the material of the book. Students need to be at ease with basic grammar of the language so that they can quickly interpret the output obtained when following the book content. I do know that some students have NO background at all in programming language, and it requires some kind of effort as the notion used in the book can be sometimes a little bit tough for a student with no notion on R (or any other programming language. This is a reason why I give more details about R in this section. Again, the goal of this class is not that you become an EXPERT of R, but rather that you know enough so that you can read through the book content without being completely lost. Consider your knowledge on R as your lifebuoy, so that you should make a wise investment on how many hours you wanna put it to learn the basics of it.
Before starting to work on Homework 1, you need to download R (without R, you cannot follow the book and do the homework). You can actually download R here. Now that you have installed it, you can start to launch it, and you will see the R console. Try to type 2+3, and then press "enter", and you should see 5 as a result. In principle, you can use only R console for this class, but this is not the easiest way. In particular, each time you will use the console, you need to type again your code, or copy-paste from an annex file. This is rather time-consuming and you will make more errors doing this, so I require students to also use the friendly interface user for R called Rstudio. RStudio is available here. Once you have installed RStudio, you can launch it. From now on, you do not need to use the R console, so you do not need to launch R application directly again (except for the part 1.2 of the tutorial on R that follows). Now it is time that you work scrupulously going through Chapter 1 and Chapter 2 of this tutorial.
A very good complement that students should read is Appendix A (pp. 227-228) and Appendix B (pp. 229-232) in the textbook. Together with the previous tutorial, students will be more than ready to start reading the book and do Homework 1.



Homework should be PRINTED and NOT handwritten and handed to me in the classes from the calendar. Latex will be very appreciated, but not required. Any other typing language such as Word would work too. You can use Sharelatex where you can code directly online (and even share it with a friend). Also, you will have information for documentation and/or installing Latex at The Latex Project. All the questions should be answered with English sentences (I will not grade any homework which does not contain sentences as response to the questions). The included plot should be always described with a title (students are very encouraged to read this page on the function plot() in R)
Graded homework will be given back graded in the next class.