Analysis of a Single Variable Flashcards
The distribution of a variable tells us
The distribution of a variable tells us what
values it takes and how often it takes those
values.
Two methods of visualizing categorical
distributions:
– Pie chart
– Bar graph
Categorical Variables
Variables that put the individual into
one of several groups or categories
Pie Chart
A pie chart shows how a
whole group (the sample)
is subdivided into smaller
groups (the categories).
* The size of a slice is
proportional to the
fraction of the sample in
that category.
– The sum of the
percentages shown by
each slice must add to
100%
Bar Graph
A bar graph
represents each
category as a
vertical bar.
* The height of the
bar shows the
category count or
percentage.
Bar Graph
* While every single
category must be
represented in a pie
chart (percentages
sum to 100%), we
can choose to omit
categories in a bar
graph depending on
our desired
comparisons.
Quantitative Variables
Variables that take values for which
arithmetic operations make sense
The distribution of a quantitative
variable tells us
The distribution of a quantitative
variable tells us what values the variable takes
and how often it takes these values
Methods of visualizing quantitative
distributions:
– Histogram
– Stemplot (Stem-and-leaf plot)
– Boxplot
A histogram
A histogram is graph of the distribution of a
quantitative variable whose values are grouped
together
* To make a histogram:
1. Divide the data range into classes of equal width,
such that each individual only falls into one class
2. Count the individuals in each class
3. Draw the histogram
* Classes on horizontal axis; count on vertical axis
– Stem:
consists of all but the
final digit
Leaf:
the final digit
stemplot advanatge
good for small dataset
histograms vs stemplot
– Unlike histograms, stemplots show the actual
values of the data
* Histograms are generally more flexible than
stemplots, because you can choose the width
of the classes.
Symmetric distribution
The right and left sides of
the histogram are approximately mirror images of
each other
Skewed to the right
The right side of the
histogram extends much further out than the left