nonlinear regression

13
Nonlinear Regression Problem 4.14 Heart Weights of Mammals

Upload: van

Post on 17-Jan-2016

31 views

Category:

Documents


1 download

DESCRIPTION

Nonlinear Regression. Problem 4.14 Heart Weights of Mammals. Consider the following heart weights in a variety of mammals:. This plot on ordinary graph paper shows that much of the data is compressed and hard to see. The same is true for the scatterplot seen on the calculator. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Nonlinear Regression

Nonlinear Regression

Problem 4.14

Heart Weights of Mammals

Page 2: Nonlinear Regression

Consider the following heart weights in a variety of mammals:

Mammal Heart Weight (g) Length of Cavity of

Left Ventricle (cm)

Mouse 0.13 0.55

Rat 0.64 1

Rabbit 5.8 2.2

Dog 102 4

Sheep 210 6.5

Ox 2030 12

Horse 3900 16

Page 3: Nonlinear Regression

This plot on ordinary graph paper shows that much of the data is compressed and hard to see.

The same is true for the scatterplot seen on the calculator.

We can try a plot using the semilog paper.

Page 4: Nonlinear Regression

This semilog plot is much better, but we still have a curved plot. Plotting the log y by x on the calculator gives a similar result.

We can try loglog paper. This paper has a logarithmic scale for both the x and y axes.

Page 5: Nonlinear Regression

This loglog paper allows for a wide spread of values in both the x and y dimensions.

Page 6: Nonlinear Regression

Now showing scales for both x and y.

Next we will plot the points on this log y by log x graph.

Page 7: Nonlinear Regression

This plot is linear, or very nearly so, and we can now apply our knowledge of linear regression.

Comparing this to our work on the graphing calculator, yields this scatterplot of log y by log x.

Page 8: Nonlinear Regression

This loglog plot looks reasonable with a line to fit the data.

Page 9: Nonlinear Regression

On my calculator, I have this arrangement of data lists:

L1 is ventricle length

L2 is heart weight

L3 is log (ventricle length)

L4 is log (heart weight)

Now perform linear regression of L3 on L4 and save to Y1.

We now check the residual plot. Enter the residuals in L5 using the list RESID.

Page 10: Nonlinear Regression

Just a reminder on calculating the residuals, with the cursor on the header for L5, press <2nd> <LIST>, scroll under NAMES to RESID and select, then press <ENTER>.

Now make a scatterplot of the residuals by log (ventricle length).

Page 11: Nonlinear Regression

The scatterplot is patternless, thus confirming our use of linear regression. This also confirms our model using log x and log y. When we write our equation we must remember to write log x for x and log y for y.

Recalling the regression screen:

We write the equation:

log ˆ y = −.13637 + 3.1386log x

Note the large correlation coefficient, as well. This says that our linear relationship is very strong.

Page 12: Nonlinear Regression

Mathematically, we tend to avoid leaving an equation in this form and convert it to an equivalent expression without the logs.

log ˆ y = −.13637 + 3.13867log x

10log ˆ y =10(−.13637+3.13867 log x )

ˆ y =10(−.13637) ⋅10(3.13867 log x )

ˆ y =10(−.13637) ⋅10(log x 3.13867 )

ˆ y =10(−.13637) ⋅ x 3.13867

When we write the equation in the final form, it suggests more readily that this is a power function.

or

ˆ y = .73051x 3.13867

Page 13: Nonlinear Regression

To check this against the original data we recreate the original scatterplot and store the final equation in Y2. (For those interested in short cuts, the values a and b from the linear regression equation are stored in the VARS Statistics EQ register. Press <VARS> <5:Statistics> < EQ> then <2:a> or <3:b>.) So you may enter the equation in Y2, as shown, or just type it in using the numbers instead of a and b:

This looks like a very good model for the data. It also fits our knowledge of mass being third order while length is first order.