Skip to content

Unit 1: Exploring One-Variable Data and Collecting Data

AP Stats cheatsheet

Open ↗

Loading…

In statistics, there are two main types of variables: categorical (qualitative) variables and quantitative variables.

A categorical variable sorts each case into a group or label. The values are usually words or codes (for example: blood type, favorite color, zip code used only as a label). With categorical data, we typically report counts or percents in each category.

A quantitative variable is a variable with a numeric value and can be analyzed using arithmetic operations like differences, totals, and averages. Quantitative variables are split into:

  • Discrete variables: countable “jumps” between values (number of siblings, number of text messages in a day). Usually this comes in the forms of integers, but is not limited to them.
  • Continuous variables: in principle could take any value in an interval (height, time, temperature), though what we record is usually still rounded or binned (partitioned based on value) for convenience. Think of continuous variables as variables that can be expressed on a spectrum.

Descriptive statistics means organizing and summarizing data we actually have, without yet jumping to conclusions about a larger world. For univariate data, we use tabular summaries (tables), graphical summaries (plots), and numerical summaries (means, spreads, and positions).


Tables are the natural home for frequency: how often each value or category appears.

  • Let nn be the number of observations (the sample size, or size of the dataset).
  • The frequency of a value is how many times it occurs; it is often denoted ff.

The relative frequency compares a category’s frequency to the whole dataset:

rf=fnrf = \frac{f}{n}

Relative frequencies are especially useful when two datasets have different sizes, since percents put them on a common scale.

The cumulative frequency gives the count of observations less than or equal to a chosen value (or upper endpoint of a class). It is a running total as you move through ordered categories or ordered bins.

A frequency distribution lists possible values (or classes) of the variable together with their frequencies (and often relative or cumulative frequencies). Building that table is often the first step before drawing a histogram or cumulative relative frequency graph.

Value or classFrequencyRelative frequencyCumulative frequency
Category/bin 1f1f_1f1/nf_1/nf1f_1
Category/bin 2f2f_2f2/nf_2/nf1+f2f_1+f_2
Category/bin 3f3f_3f3/nf_3/nf1+f2+f3f_1+f_2+f_3
DisplayBest use
Frequency tableexact counts by category or interval
Dotplotsmall quantitative data sets
Histogramdistribution shape for many quantitative values
Stemplotpreserves individual values while showing shape
Boxplotquick comparison of center, spread, and outliers

For categorical data, we want displays that compare category sizes.

// draw diagrams for each type of graphical method (qualitative and quantitative)

In a bar chart, each category gets a bar and the length or height of the bar (depending on orientation) shows frequency (count) or relative frequency (percent). Categories on an axis are usually separated with a little space between bars, which signals that the order of categories is not necessarily numeric.

A pie chart represents the whole as a circle and divides it into slices whose central angles (or areas) match relative frequencies. For example, a category with relative frequency 0.36 gets about 36% of the circle. Pie charts work best with a small number of categories and when you want to emphasize parts of a whole. Usually, the pies will be different colors to have better contrast. They become hard to read when there are many thin slices or when differences are subtle.


For quantitative data, we care about center, spread, shape, and unusual values.

A dotplot stacks a dot above a number line for each occurrence of a value (or stacks dots in equal-width bins if values are rounded). Dotplots are best with small-to-moderate datasets: you see every value, clusters, gaps, and outliers without losing detail. Dotplots can also illustrate the shape of a distribution.

A stemplot splits each number into a stem (leading digit or digits) and a leaf (usually the last digit). Stems are listed in order; leaves are often ordered on each stem. The split between stem and leaf is a choice: you might split tens vs. ones, or group stems (e.g., 2*, 2•) when a plot is too sparse or too crowded. Stemplots preserve the actual values and work well for small datasets. The stems are listed on the left and the leaves are listed on the right.

A histogram groups quantitative data into intervals (bins), then draws bars whose heights show frequency or relative frequency (or density, in more advanced courses). Bars touch to show that the horizontal axis is a continuous scale (even though data are binned). The shape of a histogram (symmetric, skewed, unimodal, bimodal) can tell you a lot about the data (talked about later).

symmetricrightskew

// the vertical axis cuts off a bit and the vertical bars should not be intersecting with the vertical axis

Cumulative relative frequency graphs (ogives)

Section titled “Cumulative relative frequency graphs (ogives)”

An ogive plots cumulative relative frequency (from 0 to 1, or 0% to 100%) against values or upper class boundaries. Place a point above each boundary at the cumulative percent up to that boundary, then connect points with line segments. The curve rises; its height at a value tells you what fraction of data falls at or below that point.

A boxplot (box-and-whisker plot) summarizes a quantitative variable using quartiles and the median. Draw a box from the first quartile Q1Q_1 to the third quartile Q3Q_3; draw a line inside the box at the median. The interquartile range is IQR=Q3−Q1IQR = Q_3 - Q_1. “Whiskers” typically extend to the most extreme values within 1.5 × IQR of the quartiles; points beyond that range are plotted individually as outliers. Boxplots are ideal for comparing several groups on the same scale.

valueminQ1medianQ3max

// remove the overlapping lines on Q1, median, and Q3


Whenever you look at a univariate graph, there are a few main traits that should always be described. When comparing two graphs, you should always describe the center, spread, and shape, as well as irregularities in the plot (like clusters, gaps, and outliers).

The center is a typical or middle value—where much of the data sits. For many distributions, the mean and median lie near the visual center; for skewed data they can separate, which is an important aspect of the plot.

Spread describes how far values wander from center. Informally, look at whether points are tightly packed or widely scattered. Later we attach numbers to spread: range, interquartile range, variance, and standard deviation.

Shape tells us where data pile up and whether the distribution is symmetric or skewed.

  • Symmetric: the left and right sides are roughly mirror images (like a bell curve or a uniform histogram).
  • Skewed: one tail stretches farther than the other. If the right tail is longer (extreme large values pull the tail), the distribution is right-skewed (positively skewed). If the left tail is longer, it is left-skewed (negatively skewed). Name the skew by the direction of the tail, not by where most of the data are.

Describe the modality too: one clear peak is unimodal, two peaks are bimodal, and so on. Multiple peaks can suggest that the data combine different subgroups.

Clusters are groups of values separated from other groups; they can indicate the existence subpopulations or different regimes (for example, two manufacturing lines). Gaps are intervals with no (or very few) observations where you might have expected some; they invite questions about sampling, measurement, or real structure.

An outlier is a value that stands apart from the overall pattern. On a boxplot, a common numerical rule flags outliers relative to the quartiles:

Outlier>Q3+1.5⋅IQRorOutlier<Q1−1.5⋅IQR\text{Outlier} > Q_3 + 1.5 \cdot IQR \quad \text{or} \quad \text{Outlier} < Q_1 - 1.5 \cdot IQR

Always ask whether an outlier is a data entry error, a special case worth investigating, or simply natural variability in a heavy-tailed variable.


Summarizing Distributions: Population and Sample

Section titled “Summarizing Distributions: Population and Sample”

We distinguish population and sample because notation and formulas track that distinction.

  • The population is the entire group of individuals or instances we want to understand.
  • A sample is the part of the population we actually measure.

We compute statistics from a sample to estimate unknown population quantities. Greek letters (for example μ\mu, σ\sigma) often denote population parameters; Roman letters (basically English letters) with bars or hats (for example xˉ\bar{x}, ss, p^\hat{p}) denote sample statistics.


Numerical Methods for Continuous Variables

Section titled “Numerical Methods for Continuous Variables”

Numerical summaries compress a distribution into a few interpretable numbers. Always pair a measure of center with a measure of spread.

Mean (average) balances all values, but it is sensitive to outliers and skew.

For a population of size NN with values x1,…,XNx_1,\ldots,X_N:

μ=∑i=1NxiN\mu = \frac{\sum_{i=1}^{N} x_i}{N}

For a sample of size nn:

xˉ=∑i=1nxin\bar{x} = \frac{\sum_{i=1}^{n} x_i}{n}

Median is the middle value when data are ordered: half the values lie at or below it and half at or above it.

  • If there are nn ordered observations and nn is odd, the median is the value at position n+12\frac{n+1}{2}.
  • If nn is even, the median is the average of the values at positions n2\frac{n}{2} and n2+1\frac{n}{2}+1.

The median is resistant (robust) to outliers, meaning extreme values barely move it, which makes it a measure of central tendency for skewed data or data with outliers.


Range is the simplest spread measure: largest minus smallest. It uses only two numbers and is very sensitive to outliers.

Range=max⁡−min⁡\text{Range} = \max - \min

Interquartile range (IQR) is the width of the middle half of the data:

IQR=Q3−Q1IQR = Q_3 - Q_1

It is resistant to extremes and matches the width of the box in a boxplot.

Standard deviation measures typical distance from the mean. For a population:

σ=∑i=1N(xi−μ)2N\sigma = \sqrt{\frac{\sum_{i=1}^{N} (x_i - \mu)^2}{N}}

For a sample, we divide by n−1n - 1 (Bessel’s correction) so that s2s^2 is an unbiased estimator of population variance:

s=∑i=1n(Xi−xˉ)2n−1s = \sqrt{\frac{\sum_{i=1}^{n} (X_i - \bar{x})^2}{n-1}}

Larger standard deviation means more spread and zero standard deviation means no spread (all values equal).


Percentiles generalize the median. The **kk**th percentile is a value such that about kk% of observations fall at or below it. A common position rule for the location of the kkth percentile in ordered data of size nn is:

l=(n+1)k100l = \frac{(n+1)k}{100}

If ll is not an integer, interpolate between adjacent ordered values. Calculator or software conventions may differ slightly, so be consistent and explain your method when needed.

Quartiles are special percentiles:

  • Q1Q_1: 25th percentile
  • Q2Q_2: 50th percentile (the median)
  • Q3Q_3: 75th percentile

Standardized scores (z-scores) compare a value to the distribution’s center and spread:

z=x−μσz = \frac{x - \mu}{\sigma}

With a sample, use xˉ\bar{x} and ss in the same pattern. A z-score represents the amount of standard deviations above or below the mean a value is. Values with a large zz-score are unusual relative to that distribution. Note that for future chapters, z-score will apply heavily to a normal/Gaussian distribution.


Effects of Changing Units on Summary Measures

Section titled “Effects of Changing Units on Summary Measures”

Linear changes to data produce predictable changes to summaries. Suppose we transform each observation xitoyix_i to y_i.

Adding a constant aa (for example, converting Celsius to a shifted scale, or adding a bonus point to every score): yi=xi+ay_i = x_i + a.

  • Mean, median and quartiles shift by +a+a.
  • Spread measures that depend only on distances between values (range, IQR, standard deviation) are unchanged.

Multiplying by a constant bb (for example, feet to inches): yi=b×xiy_i = b \times x_i.

  • Mean, median, and quartiles multiply by bb.
  • Range, IQR, and standard deviation multiply by ∣b∣\lvert b \rvert
Summary Measureyi=xi+ay_i = x_i + ayi=b×xiy_i = b \times x_i
Mean+a+a×b\times b
Median+a+a×b\times b
Rangeunchanged×∣b∣\times \lvert b \rvert
Standard Deviationunchanged×∣b∣\times \lvert b \rvert
Quartiles+a+a×b\times b
Interquartile Rangeunchanged×∣b∣\times \lvert b \rvert

Investigative Questions and Data Collection

Section titled “Investigative Questions and Data Collection”

Statistics starts with an investigative question: a question that can be answered with data and that anticipates variability. A weak question asks for one fixed fact. A stronger statistical question asks about a distribution, comparison, association, or effect.

Examples:

  • Weak: “How many minutes did Alex study last night?”
  • Statistical: “How do study times vary among students in this class?”
  • Statistical comparison: “Do students in morning classes tend to study more than students in afternoon classes?”

  • The population is the full group you want to learn about.
  • A sample is the smaller group actually measured.
  • A sampling frame is the list or source used to choose the sample.
  • A census measures every member of the population.

The population and frame do not always match. If the frame misses some groups, then even a random sample from that frame may underrepresent the population.


A simple random sample gives every possible sample of the chosen size an equal chance of being selected. Random sampling is important because it reduces selection bias and supports generalizing from the sample to the population sampled from.

Other probability sampling designs:

  • Stratified random sample: split the population into strata, then sample randomly within every stratum.
  • Cluster sample: split the population into clusters, randomly choose clusters, then measure everyone in the chosen clusters.
  • Systematic sample: choose a random starting point and then sample every kkth item.

In a proportional stratified sample, the number sampled from each stratum is proportional to the stratum’s size in the population. This helps the combined sample represent the population while still guaranteeing that every stratum appears in the data.

Systematic samples are quick to carry out, but they can be biased if the ordered list has a hidden pattern that lines up with the spacing kk. Cluster samples are often cheaper than simple random samples, but they can be more variable if people inside each selected cluster are very similar.


Bias is systematic error, not just random variation. Common sources include:

  • Undercoverage: part of the population is missing from the frame.
  • Nonresponse bias: people who do not respond differ from those who do.
  • Response bias: answers are inaccurate because of wording, pressure, memory, or other measurement problems.
  • Voluntary response: people choose themselves into the sample, often because they have strong opinions.
  • Convenience sampling: the sample is chosen because it is easy to reach.
  • Wording bias: the question itself pushes people toward a particular answer.

Random sampling helps with selection bias, but it does not automatically fix bad wording, nonresponse, or measurement problems.


An observational study measures variables without assigning treatments. It can show association, but confounding variables usually prevent a cause-and-effect conclusion.

An experiment deliberately imposes treatments on experimental units. Random assignment helps balance lurking variables across treatment groups and supports cause-and-effect conclusions.

Key ideas:

  • Treatment: a condition applied to experimental units.
  • Factor: an explanatory variable controlled by the experimenter.
  • Levels: the values of a factor.
  • Control group: a baseline group for comparison.
  • Placebo: an inactive treatment that looks real.
  • Blinding: subjects, evaluators, or both do not know which treatment was assigned.
  • Replication: enough experimental units are assigned to each treatment.
  • Blocking: group similar units first, then randomize within each block.

Common experiment layouts:

  • Completely randomized design: all experimental units are randomly assigned among the treatments.
  • Randomized block design: similar units are grouped into blocks first, then treatments are randomly assigned within each block.
  • Matched-pairs design: each pair contains two similar units, or each unit receives both treatments in random order. This is a special block design for comparing two treatments.

If the same unit receives both treatments, think about order effects and carryover effects. Randomizing the order helps with order effects, but it cannot always fix carryover if the first treatment permanently changes the unit.