IB Maths Help logoIB Maths Help

Histogram and cumulative frequency graph

Draw a histogram and a cumulative frequency graph from a grouped frequency table, with the exact key presses for the TI-84 Plus CE, Casio fx-CG50, Casio fx-CG100 and TI-Nspire CX, plus how to estimate the median and quartiles and what to write in the exam.

Used inAA SLAA HLAI SLAI HL

For a histogram, enter the class mid-values in one list and the frequencies in another, then set up a histogram plot with the frequencies as the frequency list and the bar width equal to the class width. For a cumulative frequency graph, enter the upper class boundaries in one list and the running totals of the frequencies in another, and draw a line graph through those points. Estimate the median from the cumulative frequency of n2\tfrac{n}{2}, and the quartiles from n4\tfrac{n}{4} and 3n4\tfrac{3n}{4}.

Example

The times, in minutes, taken by 40 students to finish a puzzle are grouped in classes of width 10: 0<t≤100 \lt t \le 10 with frequency 3; 10<t≤2010 \lt t \le 20 with frequency 7; 20<t≤3020 \lt t \le 30 with frequency 12; 30<t≤4030 \lt t \le 40 with frequency 10; 40<t≤5040 \lt t \le 50 with frequency 6; 50<t≤6050 \lt t \le 60 with frequency 2. Draw a histogram of the data. Find the cumulative frequencies and draw a cumulative frequency graph. Use the graph to estimate the median and the interquartile range.

The classes all have width 1010, so the height of each bar is simply the frequency. For the cumulative frequency graph, add the frequencies as a running total and plot each total against the upper boundary of its class, starting from (0,0)(0, 0). The median is the value at cumulative frequency 402=20\tfrac{40}{2} = 20, the lower quartile is at 1010 and the upper quartile is at 3030. The 20th value lies in the class 20<t≤3020 \lt t \le 30, so the median is about 28.328.3. The lower quartile is 2020 and the upper quartile is 3838, so the interquartile range is 38−20=1838 - 20 = 18.

Choose your calculator

How to draw a histogram and a cumulative frequency graph on a TI-84 Plus CE

Histogram from grouped data

Press stat and choose 1:Edit.... In L1 type the class mid-values, pressing enter after each: 5, 15, 25, 35, 45, 55. In L2 type the frequencies: 3, 7, 12, 10, 6, 2. Clear any old numbers out of both lists first.

L1 L2
5 3
15 7
25 12
35 10
...

Press 2nd Y= (STAT PLOT) and choose 1:Plot1. Set Plot1 to On, choose the histogram icon for Type (the third of the six), set Xlist to L1 with 2nd 1, and set Freq to L2 with 2nd 2.

Plot1 On
Type: histogram
Xlist:L1
Freq:L2

Press window and set Xmin to 0, Xmax to 60 and Xscl to the class width, 10. Set Ymin to 0 and Ymax to a little more than the greatest frequency, such as 14. Press graph.

Xmin=0
Xmax=60
Xscl=10
Ymin=0
Ymax=14

Press trace and use ◀ and ▶ to move from bar to bar. The screen shows the start and end of each class and its frequency.

The tallest bar is the class 20<t≤3020 \lt t \le 30, with frequency 1212.

min=20
max=30
n=12

Cumulative frequency graph

Press stat and choose 1:Edit.... In L3 type the upper class boundaries: 10, 20, 30, 40, 50, 60. In L4 type the cumulative frequencies, the running totals of the frequencies: 3, 10, 22, 32, 38, 40.

L3 L4
10 3
20 10
30 22
40 32
...

Press 2nd Y= (STAT PLOT), choose 1:Plot1 and set it to Off. Choose 2:Plot2, set it to On, and choose the xyLine icon for Type (the second of the six). Set Xlist to L3 with 2nd 3 and Ylist to L4 with 2nd 4.

Plot1 Off
Plot2 On
Type: xyLine
Xlist:L3
Ylist:L4

Press window and set Xmin to 0, Xmax to 60, Xscl to 10, Ymin to 0 and Ymax to a little more than the total, such as 45. Press graph. The points are joined by straight lines.

Cumulative frequencies 3,10,22,32,38,403, 10, 22, 32, 38, 40. The median is the 2020th value, so median≈28.3\text{median} \approx 28.3 minutes.

xyLine
(10,3)
(20,10)
...(60,40)

The graph also passes through (0, 0), the start of the first class, which the plot above leaves out: add it when you copy the graph. To avoid adding the frequencies by hand, press 2nd stat (LIST), choose OPS and then 6:cumSum(, and store cumSum(L2) in L4.

How to draw a histogram and a cumulative frequency graph on a Casio fx-CG50

Histogram from grouped data

Press MENU and choose Statistics. In List 1 type the class mid-values, pressing EXE after each: 5, 15, 25, 35, 45, 55. In List 2 type the frequencies: 3, 7, 12, 10, 6, 2. Clear any old numbers out of both lists first.

List 1 List 2
5 3
15 7
25 12
35 10
...

Press F1 (GRAPH), then F6 (SET). Move down with ▼ to Graph Type, press F6 to see the next set of types and choose Hist (F1). Set XList to List 1 and Frequency to List 2.

Graph Type:Hist
XList:List1
Frequency:List2

Press EXIT, then F1 (GPH1). A screen shows Start and Width for the bars: type 0 for Start and 1 0 for Width, pressing EXE after each, then press EXE to draw the histogram.

The tallest bar is the class 20<t≤3020 \lt t \le 30, with frequency 1212.

Start:0
Width:10
Hist

Cumulative frequency graph

In List 3 type the upper class boundaries: 10, 20, 30, 40, 50, 60. In List 4 type the cumulative frequencies, the running totals of the frequencies: 3, 10, 22, 32, 38, 40.

List 3 List 4
10 3
20 10
30 22
40 32
...

Press F1 (GRAPH), then F6 (SET) and open StatGraph2. Set Graph Type to xyLine (F2), XList to List 3 and YList to List 4. Press EXIT, then F2 (GPH2) to draw the graph. The points are joined by straight lines.

Cumulative frequencies 3,10,22,32,38,403, 10, 22, 32, 38, 40. The median is the 2020th value, so median≈28.3\text{median} \approx 28.3 minutes.

Graph Type:xyLine
XList:List3
YList:List4

The graph also passes through (0, 0), the start of the first class, which the plot leaves out: add it when you copy the graph. The Cuml command in the OPTN LIST menu adds up a list for you if you would rather not total the frequencies by hand.

How to draw a histogram and a cumulative frequency graph on a Casio fx-CG100

Histogram from grouped data

Press HOME and choose Statistics. In List 1 of the List Editor type the class mid-values, pressing EXE after each: 5, 15, 25, 35, 45, 55. In List 2 type the frequencies: 3, 7, 12, 10, 6, 2.

List 1 List 2
5 3
15 7
25 12
35 10
...

Press the next-tab key to reach the Setup tab and choose Draw Statistics Graph on the first line. Highlight Graph1, press OK to open it and press OK again on the first line to choose Histogram. Set XList to List 1. Highlight Frequency, press OK and choose List, then type 2 and press OK.

Graph1: Hist
XList:List1
Frequency:List2

Press the next-tab key. The Histogram Setting screen asks for Start and Width: type 0 and press OK, type 1 0 and press OK, then press OK on Execute. The histogram appears on the Graph tab.

The tallest bar is the class 20<t≤3020 \lt t \le 30, with frequency 1212.

Start:0
Width:10
Hist

Cumulative frequency graph

Go back to the List Editor with the previous-tab key. In List 3 type the upper class boundaries: 10, 20, 30, 40, 50, 60. In List 4 type the cumulative frequencies, the running totals of the frequencies: 3, 10, 22, 32, 38, 40.

List 3 List 4
10 3
20 10
30 22
40 32
...

On the Setup tab, open Graph1 and choose None, because a histogram and a line graph cannot be drawn together. Open Graph2, choose xy Line Graph, and set XList to List 3 and YList to List 4. Press the next-tab key to draw it. The points are joined by straight lines.

Cumulative frequencies 3,10,22,32,38,403, 10, 22, 32, 38, 40. The median is the 2020th value, so median≈28.3\text{median} \approx 28.3 minutes.

Graph2: xyLine
XList:List3
YList:List4

The graph also passes through (0, 0), the start of the first class, which the plot leaves out: add it when you copy the graph. If you want the histogram back, set Graph1 to Histogram again and Graph2 to None.

How to draw a histogram and a cumulative frequency graph on a TI-Nspire CX

Histogram from grouped data

Press home and choose Lists & Spreadsheet. In the top cell of column A type the name mid and press enter, then type the class mid-values below it, pressing enter after each: 5, 15, 25, 35, 45, 55. In column B use the name freq and type the frequencies: 3, 7, 12, 10, 6, 2.

A: mid B: freq
5 3
15 7
25 12
35 10
...

Add a Data & Statistics page. Open the menu on the horizontal axis and choose Add X Variable with Summary List. Choose mid as the X List and freq as the Summary List, then press menu → Plot Types → Histogram.

X List: mid
Summary List: freq
Plot: Histogram

Press menu → Plot Properties → Histogram Properties → Bin Settings → Equal Bin Width. Type 10 for Width and 0 for Alignment, then press enter. The bars now match the classes.

The tallest bar is the class 20<t≤3020 \lt t \le 30, with frequency 1212.

Width:10
Alignment:0

Cumulative frequency graph

On the Lists & Spreadsheet page, name column C bound and type the upper class boundaries: 10, 20, 30, 40, 50, 60. Name column D cumf. In the formula cell at the top of column D type =cumulativeSum(freq) and press enter, or type the running totals yourself: 3, 10, 22, 32, 38, 40.

C: bound D: cumf
10 3
20 10
30 22
40 32
...

Add a new Data & Statistics page. Click the horizontal axis and choose bound, then click the vertical axis and choose cumf: a scatter plot of the points appears. Press menu → Plot Properties → Connect Data Points to join them with lines.

Cumulative frequencies 3,10,22,32,38,403, 10, 22, 32, 38, 40. The median is the 2020th value, so median≈28.3\text{median} \approx 28.3 minutes.

x: bound
y: cumf
Connect Data Points

The graph also passes through (0, 0), the start of the first class, which the plot leaves out: add it when you copy the graph. Dragging the side of a bar changes the bin width, so use the Bin Settings box to be exact.

Sources. Key presses follow the manufacturers' documentation: the TI-84 Plus CE eGuide, the TI-Nspire eGuide, the Casio fx-CG50 Software User's Guide (version 3.30) and the Casio fx-CG100 online manual.

What to write in the exam

  • In an exam the graph is usually printed for you. Most questions give you the histogram or the cumulative frequency graph and ask you to read from it, so practise reading values as well as drawing them. Use the calculator to check a graph you have drawn and to total the frequencies.
  • Histogram. Draw the bars touching, with equal class widths, and put the frequency on the vertical axis. Label both axes and give the graph a scale. The tallest bar gives the modal class.
  • Cumulative frequency graph. Plot each running total at the upper class boundary, start the graph at the lower boundary of the first class with a cumulative frequency of 00, and join the points with a smooth curve. Label both axes.
  • Show where you read from. Write the cumulative frequency you used, for example n2\tfrac{n}{2} for the median, n4\tfrac{n}{4} for the lower quartile and 3n4\tfrac{3n}{4} for the upper quartile, and draw the lines on the graph. The examiner gives marks for the value you read across at, not only for the answer.
  • Estimates only. Values read from a graph, or found by interpolating inside a class, are estimates, so write the word estimate or use the ≈\approx sign. Keep the calculator values until the end and round only the final answer, to 3 significant figures unless the question says otherwise.
  • Check which papers allow a calculator. In AA SL and AA HL, Paper 1 is calculator-free. In AI SL and AI HL a calculator is allowed on every paper (check your syllabus).

What the calculator does and does not do

Estimating the mean from a histogram

Use the same two lists as for the histogram: the mid-values and the frequencies. Run one-variable statistics with the mid-values as the data and the frequencies as the frequency list. The mean is an estimate, because each value is replaced by the middle of its class. Here the estimated mean is 28.7528.75 minutes. The steps are in one-variable statistics.

Error messages and what to do

CalculatorMessageUsual causeWhat to try
TI-84 Plus CEERR:WINDOW RANGEThe class width Xscl is too small for the range from Xmin to Xmax: for a histogram, (Xmax - Xmin) / Xscl must be between 0 and 131.Set Xscl to the class width, and check that Xmin and Xmax are not far apart.
TI-84 Plus CEERR:DIMENSION MISMATCHThe frequency list does not have the same number of values as the data list, or the two lists of a line graph have different lengths.Make the two lists the same length.
Casio fx-CG50Dimension ERRORThe frequency list does not have the same number of values as the data list.Check the dimension of the lists and make them the same length.
Casio fx-CG50Out of DomainThe frequency list contains a negative value.Frequencies must be 0 or positive: correct the list.
Casio fx-CG100Condition ERRORA histogram and a line graph are both switched on at the same time.Set the other graph to None before you draw.
Casio fx-CG100Dimension ERRORThe frequency list does not have the same number of values as the data list.Check the dimension of the lists and make them the same length.
TI-Nspire CXDimension mismatchThe data list and the frequency list have a different number of values.Make the two lists the same length.

Common mistakes

  • Plotting at the class mid-value. A cumulative frequency graph uses the upper boundary of each class. The mid-values are for the histogram and for estimating the mean.
  • Typing the frequencies instead of the running totals. The vertical values of a cumulative frequency graph are the totals so far, ending at the number of values in the data set.
  • Forgetting the point (0,0)(0, 0). The graph starts at the lower boundary of the first class with a cumulative frequency of 00.
  • Bars that do not match the classes. Set the bar width to the class width and the start to the lower boundary of the first class, or the bars will not line up with your table.
  • Reading the median at the wrong position. Read across at n2\tfrac{n}{2}, not at the middle of the horizontal axis.

Try it yourself

Real questions from the IB Maths Help question bank. Type your answer and press Mark it: the worked solution and mark scheme then appear. Use your calculator for the estimates.

Practise with your calculator

Choose your course to see the practice sets that use this skill. You can also try practice mode or browse every GDC guide.

Quick questions

How do I draw a histogram on a calculator?

Enter the class mid-values in one list and the frequencies in a second list, then set up a histogram of the first list using the second as the frequency list. Set the bar width to the class width and the start to the lower boundary of the first class. The TI-84 Plus CE uses a stat plot of type histogram and the WINDOW Xscl, the Casio calculators use a histogram graph type with a Start and Width setting, and the TI-Nspire uses a Data and Statistics page with equal bin width settings.

How do I draw a cumulative frequency graph?

Work out the running totals of the frequencies, then plot them against the upper class boundaries as a line graph: an xyLine plot on the TI-84 Plus CE, an xyLine or xy Line Graph on the Casio calculators, or a scatter plot with the points connected on the TI-Nspire. Add the point at the lower boundary of the first class with a cumulative frequency of 0.

How do I estimate the median and quartiles from a cumulative frequency graph?

Read across from a cumulative frequency of n/2 for the median, n/4 for the lower quartile and 3n/4 for the upper quartile, then down to the horizontal axis. The interquartile range is the upper quartile minus the lower quartile. These are estimates.

Can I use one-variable statistics for grouped data?

Yes, for the mean and standard deviation. Put the class mid-values in one list and the frequencies in another and use the frequency list in one-variable statistics. The results are estimates, because the mid-value stands for every value in the class.