[Return to Sta113 Home]

Sta113: Lab 9 (Friday, April 11, 2003)

In this lab, we will use MatLab to do multiple linear regression and residual analysis.


Items that we will investigate using MatLab include:

Use the data from EXAMPLE 12.13 on page 677 in the text. The dependent variable is Carbon Monoxide (CM) content of different cigarette brands. We want to investigate the relationship of three predictor or independent variables with CM, these variables are Tar (T), Nicotine (N), and Weight (W). (see page 677 for more details).

Read in the data and call the first column T, the second N, third W, and the fourth column CM.

smoke = load('lab9.dat');
T = smoke(:,1);
N = smoke(:,2);
W = smoke(:,3);
X = [ones(length(smoke),1) T N W ]; % X needs to be a
                                    % matrix with a leading 
                                    % column of ones.
CM = smoke(:,4);
Y = CM;

Let's investigate the the items above: