Upload
rona
View
82
Download
0
Embed Size (px)
DESCRIPTION
Summarizing Quantitative Data. MATH171 - Honors. Top 10 causes of death in the U.S., 2001. Bar graph sorted by rank Easy to analyze. Sorted alphabetically Much less useful. Ways to chart quantitative data. Histograms and stemplots - PowerPoint PPT Presentation
Citation preview
Summarizing Quantitative Data
MATH171 - Honors
0100200300400500600700800
Cou
nts
(x10
00)
Bar graph sorted by rank Easy to analyze
Top 10 causes of death in the U.S., 2001
0100200300400500600700800
Cou
nts
(x10
00)
Sorted alphabetically Much less useful
Ways to chart quantitative data
• Histograms and stemplotsThese are summary graphs for a single variable. They are very useful to understand the pattern of variability in the data.
• Line graphs: time plotsUse when there is a meaningful sequence, like time. The line connecting the points helps emphasize any change over time.
• Other graphs to reflect numerical summaries - boxplots
An Example• Suppose we want to determine the following:
– What percent of all fifth grade students in our district have an IQ score of at least 120?– What is the average IQ score of all fifth grade students in our district?
• It is too expensive to give an IQ test to all fifth grade students in our district.
• Below are the IQ test scores from 60 randomly chosen fifth graders in our district. (Individuals (subjects)?, Variable(s)?)
Previews of Coming Attractions!• We are interested in questions about a population (all fifth grade students
in our district).• We want to know the percent (or proportion) of the population in a
particular category (IQ score of at least 120) and the average value of a variable for the population (average IQ score).
• We have taken a random sample from the population.• Eventually we will use the data from the sample to infer about the
population. (Inferential Statistics)• For now we will describe the data in the sample. (Descriptive Statistics)
– We will graphically represent the IQ scores for our sample (histogram & stem and leaf)
– We will find the percent of students in our sample with an average IQ score of at least 120 and understand how that percent relates to the graph.
– Later (Chapter 2) we will also be able to describe the data with numerical summaries and other types of plots (boxplots)
StemplotsHow to make a stemplot:
1) Separate each observation into a stem, consisting of all but the final (rightmost) digit, and a leaf, which is that remaining final digit. Stems may have as many digits as needed, but each leaf contains only a single digit.
2) Write the stems in a vertical column with the smallest value at the top, and draw a vertical line at the right of this column.
3) Write each leaf in the row to the right of its stem, in increasing order out from the stem.
Let’s try it with this data: 9, 9, 22, 32, 33, 39, 39, 42, 49, 52, 58, 70
STEM LEAVES
Now Let’s Make a Stemplot for Our IQ Data
Stem & Leaf Plot for IQ Data• IQ Test Scores for 60 Randomly
Chosen 5th Grade Students
Stem and Leaf plot for IQ Scores
stem unit = 10
leaf unit = 1
Frequency Stem Leaf
3 8 1 2 9
4 9 0 4 6 7
14 10 0 1 1 1 2 2 2 3 5 6 8 9 9 9
17 11 0 0 0 2 2 3 3 4 4 4 5 6 7 7 7 8 8
11 12 2 2 3 4 4 4 5 6 7 7 8
9 13 0 1 3 4 4 6 7 9 9
2 14 2 5
60
Now Let’s Make a Histogram• Use the Same IQ Data• We will start by hand….using class (bin) widths of 10
starting at 80…• What shall we put on the y-axis: count or percent?• Compare the histogram to the stemplot we graphed
earlier!IQ Scores of Randomly Chosen Fifth Grade Students
0
5
10
15
20
25
30
80
90
100
110
120
130
140
150
IQ Score
Per
cent
What is the meaning of this bar?Percent of
What?
• What percent of the 60 randomly chosen fifth grade students have an IQ score of at least 120?– Numerically?
– How to Represent Graphically?
Back to Our Question:
18.3%+15%+3.3%=36.6%
(11+9+2)/60=.367 or 36.7%
Grey Shaded Region corresponds to the 36.6% of students
What is Different Fromthe Histogram we Generated
In Class?
Another Histogram of the IQ Data!
How to create a histogramIt is an iterative process—try and try again.
What bin (class) size should you use?
• Not too many bins with either 0 or 1 counts
• Not overly summarized that you lose all the information
• Not so detailed that it is no longer summary
Rule of thumb: Start with 5 to10 bins.
Look at the distribution and refine your bins.
(There isn’t a unique or “perfect” solution.)
Not summarized enough
Too summarized
Same data set
GOAL: Capture Overall Pattern
Interpreting histogramsWhen describing a quantitative variable, we look for the overall pattern and for
striking deviations from that pattern. We can describe the overall pattern of a
histogram by its shape, center, and spread.
Histogram with a line connecting each column too detailed
Histogram with a smoothed curve highlighting the overall pattern of the
distribution
Most common distribution shapes (p123)
A distribution is symmetric if the right and left sides of the histogram are approximately mirror images of each other.
Symmetric distribution
Complex, multimodal distribution
Not all distributions have a simple overall shape, especially when there are few observations.
Skewed distribution
A distribution is skewed to the right if the right side of the histogram (side with larger values) extends much farther out than the left side. It is skewed to the left if the left side of the histogram extends much farther out than the right side.
Alaska Florida
OutliersAn important kind of deviation is an outlier. Outliers are observations that lie outside the overall pattern of a distribution. Always look for outliers and try to explain them.
The overall pattern is fairly symmetric except for two states clearly not belonging to the main trend. Alaska and Florida have unusual representation of the elderly in their population.
A large gap in the distribution is typically a sign of an outlier.
IMPORTANT NOTE:
Your data are the way they are.
Do not try to force them into a
particular shape.
It is a common misconception that
if you have a large enough data
set, the data will eventually turn
out nice and symmetric.
Describing distributions with numbers
• Measures of center: mean and median (Topic 8)
• Measures of spread: quartiles and standard deviation (Topic 9)
• The five-number summary and boxplots (Topic 10)
• IQR and outliers (Topic 10)
• Choosing among summary statistics
• Using technology
The mean or arithmetic average
The data to the right are heights (in
inches) of 25 women. How would you
calculate the average, or mean, height
of these 25 women?
Sum of heights is 1598.3Divided by 25 women = 63.9 inches
58.2 64.059.5 64.560.7 64.160.9 64.861.9 65.261.9 65.762.2 66.262.2 66.762.4 67.162.9 67.863.9 68.963.1 69.663.9
Measure of center: the mean (p 145)
The mean
1 2 .... nx x xxn
1598.3 63.925
x
Mathematical notation:
1
1 n
ii
x xn
woman(i)
hei ght(x)
woman(i)
hei ght(x)
i = 1 x1= 58.2 i = 14 x14= 64.0
i = 2 x2= 59.5 i = 15 x15= 64.5
i = 3 x3= 60.7 i = 16 x16= 64.1
i = 4 x4= 60.9 i = 17 x17= 64.8
i = 5 x5= 61.9 i = 18 x18= 65.2
i = 6 x6= 61.9 i = 19 x19= 65.7
i = 7 x7= 62.2 i = 20 x20= 66.2
i = 8 x8= 62.2 i = 21 x21= 66.7
i = 9 x9= 62.4 i = 22 x22= 67.1
i = 10 x10= 62.9 i = 23 x23= 67.8
i = 11 x11= 63.9 i = 24 x24= 68.9
i = 12 x12= 63.1 i = 25 x25= 69.6
i = 13 x13= 63.9 n =25 S=1598.3
Let’s try an example with fewer numbers….Dr. L’s Test Score Data…
The mean or arithmetic average
Consider the following sample of test scores from one of Dr. L.’s recent classes (max score = 100):
65, 65, 70, 75, 78, 80, 83, 87, 91, 94
What is the mean score?
78.8
Measure of center: the mean
The Mean as a Center of Mass
• What happens when we average two numbers? What does the mean tell us?
• Let’s draw both a dot plot and a stem and leaf plot of the test score data and look at where the mean falls…
65, 65, 70, 75, 78, 80, 83, 87, 91, 94
Measure of center: the median (p145)The median is the midpoint of a distribution—the number such that half of the observations are smaller and half are larger.
1. Sort observations from smallest to largest.n = number of observations
______________________________
1 1 0.62 2 1.23 3 1.64 4 1.95 5 1.56 6 2.17 7 2.38 8 2.39 9 2.5
10 10 2.811 11 2.912 3.313 3.414 1 3.615 2 3.716 3 3.817 4 3.918 5 4.119 6 4.220 7 4.521 8 4.722 9 4.923 10 5.324 11 5.6
n = 24 n/2 = 12
Median = (3.3+3.4) /2 = 3.35
3. If n is even, the median is the mean of the two center observations
1 1 0.62 2 1.23 3 1.64 4 1.95 5 1.56 6 2.17 7 2.38 8 2.39 9 2.5
10 10 2.811 11 2.912 12 3.313 3.414 1 3.615 2 3.716 3 3.817 4 3.918 5 4.119 6 4.220 7 4.521 8 4.722 9 4.923 10 5.324 11 5.625 12 6.1
n = 25 (n+1)/2 = 26/2 = 13 Median = 3.4
2. If n is odd, the median is observation (n+1)/2 down the list
Back to our test score example:
Consider the following sample of test scores from one of Dr. L.’s recent classes (max score = 100):
65, 65, 70, 75, 78, 80, 83, 87, 91, 94
What is the median score?
79
Measure of center: the median
Comparing the Mean & Median• Test Scores: 65, 65, 70, 75, 78, 80, 83, 87, 91, 94 • Let’s Use our TI-83 Calculators to Find the Mean & Median!
– Enter data into a list via Stat|Edit– Use Stat|Calc|1-Var Stats
• What happens to the Mean and Median if the lowest score was 20 instead of 65?
• What happens to the Mean and Median if a low score of 20 is added to the data set (so we would now have 11 data points?)
What can we say about the Mean versus the Median?
Mean and median for skewed distributions
Mean and median for a symmetric distribution
Left skew Right skew
MeanMedian
Mean Median
MeanMedian
Comparing the mean and the medianThe mean and the median are the similar when a distribution is symmetric.
The median is a measure of center that is resistant to skew and outliers. The
mean is not.
The median, on the other hand, is
only slightly pulled to the right by
the outliers (from 3.4 to 3.6).
The mean is pulled to the right by
the outliers high outliers
(from 3.4 to 4.2).
P
erce
nt o
f peo
ple
dyin
g
Mean and median of a distribution with outliers
4.3x
Without the outliers
2.4x
With the outliers
Disease X:
Mean and median have similar values
Mean and median of a symmetric distribution
4.34.3
Mx
Multiple myeloma:5.2
4.3
Mx
and a right-skewed distribution
The mean is pulled toward the skew.
Impact of skewed data
M = median = 3.4
Q1= first quartile = 2.2
Q3= third quartile = 4.35
1 1 0.62 2 1.23 3 1.64 4 1.95 5 1.56 6 2.17 7 2.38 1 2.39 2 2.5
10 3 2.811 4 2.912 5 3.313 3.414 1 3.615 2 3.716 3 3.817 4 3.918 5 4.119 6 4.220 7 4.521 1 4.722 2 4.923 3 5.324 4 5.625 5 6.1
Measure of spread: quartiles
The first quartile, Q1, is the value in the
sample that has 25% of the data at or
below it.
The third quartile, Q3, is the value in the
sample that has 75% of the data at or
below it.
The Five Number Summary
The Boxplot (p 191)
• A graphical representation of the five number summary.
M = median = 3.4
Q3= third quartile = 4.35
Q1= first quartile = 2.2
25 6 6.124 5 5.623 4 5.322 3 4.921 2 4.720 1 4.519 6 4.218 5 4.117 4 3.916 3 3.815 2 3.714 1 3.613 3.412 6 3.311 5 2.910 4 2.89 3 2.58 2 2.37 1 2.36 6 2.15 5 1.54 4 1.93 3 1.62 2 1.21 1 0.6
Largest = max = 6.1
Smallest = min = 0.6
Disease X0
1
2
3
4
5
6
7
Year
s un
til d
eath
A relatively symmetric data set
Center and spread in boxplots
Boxplots for skewed dataBoxplots remain true to the data and clearly depict symmetry or skewness.
Which boxplot is of the data in the top histogram? In the bottom histogram?
0 2 4 6 8 10 12 14 16
Years Until Death
0 2 4 6 8 10 12 14 16
Years Until Death
IQR and outliers (p192)The interquartile range (IQR) is the distance between the first and
third quartiles (the length of the box in the boxplot)IQR = Q3 - Q1
An outlier is an individual value that falls outside the overall pattern.
• How far outside the overall pattern does a value have to fall to be considered an outlier?
• Low outlier: any value < Q1 – 1.5 IQR
• High outlier: any value > Q3 + 1.5 IQR
Let’s Find the Five Number Summary, IQR, Box Plot, and where Outliers would be for the Test Score Data:
65, 65, 70, 75, 78, 80, 83, 87, 91, 94
What do we notice about symmetry?
Measures of Spread: Standard Deviation (p170)
• Other Measures of Spread– Data Range (Max – Min)– IQR (75% Quartile minus 25% Quartile, i.e. the range of the
middle 50% of data)
Standard Deviation (Variance)– Measures how the data deviates from the mean….hmm…
how can we do this?
Computing Variance and Std. Dev. by Hand and Via the TI83:
• Recall the Sample Test Score Data:
65, 65, 70, 75, 78, 80, 83, 87, 91, 94
• Recall the Sample Mean (X bar) was 78.8• We want to measure how the data deviates from the mean
65 70 75 80 9085 95
x
65 83
78.8
-13.8 4.2
What does the number 4.2 measure? How
about -13.8?
The standard deviation is used to describe the variation around the mean.
2
1
2 )(1
1 xxn
sn
i
1) First calculate the variance s2.
2
1
)(1
1 xxn
sn
i
2) Then take the square root to get the standard deviation s.
Measure of spread: standard deviation
Calculations …
We’ll never calculate these by hand, so make sure you know how to get the standard deviation using your calculator.
2
1
1 ( )1
n
is x xn
Mean = 63.4
Sum of squared deviations from mean = 85.2
Degrees freedom (df) = (n − 1) = 13
s2 = variance = 85.2/13 = 6.55 inches squared
s = standard deviation = √6.55 = 2.56 inches
Women’s height (inches)i xi x (xi-x) (xi-x)2 1 59 63.4 −4.4 19.0
2 60 63.4 −3.4 11.3
3 61 63.4 −2.4 5.6
4 62 63.4 −1.4 1.8
5 62 63.4 −1.4 1.8
6 63 63.4 −0.4 0.1
7 63 63.4 −0.4 0.1
8 63 63.4 −0.4 0.1
9 64 63.4 0.6 0.4
10 64 63.4 0.6 0.4
11 65 63.4 1.6 2.7
12 66 63.4 2.6 7.0
13 67 63.4 3.6 13.3
14 68 63.4 4.6 21.6
Mean 63.4
Sum 0.0
Sum 85.2
Standard Deviation• On the next slide are histograms of quiz scores
(from 1 to 10) for the same class but taught by different professors.
• Sort the classes from largest to smallest based on the mean quiz score.
• Sort the classes from largest to smallest based on the standard deviation of the quiz score.
• Which professor would you want to have for this class?
Quiz Scores (Same Class, Different Professors)
Quiz Scores for Professor B's Class
05
1015202530354045
1 2 3 4 5 6 7 8 9
Quiz Score%
of S
tude
nts
Quiz Scores for Professor A's Class
05
1015202530354045
1 2 3 4 5 6 7 8 9
Quiz Score
% o
f Stu
dent
s
Quiz Scores for Professor C's Class
05
1015202530354045
1 2 3 4 5 6 7 8 9
Quiz Score
% o
f Stu
dent
s
Quiz Scores for Professor D's Class
05
1015202530354045
1 2 3 4 5 6 7 8 9
Quiz Score
% o
f Stu
dent
s
Quiz Scores for Professor E's Class
05
1015202530354045
1 2 3 4 5 6 7 8 9
Quiz Score
% o
f Stu
dent
s
Quiz Scores for Professor F's Class
05
1015202530354045
1 2 3 4 5 6 7 8 9
Quiz Score%
of S
tude
nts
Sorted by MeanProf A Prof B Prof C Prof D Prof E Prof F
Mean = 5 5 5 5 5 7
Std Dev = 2.04 3.05 2.63 3.33 3.84 1.28
Sorted by Standard DeviationProf F Prof A Prof C Prof B Prof D Prof E
Mean = 7 5 5 5 5 5
Std Dev = 1.28 2.04 2.63 3.05 3.33 3.84
Which professor would you want to take for this class?
Software output for summary statistics:
Excel—From Menu: Tools/Data Analysis/Descriptive Statistics
Give commonstatistics of your
sample data.
Minitab
Choosing among summary statistics
• Because the mean is not resistant to outliers or skew, use it to describe distributions that are fairly symmetric and don’t have outliers. Plot the mean and use the standard deviation for error bars.
• Otherwise, use the median in the five-number summary, which can be plotted as a boxplot.
Height of 30 women
585960616263646566676869
Box plot Mean +/- sd
Heig
ht in
inch
es
Box plot Mean ± s.d.
What should you use? When and why?
Arithmetic mean or median?
• Middletown is considering imposing an income tax on citizens. City hall wants a numerical summary of its citizens’ incomes to estimate the total tax base.
• In a study of standard of living of typical families in Middletown, a sociologist makes a numerical summary of family income in that city.
Mean: Although income is likely to be right-skewed, the city government wants to know about the total tax base. (Note: What is the mean multiplied by the number of citizens?)
Median: The sociologist is interested in a “typical” family and wants to lessen the impact of extreme incomes.