
hp calculators
HP 9g Statistics –Non-Linear Regression
Practice solving non-linear regression problems
Example 1: Enter the following points into your HP 9g as statistical data and plot them. Find the equation that best fits
the points.
x 10 25 40 80 160 250
y 106 46 31 18.5 12.25 10
Solution: Let’s first clear any previous data by pressing `1, then select D-CL and press =.
To plot the scatter graph (or scatterplot) we must set the 2-VAR mode, so press: `1, select 2-VAR
and press =.Let’s now enter the data: E, select DATA-INPUT and =, then press:
10‡106‡
25‡46‡
40‡31‡
80‡18.5‡
160‡12.25‡
250‡10‡
To plot the graph press: ~e P. Figure 1 shows the resulting
graph. These points seem to belong to a rectangular hyperbola. Let’s try to
verify it by finding the inverse regression equation. Press first: `1,
select REG, press =, select INV and press =again. Figure 1
Regression variables are displayed in the ~e menu, where we can
read a= 6, b = 1000 and r = 1, which means that the fit is perfect. Without
leaving the currently displayed menu, the curve can be plotted by pressing
a single key: P. Figures 2 shows the displayed graph (notice the
asymptote in the y axis). Figure 2
Answer: The equation that best fits these points is x
y1000
6+= .
Example 2: Using the data of the previous example, what are the predicted values of y for x = 1000 and for x = 95?
Which prediction is more reliable? And what is the predicted value of x for y = 35?
Solution: As to the first question, we have to evaluate the regression line at x = 1000, and 95, that is to say: y(1000)
and y(95). Actually, y and x are often written as and , respectively, when we are referring to predicted
values. On the HP 9g their symbols are y’ and x’ and are displayed in the STATVAR menu. To calculate
(1000) and (95), press:
y
ˆx
ˆ
y
ˆy
ˆ
~e , select y’, =1000= and ††55:= respectively.
Likewise, to find (35), press:
x
ˆ
~e , select x’, =35=
hp calculators - 3 - HP 9g Statistics – Non-Linear Regression - Version 1.0