Descriptive STATISTICS: Mean, Mode, Median

Introduction:  The MEAN (or average) of a set of data values is the sum of all of the data values divided by the number of data values. The MEDIAN of a set of data values is the middle value of the data set when it has been arranged in ascending order. That is, from the smallest value to the highest value. The MODE of a set of data values is the value(s) that occurs most often.

       Mean      Standard Deviation      Variance  
  AASTAT3 (AASTST 2004 Brian Gordon) computes mean, median, and mode from a set of data, The "mean" is the "average", where you add up all the numbers and then divide by the number of numbers. The "median" is the "middle" value in the list of numbers. To find the median, your numbers have to be listed in numerical order, so you may have to rewrite your list first. The "mode" is the value that occurs most often. If no number is repeated, then there is no mode for the list.
Program written by Brian Gordon (
  Note: This program is in TI-BASIC and can be entered into the calculator by the calculator keyboard. Do not enter the outline, line numbers or comments, they are for reference only. The example programs below are for testing the program. If you get the values listed, the program was entered correctly. If not, check the listing and correct it. The program has been checked and tested.
  Note: -> is the [STO->] on the calculator keyboard.
  Note: for instructions line 2 through 7, do not use a line break or space between " and , but allow the code to wrap to the next line. Do not use more then 7 lines without a pause commant to display the text.
    Program Memory = 424

  Note: This program uses formulas in the program to calculate: mean, variance, standard deviation.
Related Articles:- StdDevSS    StDevFrq    StDevFrm

  Line 1. Clear
  Line 2. Instructions
  Line 7. input data
  Line 30. mode
  Line 33. Sort A
  Line 35. multiple modes
  Line 39 display
    Reference Links


Line  Command or Statement  Comments
   1.  ClrHome Clear Screen
   2. Disp "USE COMMAS BTWN" Instructions
    ,"NUMBERS IN LIST"       |
    ,"ENTER NUMBERS"       |
     ,"IN LIST L1=" End Instructions
   3.  Pause 
   4.  ClrHome 
   5. DelVar L1 DelVar L2DelVar L3 DelVar L6 
   6. 1->θ 
   7. Input "L1=",Str0 Input List 1
   8. While inString(Str0,", 
   9. inString(Str0,",->A 
 10. expr(sub(Str0,1,A-1>L1(θ 
 11. θ+1->θ 
 12. sub(Str0,A+1,length(Str0)-A->Str0 
 13. End 
 14. expr(Str0->L1(θ 
 15. dim(L1->A 
 16. A->dim(L2 
 17. For(X,1,A,1 For( variable,begin,end[increment])
 18. For(Y,1,A,1 
 19. If (L1(X)=L1(Y 
 20. 1+L2(X->L2(X L2 is "high score list"
 21. End:End 
 22. L2(1->θ 
 23. For(Z,1,A,1 
 24. If L2(Z)>θ 
 25. L2(Z->θ θ contains highest score found in L2
 26. End 
 27. 1->O 
 28. For(P,1,dim(L2),1 
 29. If (L2(P)=θ:Then 
 30. L1(P->L3(O L1(P) = mode (number)
 31. O+1->O 
 32. End:End 
 33. SortA(L3 SortA (L3) Sorts elements in ascending order
 34. 0->M 
 35. For(Q,1,dim(L3),θ checks for multiple modes
 36. M+1->M 
 37. M->dim(L6 
 38. L3(Q->L6(M mode into L6
 39. End Display
 40. median(L1)->A median(list   Returns the median of list
 41. Disp "MEDIAN=".A 
 42. round(mean(L1),3->B mean(list   Returns the mean of list
 43. Disp "MEAN=",B 
 44. If dim(L1)/=dim(L6) and dim(L1)/=dim(L3 
 45. Disp "MODE=",L6 
 46. Pause 
 47. variance(L1)->C 
 48. Disp "VARIANCE=",C 
 49. Pause 
 50. DelVar L1DelVar L2DelVar L3DelVar L6 
  Example 1: Median
List: 6, 7, 12, 13, 18, 23, 24
Answers:   MEDIAN = 13   MEAN = 14.714
  Example 2: Median
List: 7, 9, 12, 13, 15, 17, 21, 32, 41
Answers:   MEDIAN = 15   MEAN = 18.556
  Example 3: Mode
List: 13, 12, 11, 11, 10, 9, 9, 9, 6, 4
Answers:   MEDIAN = 9.5   MEAN = 9.4   MODE = {9}
Commands or Statements:
  ClrHome   clears home screen
  dim(   returns the dimension (number of elements) of list
  Disp   displays text or value specified
  End   identifies end of For(, If-Then-Else, Repeat, or While loop
  expr(   converts string to an expression
  For( variable,begin,end[increment])    Executes commands through End, incrementing variable from begin by increment until End.
  Goto   goes to label specified. Goto requires a line label be implemented as a destination
  If; Then; Else   Executes commands from Then to Else If condition true: or from Else to End if condition false
  Input   prompts for value to store to variable. Requires user input through keypad.
  Lbl   creates a label of one or two characters
  mean(list   Returns the mean of list
  median(list   Returns the median of list
  round( value [,# decimals])  returns a number rounded to # decimals (=<9)
  SortA( listname)   Sorts elements of listname in ascending (count up) order
  Str# (# is number)   String: A sequence of characters is called a string
  sum(   returns the sum of elements in list
  While condition   Executes commands while condition is true until end

  Information or Links:
This site contains typical problems and solutions on the general statistics topics of probability distributions, confidence intervals, hypothesis testing, analysis of variance, and correlation analysis.
  Using the TI-83 graphing calculator tutorial
General Info - Algebra 1 - Statistics 1 - Algebra 2 - Trigonometry - Statistics 2 - PreCalculus - Calculus
  TI-83 Video Tutorials
This series of tutorials for the TI-83 (or TI-83 Plus)Currently, only the chapters on single population confidence intervals, population hypothesis test, linear regression, Chi-Square and ANOVA are completed.
  TI-83 Guidebook
 Getting Started has introduced you to basic TI.83 operation. This guidebook. describes in detail the features you used in Getting Started.
  TI-83/84 Tutorial
 Working with Univariate Data; Working With Bivariate Data; Solving Equations/Inequalities; Counting Techniques; Probabilities; Confidence Intervals; Statistical Tests
  United TI Forums - TI Basic
TI-Basic - Use this forum to post questions and discuss the TI-BASIC programming language.
FREE TUTORIALS Cadet Career Counseling all rights reserved