Linear regression is a statistical method for finding a straight line that best fits a set of x,ydata. There must be at least two different x,ypairs. The straight line provides a relationship between the x and yvariables: y = mx + b, where m is the slope and b is the yintercept.
hpsupportheadportlet
Actions ${title}
Loading...
Welcome to HP Customer Support
hpcontactsecondarynavigationportlet
Actions ${title}
Loading...
hpherosupportsearch
Actions ${title}
Loading...
hpshareprintwidgetportlet
Actions ${title}
Loading...
hpconcentrawrapperportlet
Actions ${title}
Loading...
HP 20s Calculator  Linear Regression and Estimation
Calculator symbol key
The procedures in this document use the following text to represent symbol keys:
Key

Description

Text Representation


Right shift key

RS


Leftshift key

LS


Clears statistical registers

CLSUM


Accumulates statistical data

SUM+


Arithmetic mean (average) of the xvalues

xy


Divide

divide


Estimate of for a given value of y

xr


Estimate of for a given value of x

yr

To perform a linear regression

Enter the x,ydata using the following instructions:

Clear any previous contents of R^{4}through R^{9} by pressing RS, then CLSUM

Enter the first xvalue and press INPUT. The HP 20s displays the xvalue.

Enter the corresponding yvalue and press SUM+. The HP 20s displays the number of pairs of items (n) accumulated; in this case, "1.0000"

Continue entering x,ypairs. The nvalue is incremented with each entry.To enter data for calculating the weighted mean, enter each data value as x, and its corresponding weight as y.


Press:

RS, xr, LS, then SWAP (or RS, yr, LS, then SWAP) to display r, the correlation coefficient.

RS, then m,b to display m, the slope of the line, followed by LS, then SWAP to display b, the yintercept.

To perform linear estimation

Enter the x,ydata using the following instructions:

Clear any previous contents of R^{4} through R^{9} by pressing RS, then CLSUM

Enter the first xvalue and press INPUT. The HP 20s displays the xvalue.

Enter the corresponding yvalue and press SUM+. The HP 20s displays the number of pairs of items (n) accumulated; in this case, "1.0000"

Continue entering x,ypairs. The nvalue is incremented with each entry.To enter data for calculating the weighted mean, enter each data value as x, and its corresponding weight as y.


Enter the known xvalue or yvalue:

To estimate x for the given y, enter the yvalue, then press RS, then xr

To estimate y for the given x, enter the xvalue, then press RS, then yr

Example of linear regression and estimation
The rate of a certain chemical reaction depends on the initial concentration of one chemical. When the reaction is run repeatedly, varying only the initial concentration of the chemical, the following rates are observed:
Concentration X (moles per liter)

0.050

0.075

0.10

0.125

0.20

Rate Y (moles per liter)

0.0062

0.00941

0.0140

0.0146

0.023

Calculate the slope and yintercept of the best straight line fitted to the data. Also calculate the correlation coefficient.
Keys

Display

Description

Press RS, then CLSUM

0.0000

Clears the statistical registers

Press .05, INPUT, .0062, then SUM+

1.0000
 
Press .075, INPUT, .00941, then SUM+

2.0000
 
Press .1, INPUT, .014, then SUM+

3.0000
 
Press .125, INPUT, .0146, then SUM+

4.0000
 
Press .2, INPUT, .023, then SUM+

5.0000

Enters the x, ydata

Press RS, then m,b

0.1093

Displays the slope

Press LS, then SWAP

0.0014

Displays the yintercept. : indicates another result

Press RS, xr, LS, then SWAP

0.9890

Displays the correlation coefficient

Enter the rate of the reaction when the concentration equals 0.09 moles per liter:
Keys

Display

Description

Press .09, RS, then yr

0.0113

Calculates the estimate of y for x=0.09

What concentration is necessary for the rate to equal 0.0200?
Keys

Display

Description

Press .02, RS, then xr

0.1700

Calculates estimate of x for y=0.02

Press C

0.000

Clears the display and : annunciator

hpfeedbackinputportlet
Actions ${title}
Loading...
hponlinecommunitiesportlet
Actions ${title}
Loading...
Ask the community!
hpfeedbackbannerportlet
Actions ${title}
Loading...
hpcountrylocatorportlet
Actions ${title}
Loading...
Country:
United States
hpdetectloadmydeviceportlet
Actions ${title}
Loading...