Regression analysis, Fall 2008 - Notes.
- Handout 1: Basic stats review. Please also look online
for tutorials (google "basic stats tutorial" for options).
- Handout 2: Simple linear regression - 1 .
- Handout 2b: Simple linear regression - some extras .
- Demo 1: SF.q - the source file with commands. Simply issue the command source('SF.q') at the prompt. When the program halts, right-click in the graphics window and choose "STOP". This will make R continue with the next set of commands.
- Handout 3: Simple linear regression - ctd .
- Demo 1: SF2.q - the second demo file. Simply issue the command source('SF2.q') at the prompt. When the program halts, right-click in the graphics window and choose "STOP". This will make R continue with the next set of commands.
- Handout 4: Multiple linear regression + Lab report writing .
- Cars data and demo codes: cars2.dat, carsdata1.q, carsdata.q. Read the data in R using read.table("cars2.dat",header=T). Use e.g. source("carsdata.q") to run the commands. To go to the next command, right click in the graphics window. Please read the comments in the source codes.
- Handout 5: RECAP.
- Handout 6a: Multiple linear regression, I .
- Handout 6b: Multiple linear regression, II .
- Handout 6c: Qualitative variables.
- Cars data and demo codes - ctd: Modstart.q, Modfull.q, ModSel.q, ModSelrepeat.q . Execute these programs in order. It will take you through some basic exploration, model fitting and model selection. Note, I've added some comments to the demos. Please use the help file and online manual resources to interpret the commands. Please note, the codes require the installation of the "leaps" package. Simply issue the command install.packages("leaps") at the prompt. Then, every time you start R and want to use the leaps package, issue library(leaps) at the prompt.
- Handout 7: Model Selection.
- Last year's Final: final56307.pdf Due Dec 17
- Data for the last year's final: PCB in trouts
- Handout 8: Polynomial Regression.
- Handout 9: Cross-validation.
- Handout 9b: CV demo.
- Handout 10: lab 2 code examples.
- Heart disease data and demo codes: SAheart_data.txt, sbpstart.q, ModSelsbp.q, ModSelrepeatsbp.q.
- Handout 10: Robust Regression.
- Handout 11: Regularized regression I.
- Regression Trees: CARTcars.q , Data for CARTcars, CARTsbpbew.q , Data for CARTsbpnew. Two regression tree examples for the cars data and the heart disease data. You can change the sample size to see how sample size impacts the stability of the trees.
- Handout 11a: Regularized regression II.
- Handout 111b: Demo - regularized regression.
- Handout 12a: The pollution data , and the The training data and test data .
- Handout 12b: pollstart - exploring the pollution data.
- Handout 12c: ModSelpoll - model selection.
- Handout 12d: ModSelpollrep - Stability of model selection.
- Handout 12e: Predpoll - prediction errors and regularized regression .
- Handout 13: Class review .
Back to : Regression Analysis
09/03/08