Introduction to creating graphs

You will remember from Unit 02 that each type of data requires its own specific techniques for description and visualisation.

Qualitative data includes non-numeric categories or labels. Important information is Frequency Counts. This can be effectively assessed using the table() function in R (see section “barplot” for more details). Recommended Plots are

  • Bar Plots: Ideal for displaying the frequency of different categories.
  • Pie Charts: Useful for showing the proportion of each category.
  • Dot Plots: Effective for comparing the frequency or count of categories, particularly when dealing with a large number of categories where a bar plot might become cluttered.

Quantitative data is numerical and permits a wider array of statistical analyses, such as mean (the average value), the median (the middle value in ordered data) and quantiles (indicating data spread). The summary() function in R provides a quick statistical summary of these metrics.

Recommended Plots are:

  • Histograms: Excellent for the distribution of a single numerical variable.
  • Density Plots: Useful for understanding the distribution’s shape.
  • Boxplots: Visualize medians, quartiles, and outliers.
  • Scatterplots: Ideal for relationships between two quantitative variables.
  • Line Charts: Best for trends over time.
  • Dot Plots: Particularly effective for small or moderate-sized datasets to highlight individual data points and distributions without binning data like histograms.

The choice of plot should align with your data’s nature (continuous, categorical) and the specific insights you aim to communicate.

At the end of this unit you should know how to choose and create plots yourself

Let’s dive into the different plot types!

  • histograms
  • dotplots
  • barplots
  • boxplots
  • linecharts
  • piecharts and
  • scatterplots.

    Comments?

    You can leave comments below if you have questions or remarks about any of the text or code in this unit. Please copy the corresponding line into your comment to make it easier to answer your question.

Updated: