background image

 

hp calculators 

 

HP 30S Statistics – Linear Regression

 

 

x 2 1 6 3 7 6 9 
y 3 1 5 5 7 8 8.5 

 
 

Find the linear regression line and the correlation coefficient for this data. 

 
Solution: 

First of all, we have to enter the given data, which is really easy on the HP 30S. Simply pressing 

 

makes your calculator prompt you for the first value displaying “x

1

=” in the entry line. Let’s now enter the 

data by pressing: 

 

 

2?3?1?1?6?5?3?5?7?7?6?8?9?8.5
?

 

 
 

Data pairs are entered in order, the x values first. Notice that values are actually entered by pressing the 

?

 

key, not the  

y

 key. This is because you may wish to calculate a value first (e.g. A 

y

+ B % ANS 

y

)  

– keep in mind that the history stack (i.e. a log of past calculations) is not available in STAT mode, but the 
ANS variable can be used, and the most recent calculation can be retrieved to be edited. Correcting data is 
as easy as using the 

&

 and  

?

 keys to display the wrong value and change it. The new value replaces the 

old one: you need not press  

o

to clear the entry line. 

 
 

Once all the values have been entered, results can be displayed by pressing 

b

. This displays a menu 

with seventeen variables. Select the desired result using the  

<

 and the 

@

 

keys. Values appear in the 

result line. Pressing  

y

puts the selected variable (its name, not its value) into the entry line for further 

calculations. This menu works much like the CONST menu. 

 
Answer: 

Expressed to two decimal digits, a = 1.22 and b = 0.85, therefore the regression line is: 

. The correlation coefficient, is 0.91, which means that the correlation is positive and 

that it is quite a good fit since r is close to 1. However, exactly how far away from this value the correlation 
can be and the equation still be considered a good predictor is certainly a matter of debate. 

 

x

.

.

y

85

0

22

1

+

=

 
Example 2:  If the engineer adds 4 grams of the chemical, what will be the concentration in the final product? 
 
Solution: 

Predicted values can be easily calculated using the regression line, but the quickest way is to use the 
STATVAR menu again. Press 

b

, select   and press 

y

. The entry line now reads 

with the 

blinking cursor placed on the right parenthesis.   returns a predicted y value given an x value, that is, 
returns 

(remember that these numbers are shown to two decimal digits in this document, 

but not on your calculator). Enter the given x value:  

4

and press  

y

to calculate the predicted 

concentration. 

'

y

)

('

y

'

y

x

.

.

85

0

22

1

+

 
Answer: 

4.63. In many textbooks  is written as  . It is important to understand that the actual 

concentration may well be different.: the regression line is just a mathematical model of the reality. 

=

)

('

y

4

'

y

 
Example 3:  In order to obtain a concentration of 10.5, how much chemical should she add? 
 
Solution: Once 

again 

press 

b

 but select   this time, and press 

y

to put this function into the entry line. 

'

x

 

  returns 

'

x

b

a

y

. Enter the given y value: 

10.5

 and press 

y

to calculate the estimated 

amount of chemical. 

hp calculators 

- 3 - 

HP 30S Statistics – Linear Regression - Version 1.0 

Содержание HP 30S

Страница 1: ...hp calculators HP 30S Statistics Linear Regression Linear Regression Practice Solving Linear Regression Problems ...

Страница 2: ...greement between the x and y variables and is given by n y y n x x n y x y x r i i i i i i i i 2 2 2 2 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 1 1 ...

Страница 3: ...ressed to two decimal digits a 1 22 and b 0 85 therefore the regression line is The correlation coefficient is 0 91 which means that the correlation is positive and that it is quite a good fit since r is close to 1 However exactly how far away from this value the correlation can be and the equation still be considered a good predictor is certainly a matter of debate x y 85 0 22 1 Example 2 If the ...

Страница 4: ... 5 9 To find press y 5 10 b to select y10 5y y Answer According to the new regression the predicted value is 9 88 grams The regression line is now where x is still the amount of chemical added and y is the concentration which y x 98 0 38 0 is not the same as before y x 18 1 44 1 Example 5 By polling fifty people a survey taker obtained the following data and 3333 i x 9 459 yi 231933 2 i x 57 4308 ...

Страница 5: ...s 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 th...

Отзывы: