3  Quantitative Data

Overview

In this lesson, we’ll cover some basic tools for describing quantitative (or continuous) data, using Chapter 3 of Essential R Course Notes.

Objectives

Upon completion of this lesson, you should be able to:


  1. describe quantitative (continuous) variables based on center and spread,
  2. test hypotheses about the mean of a quantitative variable,
  3. use resistant descriptors of center and spread,
  4. visualize quantitative variables in several ways, and
  5. create a quantitative variable from a qualitative variable.

Data and R Code Files

The R code file and data files for this lesson can be found on the Essential R - Notes on learning R page.

R logo

3.1 Quantitative Variables – Center and Spread

Here we’ll demonstrate basic measures of center and spread (mean, median, sd, quantiles) for quantitative variables.

Video - STAT 484 Lesson: 3.1

3.2 Hypothesis Tests with Quantitative Data

In this screencast, we’ll demonstrate testing hypotheses about the mean by calculating a t-statistic - both by hand, and via the built-in function t-test(). Note that when we use pt() to calculate p-values, the wrong tail gives us 1-p rather than p - the choice of upper or lower tail is important, and easy to get wrong. (Note the use of the tab key for hints on function arguments).

Video - STAT 484 Lesson: 3.2

3.3 Resistant Descriptors of Quantitative Data

Here we’ll consider some tools that are resistant to the presence of outliers in the data.

Note! Statistic “MAD” is actually “Median Absolute Deviation”, not “Median Average Deviation” as mis-spoken here.

Video - STAT 484 Lesson: 3.3

3.4 Visualizing Quantitative Data: Histograms - Part I

Here we introduce histograms and kernel density estimates (kde) as tools for visualising distributions. Note that the kde is somewhat sensitive to the bandwidth used to generate it - a wider bandwidth yields a smoother distribution.

Video - STAT 484 Lesson: 3.4

3.5 Visualizing Quantitative Data: Histograms - Part II

Here we explore how we can alter histograms by changing the bin width.

Video - STAT 484 Lesson: 3.5

3.6 Visualizing Quantitative Data: Boxplots & Stripcharts

In this screencast we’ll demonstrate the boxplot and the stripchart, both of which can be useful tools for visualizing qualitative variables.

Video - STAT 484 Lesson: 3.6

3.7 Making Qualitative Variables from a Numeric Variable

This screencast will demonstrate the stem-and-leaf plot and will also show how to group values from a quantitative variable using the function cut() to create a qualitative variable.

Video - STAT 484 Lesson: 3.7