Actions

Actions

## hp-share-print-widget-portlet

Actions
• Information
Fraudulent Callers - protect yourself and report it​

Learn what to do if you are contacted by fraudulent callers posing as HP representatives. This could be a scam; do not provide any personal information.

View article

Actions

# HP 20s Calculator - Linear Regression and Estimation

Introduction
Linear regression is a statistical method for finding a straight line that best fits a set of x,y-data. There must be at least two different x,y-pairs. The straight line provides a relationship between the x- and y-variables: y = mx + b, where m is the slope and b is the y-intercept.
Calculator symbol key
The procedures in this document use the following text to represent symbol keys:
 Key Description Text Representation Right shift key RS Left-shift key LS Clears statistical registers CLSUM Accumulates statistical data SUM+ Arithmetic mean (average) of the x-values 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
1. Enter the x,y-data using the following instructions:
1. Clear any previous contents of R4through R9 by pressing RS, then CLSUM
2. Enter the first x-value and press INPUT. The HP 20s displays the x-value.
3. Enter the corresponding y-value and press SUM+. The HP 20s displays the number of pairs of items (n) accumulated; in this case, "1.0000"
4. Continue entering x,y-pairs. The n-value 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.
2. 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 y-intercept.
To perform linear estimation
1. Enter the x,y-data using the following instructions:
1. Clear any previous contents of R4 through R9 by pressing RS, then CLSUM
2. Enter the first x-value and press INPUT. The HP 20s displays the x-value.
3. Enter the corresponding y-value and press SUM+. The HP 20s displays the number of pairs of items (n) accumulated; in this case, "1.0000"
4. Continue entering x,y-pairs. The n-value 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.
2. Enter the known x-value or y-value:
• To estimate x for the given y, enter the y-value, then press RS, then xr
• To estimate y for the given x, enter the x-value, 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.05 0.075 0.1 0.125 0.2 Rate Y (moles per liter) 0.0062 0.00941 0.014 0.0146 0.023
Calculate the slope and y-intercept 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, y-data Press RS, then m,b 0.1093 Displays the slope Press LS, then SWAP 0.0014 Displays the y-intercept. : 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

Actions

## hp-online-communities-portlet

Actions

### Support Forum

Join the conversation! Find Solutions, ask questions, and share advice with other HP product owners. Visit now

Actions