Trident Help

RPN Scientific 15 manual · Chapter 8 of 12

Statistics and regression

Enter one-variable and two-variable data with Σ+, then find the mean, standard deviation, linear regression line, estimates and correlation.

8.1Enter data with Σ+#

Statistics collect data into the registers R2 to R7: R2 holds the count n, R3 the sum of x, R4 the sum of x², R5 the sum of y, R6 the sum of y² and R7 the sum of xy.

To add a data point with two variables, put y in Y and x in X (key in y, ENTER, x) and press Σ+ (Σ+). The display shows n, the number of points so far. For one variable, simply key in x and press Σ+.

Example 8.1

Enter three data points

  1. Clear old data with f Σ. Enter (x, y) = (3, 2), (5, 4) and (8, 6). Each is y, ENTER, x, Σ+.

    fCLR ΣGSB2ENTER3Σ+4ENTER5Σ+6ENTER8Σ+
Result of the example "Enter three data points" The display shows:  2.0000 /  4.0000 /  6.0000 /  3.0000.
You should seeThe display shows n = 3.0000.
  1. y
  2. ENTER
  3. x
  4. Σ+
  5. n is shown
Entering one data point.
RegisterHolds
R2nn, the number of points
R3∑x\sum x
R4∑x2\sum x^{2}
R5∑y\sum y
R6∑y2\sum y^{2}
R7∑xy\sum xy

8.2Find the mean and standard deviation#

xˉ=∑xnsx=n∑x2−(∑x)2n(n−1)\bar{x}=\frac{\sum x}{n}\qquad s_x=\sqrt{\frac{n\sum x^{2}-\left(\sum x\right)^{2}}{n(n-1)}}
The mean and the sample standard deviation (the same for y).

gx̄0 (x̄) gives the mean of x in X and the mean of y in Y. gs. (s) gives the sample standard deviation: s of x in X and s of y in Y. Both need at least two data points (the mean needs one).

Example 8.2

Mean of x and y

  1. Enter the data from before, then press g, x̄.

    fCLR ΣGSB2ENTER3Σ+4ENTER5Σ+6ENTER8Σ+gx̄0
Result of the example "Mean of x and y" The display shows:  4.0000 /  6.0000 /  4.0000 /  5.3333.
You should seex̄ = 5.3333 in X, ȳ = 4.0000 in Y.
Example 8.3

Standard deviation

  1. Enter the data, then press g, s.

    fCLR ΣGSB2ENTER3Σ+4ENTER5Σ+6ENTER8Σ+gs.
Result of the example "Standard deviation" The display shows:  4.0000 /  6.0000 /  2.0000 /  2.5166.
You should sees of x is 2.5166 (in X). s of y is 2.0000 (in Y).
Example 8.4

Mean of one variable

  1. Clear, then enter 5, 7 and 9 with Σ+ and press g, x̄.

    fCLR ΣGSB5Σ+7Σ+9Σ+gx̄0
Result of the example "Mean of one variable" The display shows:  0.0000 /  0.0000 /  0.0000 /  7.0000.
You should see7.0000

8.3Fit a straight line: linear regression#

y=A+BxB=n∑xy−∑x∑yn∑x2−(∑x)2A=yˉ−Bxˉy=A+Bx\qquad B=\frac{n\sum xy-\sum x\sum y}{n\sum x^{2}-\left(\sum x\right)^{2}}\qquad A=\bar{y}-B\bar{x}
The least-squares line that L.R. fits.

fL.R.Σ+ (L.R.) fits the line y = A + Bx to your data. The intercept A comes back in X and the slope B in Y.

Example 8.5

Slope and intercept

  1. Enter the data (3, 2), (5, 4), (8, 6) and press f, L.R.

    fCLR ΣGSB2ENTER3Σ+4ENTER5Σ+6ENTER8Σ+fL.R.Σ+
Result of the example "Slope and intercept" The display shows:  4.0000 /  6.0000 /  0.7895 / -0.2105.
You should seeThe intercept is −0.2105 (X) and the slope is 0.7895 (Y).

8.4Estimate y and find the correlation#

r=n∑xy−∑x∑y(n∑x2−(∑x)2)(n∑y2−(∑y)2)r=\frac{n\sum xy-\sum x\sum y}{\sqrt{\left(n\sum x^{2}-(\sum x)^{2}\right)\left(n\sum y^{2}-(\sum y)^{2}\right)}}
The correlation coefficient r.

Key in an x value and press fŷ,r. (ŷ,r). X shows the y value predicted by the fitted line. Y shows the correlation coefficient r, which is between −1 and 1. A value near 1 or −1 means the points lie close to a line.

Example 8.6

Estimate y when x is 5

  1. Enter the data. Key in 5 and press f, ŷ,r.

    fCLR ΣGSB2ENTER3Σ+4ENTER5Σ+6ENTER8Σ+5fŷ,r.
Result of the example "Estimate y when x is 5" The display shows:  4.0000 /  6.0000 /  0.9934 /  3.7368.
You should seeŷ = 3.7368 (X), r = 0.9934 (Y).

8.5Remove or correct a data point#

To remove a point you entered by mistake, key in exactly the same y and x, and press gΣ−Σ+ (Σ−). The count n goes down by one. To fix a point, remove the wrong one and then enter the right one.

Example 8.7

Remove a point

  1. Enter three points, then remove the last one by keying it in again with Σ−.

    fCLR ΣGSB2ENTER3Σ+4ENTER5Σ+6ENTER8Σ+6ENTER8gΣ−Σ+
Result of the example "Remove a point" The display shows:  4.0000 /  6.0000 /  6.0000 /  2.0000.
You should seen goes back to 2.0000.

8.6Read the sums and the count#

Recall any statistics register with RCL: RCL 2 gives n, RCL 3 gives Σx, and so on. RCL then Σ+ puts Σx in X and Σy in Y in one go. You can also store into these registers, but that changes the statistics.

Example 8.8

Sums of x and y

  1. Enter the three points, then press RCL, Σ+.

    fCLR ΣGSB2ENTER3Σ+4ENTER5Σ+6ENTER8Σ+RCLΣ+
Result of the example "Sums of x and y" The display shows:  4.0000 /  6.0000 /  12.0000 /  16.0000.
You should seeΣx = 16.0000 in X, Σy = 12.0000 in Y.

HP-15C is a trademark of HP Inc.. Trident Calculator is an independent product by South View Studios and is not affiliated with, sponsored by or endorsed by HP. The name is used only to describe the kind of calculator this model resembles; Trident's names, keys, display, fonts and software are its own clean-room design.