Graphing

Graphing visualises data to facilitate perception and interpretation of distributions and relationships. Graphs should be accompanied by descriptive statistics.

This page provides an overview of graphing steps and principles and types of graphs.

Steps
Creating effective data visualisations is not easy. Suggested basic steps are:
 * 1) Identify the purpose of the graph
 * 2) Select which type of graph to use, based on the variable(s)' level of measurement
 * 3) Draw an appropriate graph
 * 4) Modify the graph to be clear, non-distorting, and well-labelled.
 * 5) Disseminate the graph (e.g., include it in a report)

Principles

 * 1) Maximise objective display of truth. According to Tufte, the “lie factor” in graphs is size shown in graph divided by statistical size. It should be 1.
 * 2) Avoid distortion (Tufte)
 * 3) Avoid excessive use of colour - effective graphs are often monotone.
 * 4) Clearly label axes and provide a meaningful, descriptive figure caption. Use a legend and/or footnotes as appropriate to provide sufficient information for the graph to be interpretable as a whole without detailed references to accompanying text.
 * 5) Graphs are subject to the law of parsimony - i.e., they should be as simple as necessary to clearly communicate about data of interest.
 * 6) The whole of the data is more than the sum of the parts (Gary Flake, 2010)
 * 7) Show the data (Tufte)
 * 8) Reveal data at several levels (Tufte)

Graph types
The choice of graph will depend on the variables' level of measurement.

Univariate
Graphs of a single variable.

{| class = "wikitable"

Bar chart

 * Also referred to as bar graphs
 * Used for illustrating frequencies or percentages for categories or the means of different groups or variables.
 * The x-axis shows the categories, groups or variables, the y-axis shows the quantity (frequency, percentage or a statistic such us a mean).
 * Tips for creating bar charts

Pie chart

 * Represents percentage data as pie slices (angles).
 * Generally not as effective as bar or error-bar graphs and are to be avoided.
 * Can be difficult to compare the relative size of similar-sized slices.
 * Can be difficult to label very small slices

Error-bar graph

 * Shows means with confidence intervals
 * Alternative to bar chart
 * [[Image:Pulse_Rate_Error_Bar_By_Exercise_Level.png|thumb|center|160px|Error-bar graph showing mean pulse rates and 95% confidence intervals by exercise level.]]

Box plot

 * Also known as the box and whisker plot
 * Plots the mean, quartiles, confidence interval and outliers

Stem and leaf plot
-2 | 4 -1 | 2 -0 | 3 0 | 4 6 6 1 | 6 2 | 4 3 |  4 |  5 | 7
 * Displays stem (e.g., 10s) and leaves (e.g., 1s).
 * Each leaf represents a case
 * The exact data is provided in a visual display (like a histogram)

Histogram

 * Displays the frequency of occurrence of data for intervals within a single variable continuous distribution.
 * }

Bivariate
Graphs of the relation between two variables.

Clustered bar-graph
{| class = "wikitable"
 * Clustered bar-graphs are used to include an additional independent variable (e.g., gender). The separate groups are represented by different coloured bars.
 * Clustered bar-graphs are used to include an additional independent variable (e.g., gender). The separate groups are represented by different coloured bars.
 * Clustered bar-graphs are used to include an additional independent variable (e.g., gender). The separate groups are represented by different coloured bars.

Scatterplot

 * Plots the relation between two variables on a continuous x and y axis
 * }