Simple Linear Regression

*   Getting Slope, Y Intercept and Model Utility Test

*   Predicting average y and next y

*   Making Residual Plots

*   Transforming the x's and y's

Suppose that you were trying to determine if a simpler (and less expensive) measure, score 1, of a process is as good as a more complicated (and more expensive method), score 2. This is an example stored in Minitab called EXH_REGR.MTW.

Score1

Score2

4.1

2.1

2.2

1.5

2.7

1.7

6

2.5

8.5

3

4.1

2.1

9

3.2

8

2.8

7.5

2.5

 

Enter Data

Enter your data. X should be in one column and Y should be in the next column.

 

 

 

Getting Slope, Y Intercept and Model Utility Test

  1. Go to Stat,  Regression , Regression. The following screen should appear.

  1. Enter your Y variable as your response. Enter your X variable as your predictor. Click on o.k.
  2. The following output should appear.

Regression Analysis: Score2 versus Score1

 

The regression equation is

Score2 = 1.12 + 0.218 Score1

 

 

Predictor     Coef  SE Coef      T      P

Constant    1.1177   0.1093  10.23  0.000

Score1     0.21767  0.01740  12.51  0.000

 

 

S = 0.127419   R-Sq = 95.7%   R-Sq(adj) = 95.1%

 

 

Analysis of Variance

 

Source          DF      SS      MS       F      P

Regression       1  2.5419  2.5419  156.56  0.000

Residual Error   7  0.1136  0.0162

Total            8  2.6556

 

 

Predicting New Y

 

Suppose that you want to predict the molecular weight, when x= 4.

1.       Follow the steps above but before you hit o.k. Go to options. The following screen should appear.

2.       In the box for Prediction Intervals for new observations, enter your new x.

3.       If you want to change your confidence, enter that as well in the box for Confidence Level.

4.       Click O.K.

5.       Additional lines will be added to your output. It should look similar to the following output below.

Predicted Values for New Observations

 

New

Obs     Fit  SE Fit       95% CI            95% PI

  1  1.9884  0.0527  (1.8639, 2.1129)  (1.6624, 2.3144)

 

 

Values of Predictors for New Observations

 

New

Obs  Score1

  1    4.00

 

6.       Notice, that this will give you both the confidence interval for the average y at a given x and the prediction interval for the next value of y at x.

Making Residual Plots

  1. Follow the instructions above but before you hit o.k., go to Graphs. The following screen should appear.

  1. Click on the options as displayed above. You want a histogram of residuals, the normal probability plot and the residual plot that is (residuals vs. x).
  2. Click on o.k. The following plots should appear.

 

This plot should be a random collection of points. This plot looks fairly random, but it would be better if you had an n larger than 8.

 

This is the Normal Probability Plot, the points should follow a fairly straight line.

 

This plot should show that the residuals are approximately normally distributed. This plot definitely suggests that more data needs to be collected, before predictions can be trusted.

Note: This graphs are a little off because n=8. For a better regression equation, use more points.

Transforming the x's and y's

If the data displays a funnel shape in the residual plot or an exponential-like curve in the scatterplot, you should transform your x’s and y’s.

  1. This step happens before you do run the regression. Go to Calc, Calculator. The following screen will appear.

  1. Enter the column that you want to store the data in Store Result in variable box.
  2. Enter the transformation in the Expression box.
  3. It is a good idea to use the scroll screen on the side to select the exact code needed to do that transformation.
  4. Enter the variable that you are conducting the transformation on inside the parenthesis.
  5. Hit o.k.
  6. The column that you listed in the first box will have the transformed data.