hp calculators
HP 30S Statistics – Linear Regression
Example 6: An experimenter obtained the following data:
x 300 420 450 500 610 780 800
y 11.1 12.2 12.5 13 15.6 15.8 16.1
Determine whether there is a linear relation between x and y.
Solution:
First of all, let’s clear any previous data:
–1
, select CLR-DATA and press
y
. This is not required
in this example: since the number of data items did not change, new data would overwrite the old ones.
But, it’s a good habit to clear previous data before starting a new regression calculation. 2-VAR mode was
already set, so we can now enter the data as follows:
a300?11.1?420?12.2?450?12
.5?500?13?610?15.6?780?15.
8?800?16.1?
Let’s now find the linear correlation coefficient:
b<<<<<<
.
Rounded to four decimal places, r = 0.9624. Even though it is quite close
to one, the experimenter expected a more conclusive result. By plotting a
scatter graph (figure 1), she notices that point (610, 15.6) is anomalous,
and is consequently removed from the data set. To do so, press:
Figure 1
a&
seven times, and
e
(NB: not
o
).
The new correlation coefficient is displayed as above. i.e. by pressing
b
and then the left arrow key six
times.
Answer:
r = 0.9997, so there’s strong evidence that the relation is linear. The regression line is
x
.
.
y
01
0
03
8
+
=
Example 7: Find the power curve
that best fits the following data:
n
x
m
y
⋅
=
x 0.50 0.75 1.00 1.25 1.50 2.00
y 0.47 1.43 3.15 5.75 9.45 20.68
Solution:
This problem can be solved on your HP 30S by making the substitutions y’ = ln y, and x’ = ln x. The model
becomes:
, which is a linear form. Clear the statistical data (
–1
, select CLR-DATA
and press
y
) and enter the new data as follows:
'
x
n
m
ln
'
y
⋅
+
=
ah.5?h.47?h.75?h1.43?h1?
h3.15?h1.25?h5.75?h1.5?h
9.45?h2?h20.68?
In the STATVAR menu (
b
), we find that a = 1.140696782 and b = 2.728608754. Since b = n and
, then n = 2.728608754, and
, which can be calculated as follows:
m
ln
a
=
a
e
m
=
o—Hb<
(eight times)
yy
Answer:
Rounding to two decimal digits,
73
2
13
3
.
x
.
y
⋅
=
hp calculators
- 5 -
HP 30S Statistics – Linear Regression - Version 1.0