FMSN40: Linear and Logistic Regression with Data
ClimBEco: Linear Regression using R, 2.5hp
- [13/5-19] Code and data for Lecture 10 added.
- [9/5-19] Slides for Lecture 10 added. Material on Quantile regression added.
- [7/5-19] Slides and R-code for Lecture 9 added. Project 2 updated.
- [2/5-19] Slides and R-code for Lecture 8 added.
- [23/4-19} Sign-up for oral exams and oral presentations of Project 3 open. Questions (oral_vt19.pdf) added.
- [15/4-19] Slides and R-code for Lecture 7 added. Solutions for compulsory lab 3 added- First part of Project 2 added.
- [8/4-19] Solutions to Lab 2 added. Slides, R-code and data for Lecture 6 added.
- [5/4-19] Slides and R-code for Lecture 5 and Lecture 9 April added.
- [4/4-19] Files for compulsory computer lab 3 added.
- [3/4-19] Project 1 and Oslo data updated. Instructions for Project 3 and the contents of the project plan added.
- [2/4-19] R-code for Lecture 4 added.
- [1/4-19] R-code for Lecture 3 and solutions to Lab 1 added. Slides for Lecture 4 added.
- [29/3-19] Slides for Lecture 3 added.
- [28/3-19] Instructions and data for compulsory conputer lab 2 added.
- [27/3-19] Added some more course specific R help.
- [25/3-19] Slides and R-code for Lecture 2 added. The first part of project 1, with data, has been added. The rest will show up later this week.
- [22/3-19] Slides and R-code for Lecture 1 added.
- [20/3-19] Instructions for computer exercise 1 added, see the appropriate time in the schedule below.
- [12/3-19] Welcome letter
- [23/1-19] The course starts Monday 25 April, 2019, 13.15-15.00 in MH:Riesz.
- This course is taught jointly with FMSN30/MASM22 Linear and logistic regression, 7.5hp: please check http://www.maths.lth.se/matstat/kurser/masm22/
- [23/1-19] FMSN40 schedule
- [23/1-19] Compulsory computer exercises Thursday 28 March, 10-15-12; Tuesday 4 April, 10.15-12 Thursday 11 April, 10.15-12.
- [23/1-19] Peer review of project reports: Project 1 Monday 15 April, 13.15-14.00; Project 2 Wednesday 15 May, 8.15-9.00.
- [23/1-19] Project 1+2 deadlines: Project 1 Wednesday 17 April, 16.00; Project 2 Friday 17 May, 16.00.
- [23/1-19] Project 3 plan: Wednesday 17 April, 16.00; data, Tuesday 21 May, 16.00; presentations: Monday 27 May 13.15-15 or Tuesday 28 May, 8.15-10 or 13.15-15 or Wednesday 29 May 10.15-12.
- [23/1-19] Oral exams:
3 - 20 June. 31 May - 20 June
FMSN40 is compulsory in the Mathematical
Modelling profile in the third year of the Industrial
Engineering and Management programme.
ClimBEco is reserved for ClimBEco PhD students and not given 2019.
This course is taught jointly with FMSN30/MASM22 Linear and Logistic regression, 7.5hp.
The main lectures are joint while the exercise and lab groups are separate (for scheduling reasons).
Parts that are identical in FMSN40 and FMSN30/MASM22
See FMSN30/MASM22 Linear and Logistic regression for reading instructions, handouts, etc.
- Exercises/labs (but at different times and places, see below).
- Project 1 and 2
- Oral examination
Differences between FMSN40 and FMSN30/MASM22
See this page for information concerning these. Marked in red below.
- Project 3
- One extra lecture,
- one extra exercise and
- one extra computer exercise, dealing specifically with data gathering and project 3.
Additional contents in FMSN40 compared to FMSN30/MASM22
- Aim: As part of the course you should construct a questionaire or experimental plan for a problem of your choice, collect the data and analyse it using a suitable regression model.
- Learning outcomes: Construct a form for data collection that can be used to answer a particular practical problem.
- Contents: Questionaire construction and design of experiments.
We will use the statistical program R which can be downloaded from http://ftp.acc.umu.se/mirror/CRAN/ free of charge for all major platforms. It is a good idea to install it on your own computer, if you have one. Also, a good programming practice is to consider an appropriate editor for writing and executing R programs; therefore I have set a page for Rstudio (for Windows/Linux/MacOS).
Notice that this course is about Statistics and is not an in-depth course about R. We will discuss the commands needed to produce the desired output and answer the relevant statistical questions. However we will not consider tips-and-tricks, good programming practice or any advanced use of such powerful computer language. R has a large and friendly user community and you will be able to find plenty of good guides, tutorials and answered questions by a simple Google search. Here follow some of the many guides freely available on the web:
Course specific help:
- Introduction to RStudio and Studio projects
- Basic computations in R
- Matrix manipulation.
- Rmarkdown for combining R-code, output and text.
You will have the chance to book specific computer labs sessions. That is you do not have to attend all labs reported in the schedule below, only the ones you book. Special attention should be devoted to mandatory labs denoted in bold: you MUST attend one of those each week for the first three weeks.
- Rawlings, J.O., Pantula, S.G., Dickey, D.A.: Applied Regression Analysis - A Research Tool, 2ed, Springer, available as e-book,
- Agresti, A. An Introduction To Categorical Data Analysis, 2ed Wiley, 2007, available as e-book.
Anna Lindgren, email@example.com, tel: 046-222 42 76, MH:136
|w13||Mon 25/3||13-15||MH:Riesz||Lecture 1: Introduction; Review of simple linear regression, linear relationships, linear models and basic assumptions (normality, homoscedasticity, linearity, independence), least squares estimation, basic properties of expectation, variance and covariance; mean and variance of least squares estimators.||Rawlings Ch.1;
|Wed 27/3||8-10||MH:Riesz||Lecture 2: Continuation of simple linear regression; distribution of least squares estimators; prediction; confidence intervals; hypothesis testing, p-values, quantiles.||Rawlings Ch.1;
|Thu 28/3||10-12||MH:230||Compulsory lab 1||lab1_vt19.pdf;
|Fri 29/3||13-15||MH:230||Work on project 1||project1_vt19.pdf
|w14||Mon 1/4||13-15||MH:Riesz||Lecture 3. Multiple Regression: matrix notation, properties of least squares estimators for multiple regression; confidence intervals for multiple regression; critical requirements; ill-ranked design matrices, lack of invertibility; categorical variables.||Rawlings Ch.3, 4, 6.5;
|Wed 3/4||8-10||MH:Riesz||Lecture 4. Analysis of variance: variability decomposition. Global F-test. ANOVA tables. Partial F-test.||Rawlings Ch.9;
|Thu 4/4||10-12||MH:230||Compulsory lab 2||
|Fri 5/4||13-15||MH:230||Work on project 1|
|w15||Mon 8/4||13-15||MH:Riesz||Lecture 5. R-squared, Adjusted-R-squared. AIC & BIC, automatic selection methods||Rawlings Ch.7
|Tue 9/4||13-15||MH:227||...with Data Gathering
Lecture X.: Design of experiments, questionaire contruction and introduction to Project 3.
|Wed 10/4||8-10||MH:Riesz||Lecture 6. Problem areas in least squares; Regression diagnostics: outliers w.r.t. X (leverage), distribution of residuals, standardised and studentised residuals; graphical tools for residual analysis. Influential observations (Cook's distance, DFBETAS)||Rawlings Ch.10-11;
|Thu 11/4||10-12||MH:230||Compulsory lab 3||
|Fri 12/4||13-15||MH:230||Work on project 1|
|w16||Mon 15/4||13-15||MH:Riesz||13.15-14.00: peer assessment project 1
14:15-15: Wrapping up linear regression
|Tue 16/4||8-10||MH:Riesz||Lecture 7. Binary data, Bernoulli and binomial distributions, odds ratios and started talking of Logistic regression||Agresti Ch. 1, sec 1.2.1, sec 2.3;
|10-12||MH:230||...with Data Gathering: Work on project 1 and the plan for project 3.|
|Wed 17/4||10-12||MH:230||Finish project 1 and the plan for project 3. Start on project 2.||project2_vt19.pdf
CDI.txt (same data as for lab 3)
|16.00||Final deadline project 1. Send report as pdf to firstname.lastname@example.org by 16.00. Subject: "Project1 by studid1 and studid2"|
Gathering Send the plan as pdf
Subject: "Project3a plan by studid1 and studid2"
|w19||Mon 6/5||13-15||MH:Riesz||Lecture 8. Maximum likelihood estimation, Newton-Raphson, properties, deviance and likelihood ratio tests. Akaike (again), Pseudo-R2.||Agresti: 1.3.1, 1.4.1, 2.3.1-2.3.3; several topics
scattered in chapter 4, particularly sections 4.1-4.2.
|Wed 8/5||8-10||MH:Riesz||Lecture 9. Residuals and model validation in logistic regression.||lecture9_vt19.pdf;
|Thu 9/5||10-12||MH:230||Project work|
|w20||Mon 13/5||13-15||MH:Riesz||Lecture 10. Poisson distribution and Poisson regression; Negative binomial regression. Quantile regression||Agresti: several sections in Chapter 3.
|Wed 15/5||8-10||MH:Riesz||8.15-9.00: peer assessment
9.15-10.00: Wrapping up.
|Thu 16/5||10-12||MH:230||Project work|
|Fri 17/5||13-15||MH:230||Project work.|
Send as pdf to email@example.com by 16.00
Subject: "Project2 by studid1 and studid2"
|w21||Tue 21/5||10-12||MH:230||...with Data Gathering: work on Project 3 including help with revised project plan, choice of regression type, and getting data readable. Start analyzing.|
Gathering: Send revised plan
(pdf) and data (RData) to
Subject: "Project3b data by studid1 and studid2"
|Thu 23/5||10-12||MH:230||...with Data Gathering: work on Project 3|
|Fri 24/5||13-15||MH:230||...with Data Gathering: work on Project 3|
|w22||Mon 27/5||13-15||MH:Sigma||...with Data Gathering Oral presentations of project 3: Johan+William, Jackie+Hjalmar, Fredrik+Erik, Erik+Jon|
|Tue 28/5||13-15||...with Data Gathering Oral presentations of project 3: Carl+Joel+Tofig, Daniel+Artur, Erik+Robin, John+Axel|
|Wed 29/5||10-12||...with Data Gathering Oral presentations of project 3: Sven+Filip, Jacob+Simon, Tilde+Elsa, Markus+Oscar|
|Fri 31/5||8-17||MH:227-8||Individual oral exams.
Send Project 3 presentation to firstname.lastname@example.org before your oral exam. Subject: "Project3c pres by studid1 and studid2".