Trident Help

RPN Advanced 42 manual · Chapter 11 of 18

Statistics

Enter data pairs with sigma-plus, then read means, deviations, sums, and fit a straight line.

11.1Enter data points#

Each data point is a pair: put y in Y and x in X, then press Σ+. After each point the display shows the number of points so far. For one-variable data, enter any y (for example 0) and the x values. Shift Σ+ removes a point you entered by mistake. The sums live in registers 11 to 23: R11 to R16 hold Σx, Σx², Σy, Σy², Σxy and n, and R17 to R23 the logarithm sums that the other curve-fit models use (ALLΣ, the default). LINΣ on page 2 of STAT keeps only the first six; ΣRG moves the block to another register and ΣR? shows where it starts.

xˉ=∑xn,s=∑x2−nxˉ2n−1\bar{x}=\frac{\sum x}{n},\qquad s=\sqrt{\frac{\sum x^2-n\bar x^2}{n-1}}
Example 11.1

Add three data points

  1. Enter (x, y) = (2, 1), (4, 2), (7, 3) as y ENTER x Σ+.

    1ENTER2Σ+2ENTER4Σ+3ENTER7Σ+
Result of the example "Add three data points" The display shows: y: 3.0000 / x: 3.0000.
You should seex: 3.0000
Example 11.2

Remove a point

  1. Add a point and remove it again; the count returns to zero.

    2ENTER1Σ+2ENTER1⇧Σ−Σ+
Result of the example "Remove a point" The display shows: y: 2.0000 / x: 0.0000.
You should seex: 0.0000

A matrix with two columns enters many points at once: with the matrix in X, Σ+ adds each row as one point (x in column 1, y in column 2), and shift Σ+ removes them again. Any other shape gives Dimension Error.

Example 11.3

Add a whole table of points

  1. Make a 3 × 2 matrix and fill in the rows (1, 2), (2, 4), (3, 6).

    3ENTER2⇧MATRIX9Σ+XEQ1LN2LN2LN4LN3LN6EXITEXITEXIT
  2. Press Σ+: three points are added.

    Σ+
Result of the example "Add a whole table of points" The display shows: y: 0.0000 / x: 3.0000.
You should seex: 3.0000

11.2The STAT menu: sums, mean and deviation#

The STAT menu: Σ+, SUM, mean, weighted mean, standard deviation and FIT. The display shows: x: 0.0000 /  Σ+ SUM  x̄ x̄w  s  FIT.
The STAT menu: Σ+, SUM, mean, weighted mean, standard deviation and FIT.
LabelResult
Σ+Adds the point (same as the key).
SUMX = sum of x, Y = sum of y.
x̄ (MEAN)X = mean of x, Y = mean of y.
x̄w (WMN)Weighted mean of x using y as the weights.
s (SDEV)X = sample standard deviation of x, Y = of y.
FITOpens the line-fit menu.
Example 11.4

Mean of x

  1. Enter the three points, open STAT and press the mean key (third).

    1ENTER2Σ+2ENTER4Σ+3ENTER7Σ+⇧STAT÷√x
Result of the example "Mean of x" The display shows: x: 4.3333 /  Σ+ SUM  x̄ x̄w  s  FIT.
You should seex: 4.3333
Example 11.5

Sum of x

  1. The SUM key (second).

    1ENTER2Σ+2ENTER4Σ+3ENTER7Σ+⇧STAT÷1/x
Result of the example "Sum of x" The display shows: x: 13.0000 /  Σ+ SUM  x̄ x̄w  s  FIT.
You should seex: 13.0000
Example 11.6

Standard deviation of x

  1. The s key (fifth).

    1ENTER2Σ+2ENTER4Σ+3ENTER7Σ+⇧STAT÷LN
Result of the example "Standard deviation of x" The display shows: x: 2.5166 /  Σ+ SUM  x̄ x̄w  s  FIT.
You should seex: 2.5166
Example 11.7

Weighted mean

  1. The fourth key.

    1ENTER2Σ+2ENTER4Σ+3ENTER7Σ+⇧STAT÷LOG
Result of the example "Weighted mean" The display shows: x: 5.1667 /  Σ+ SUM  x̄ x̄w  s  FIT.
You should seex: 5.1667

See also Find the mean and spread of one listSummarize paired data (x and y)

11.3Fit a straight line and forecast#

FIT (sixth key of STAT) opens the curve-fit menu: FCX, FCY, SLP, YIN, r and MDL. With the linear model (the default) they use the least-squares line y=mx+by=mx+b.

m=n∑xy−∑x∑yn∑x2−(∑x)2,b=yˉ−mxˉm=\frac{n\sum xy-\sum x\sum y}{n\sum x^{2}-(\sum x)^{2}},\qquad b=\bar y-m\bar x
The FIT menu: forecast x, forecast y, slope, intercept and correlation. The display shows: x: 0.0000 / FCX FCY SLP YIN  r  MDL.
The FIT menu: forecast x, forecast y, slope, intercept and correlation.
Example 11.8

Slope of a perfect line

  1. Points (1,3), (2,5), (3,7) lie on y = 2x + 1. Open STAT, FIT, SLP (third).

    3ENTER1Σ+5ENTER2Σ+7ENTER3Σ+⇧STAT÷XEQ√x
Result of the example "Slope of a perfect line" The display shows: x: 2.0000 / FCX FCY SLP YIN  r  MDL.
You should seex: 2.0000
Example 11.9

Intercept of the line

  1. YIN is the fourth key.

    3ENTER1Σ+5ENTER2Σ+7ENTER3Σ+⇧STAT÷XEQLOG
Result of the example "Intercept of the line" The display shows: x: 1.0000 / FCX FCY SLP YIN  r  MDL.
You should seex: 1.0000
Example 11.10

Correlation

  1. The r key is the fifth.

    3ENTER1Σ+5ENTER2Σ+7ENTER3Σ+⇧STAT÷XEQLN
Result of the example "Correlation" The display shows: x: 1.0000 / FCX FCY SLP YIN  r  MDL.
You should seex: 1.0000
Example 11.11

Forecast y at x = 10

  1. Type 10 and press FCY (second key).

    3ENTER1Σ+5ENTER2Σ+7ENTER3Σ+⇧STAT÷XEQ101/x
Result of the example "Forecast y at x = 10" The display shows: x: 21.0000 / FCX FCY SLP YIN  r  MDL.
You should seex: 21.0000
Example 11.12

Forecast x for y = 9

  1. Type 9 and press FCX (first key).

    3ENTER1Σ+5ENTER2Σ+7ENTER3Σ+⇧STAT÷XEQ9Σ+
Result of the example "Forecast x for y = 9" The display shows: x: 4.0000 / FCX FCY SLP YIN  r  MDL.
You should seex: 4.0000

MDL (sixth key of FIT) chooses the model: LNF (straight line, y = b + mx), LGF (logarithmic, y = b + m ln x), EXF (exponential, y = b·e^(mx)), PWF (power, y = b·x^m) and BST, which picks the model whose correlation is largest. The marked model is the one FCX, FCY, SLP, YIN and r use. A point with x ≤ 0 rules out LGF and PWF, and y ≤ 0 rules out EXF and PWF: they then give Invalid Forecast Model.

The model menu: linear, logarithmic, exponential, power and BEST. The display shows: x: 0.0000 / LNF■ LGF EXF PWF    BST.
The model menu: linear, logarithmic, exponential, power and BEST.
Example 11.13

An exponential fit

  1. The points (1, 6), (2, 12), (3, 24) follow y = 3·2^x. Choose EXF and read YIN: b = 3.

    6ENTER1Σ+12ENTER2Σ+24ENTER3Σ+⇧STAT÷XEQXEQ√xEXITLOG
Result of the example "An exponential fit" The display shows: x: 3.0000 / FCX FCY SLP YIN  r  MDL.
You should seex: 3.0000
Example 11.14

Forecast with the exponential model

  1. With EXF chosen, type 4 and press FCY: 3·2⁴ = 48.

    6ENTER1Σ+12ENTER2Σ+24ENTER3Σ+⇧STAT÷XEQXEQ√xEXIT41/x
Result of the example "Forecast with the exponential model" The display shows: x: 48.0000 / FCX FCY SLP YIN  r  MDL.
You should seex: 48.0000
Example 11.15

Let BEST choose

  1. BST (sixth key of MDL) marks the exponential model for these points.

    6ENTER1Σ+12ENTER2Σ+24ENTER3Σ+⇧STAT÷XEQXEQXEQ
Result of the example "Let BEST choose" The display shows: x: 3.0000 / LNF LGF EXF■ PWF    BST.
You should seeEXF■

See also Fit a straight line to data

11.4Clear the statistics#

Example 11.16

Clear the sums

  1. Add a point, open CLEAR and press CLΣ, then look at register 16 (the count).

    2ENTER1Σ+⇧CLEAR←Σ+EXITRCL16
Result of the example "Clear the sums" The display shows: y: 2.0000 / x: 0.0000.
You should seex: 0.0000

HP-42S 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.