Download Print this page

HP 30S Instruction Manual page 2

Advertisement

hp calculators
HP 30S Statistics – Linear Regression
Linear regression
A regression of y on x is a way of predicting values of y when values of x are given. If the regression is based on a
straight line graph, it is called a linear regression, and the straight line is called the regression line.
The regression line (sometimes referred to as the line of best fit) of y on x is then the line that gives the best prediction of
values of y from those of x, and is:
n being the number of data pairs. (Note that the regression line of x on y, which is usually different from the regression
line of y on x, can be found by interchanging x and y in the above expressions). a and b are known as the linear
regression coefficients. The independent variable is the regressor, and the dependent variables is called regressand.
The coefficients are found by minimizing the sum of the squares of the vertical distances of the points from the line (i.e.
the sum of the squares of the residuals). This method is known as least squares.
The correlation coefficient is a measure of the amount of agreement between the x and y variables, and is given by:
When r is positive, the correlation is positive, which means that high values of one variable correspond to high values of
the other. Conversely, if r is negative then the correlation is negative: low values of one variable correspond to high
values of the other. An important property of r is that
real values and estimates are exactly the same. If r = 0 then there's no correlation: x and y are uncorrelated.
On the HP 30S, linear regressions are calculated in 2-VAR STAT operating mode. First of all, let's clear any previous
data. To do so, press –1to display the STAT menu, and then select CLR-DATA using the < and @keys, finally
press yto confirm. Next, press –1again, select 2-VAR, and press y. You're now ready to carry out
regression calculations on your calculator, which are illustrated by the following examples.
Practice solving linear regression problems
Example 1: A quality control engineer notes a relationship between the amount of chemical added to a batch, and the
final concentration of the chemical in the final product. The following table shows the weight in grams
added (x) and the weight in the final product (y):
hp calculators
y
b
i
=
a
where
n
=
r
2
x
i
=
+
y
a
bx
x
y
x
i
i
=
b
and
x
i
x
y
i
i
x
y
i
i
n
2
(
) x
(
i
2
y
i
n
r
. The ±1 values correspond to a perfect correlation:
1
1
- 2 -
x
y
i
i
i
n
2
(
x
)
i
2
n
2
) y
i
n
HP 30S Statistics – Linear Regression - Version 1.0

Advertisement

loading