Median (Median Of Statistics Data) - HP 48gII Advanced User's Reference Manual

Graphing calculator
Hide thumbs Also See for 48gII:
Table of Contents

Advertisement

Techniques used in %TILE
FLOOR and CEIL. For an integer, FLOOR and CEIL both return that integer; for a noninteger, FLOOR and
!
CEIL return successive integers that bracket the noninteger.
SORT. The SORT command sorts the list elements into ascending order.
!
%TILE program listing (Note: Use Approximate mode for this program and example)
Program:
«
SWAP SORT
DUP SIZE
1 + ROT 100 / *
 p
«
DUP
p FLOOR GET
SWAP
p CEIL GET
+ 2 /
»
»
`O%TILE K
Checksum: # 50559d
Bytes:
99
Example: Calculate the median of the list {8 3 1 5 2}.
!ä8 3 1 5 2`
J50 %©TILE%

MEDIAN (Median of Statistics Data)

MEDIAN returns a vector containing the medians of the columns of the statistics data. Note that for a sorted list
with an odd number of elements, the median is the value of the center element; for a list with an even number of
elements, the median is the average value of the elements just above and below the center.
Comments:
Brings the list to level 1 and sorts it.
Copies the list, then finds its size.
Calculates the position of the specified
percentile.
Stores the center position in local variable p.
Begins the defining procedure.
Makes a copy of the list.
Gets the number at or below the center
position.
Moves the list to level 1.
Gets the number at or above the center
position.
Calculates the average of the two numbers.
Ends the defining procedure.
Stores the program in %TILE.
Level 1
"
"
Level 1
[ x
... x
]
x
1
2
m
RPL Programming Examples 2-11

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

49g+

Table of Contents