03 Numerical Description FULL

Download as pdf or txt
Download as pdf or txt
You are on page 1of 51

Describing Data:

Numerical

Prof. David Moreno Vincent

Facultad de
Ciencias Jurídicas y Sociales
Chapter Topics

• Measures of central tendency, variation, and shape


• Mean, median, mode, geometric mean
• Quartiles
• Range, interquartile range, variance and standard deviation,
coefficient of variation
• Symmetric and skewed distributions
• Population summary measures
• Mean, variance, and standard deviation
• The empirical rule and Bienaymé-Chebyshev rule
Chapter Topics
(continued)
• Five number summary and box-and-whisker plots
• Covariance and coefficient of correlation
• Pitfalls in numerical descriptive measures and ethical
considerations
Describing Data Numerically

Describing Data Numerically

Central Tendency Variation

Arithmetic Mean Range

Median Interquartile Range

Mode Variance

Standard Deviation

Coefficient of Variation
Measures of Central Tendency

Overview
Central Tendency

Mean Median Mode

åx i
x= i=1
n
Arithmetic Midpoint of Most frequently
average ranked values observed value
Arithmetic Mean

• The arithmetic mean (mean) is the most common


measure of central tendency

• For a sample of size n:

åx i
x1 + x 2 + ! + x n Observed
x= i=1
= values
n n
Sample size
Characteristics of the Arithmetic Mean

• The sum of the deviations of the values of the variable with


respect to its mean is zero.

• If we add a constant “K” to all the values of a variable, the


arithmetic mean is also increased by that constant.

• If all the values of a variable are multiplied by a constant


"k", its arithmetic mean is multiplied by the same constant.

• If from a set of values we obtain two or more disjoint sets,


the arithmetic mean of the whole set is related to all the
arithmetic means of the different disjoint subsets.

Sonia de Paz Cobo


Advantages of the arithmetic mean

• No calculation problems
• All sample data involved
• It has a simple and clear interpretation
• It is unique for each sample

Sonia de Paz Cobo


Arithmetic Mean

• The most common measure of central tendency


• Mean = sum of values divided by the number of values
• Affected by extreme values (outliers)
• Sensible to sampling fluctuations

0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10

Mean = 3 Mean = 4

1 + 2 + 3 + 4 + 5 15 1 + 2 + 3 + 4 + 10 20
= =3 = =4
5 5 5 5
Approximations for Grouped Data

• Suppose a data set contains values m1, m2, . . ., mk,


occurring with frequencies f1, f2, . . . fK

• For a sample of n observations, the mean is

åfm i i
K
where n = å fi
x= i=1 i=1

n
Weighted Mean

• The weighted mean of a set of data is

å w x w x + w x +!+ w x
i i
x= i=1
= 1 1 2 2 n n

• Whereå
wi is the weight of theå
w w
ith observation
i

• Use when data is already grouped into n classes, with


wi values in the ith class
Geometric Mean “G”

n
G= N n1 ×
x x
1
n2 × × ×
2
nn =
xn N
Õx
i =1
ni
i

• Quantitative variables
• Suitable for averaging rates and percentages
Geometric Mean

ADVANTAGES:
• It is unique for each sample
• It uses all sample data
• It is less sensitive than the arithmetic mean to sampling
fluctuations.

DISADVANTAGES:
• It’s statistical significance is less intuitive than the
arithmetic mean.
• Its computation is (way) more difficult.
• Sometimes it cannot be determined (for example, if the
variable takes the value 0 or if it takes negative values)
Geometric Mean Example:

A company has produced in 2020 21% more than in 2019


And it has produced in 2021 28% more than in 2020.

Is its average increase in production (21 + 28)/2 = 24,5% ?

Let's see:

Year 2019: 100


Year 2020: 100 * 1,21 121
Year 2021: 121 * 1,28 154,88

Should the "average" be 24,5%, in 2021 the total production should be:

(100 * 1,245) * 1,245 = 155,0025


The correct result:

154,88 = 100 * (1 + avg) * (1 + avg)

154,88 = 100 * (1 + avg) ^2

SQR (1,5488) - 1 = G

G= 0,24450793
Harmonic Mean “H”

N N
H= =
1 1 1 n
1
n+ n + ××× + n å n
x 1
1
x 2
2
x n
n
x
i =1 i
i

• Quantitative variables
• Suitable for averaging returns
Harmonic Mean “H”

ADVANTAGES:
• It is unique for each sample
• Uses all sample data

DISADVANTAGES:
• has no clear statistical significance
• It can present calculation problems: it is very affected
by small values.
• Cannot be calculated when there is any 0 in the
sample
Median

• In an ordered list, the median is the “middle” number


(50% above, 50% below)

0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10

Median = 3 Median = 3

• Unique for each sample


• Easy to compute
• Is statistically very clear
• Not affected by extreme values
• It, however, does not use all the available information
Finding the Median

• The location of the median:

n +1
Median position = position in the ordered data
2

• If the number of values is odd, the median is the middle


number
• If the number of values is even, the median is the average of
the two middle numbers
n +1
2
• Note that is not the value of the median, only the
position of the median in the ranked data
Mode

• A measure of central tendency


• Value that occurs most often
• Not affected by extreme values
• Used for either numerical or categorical data
• There may be no mode
• There may be several modes

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 1 2 3 4 5 6

No Mode
Mode = 9
Review Example

• Five houses on a hill by the beach


$2,000 K
House Prices:

$2,000,000
500,000 $500 K
300,000 $300 K
100,000
100,000

$100 K

$100 K
Review Example: Summary Statistics

House Prices:
• Mean: ($3,000,000/5)
$2,000,000 = $600,000
500,000
300,000
100,000
100,000
• Median: middle value of ranked data
= $300,000
Sum 3,000,000

• Mode: most frequent value


= $100,000
Which measure of location
is the “best”?

• Mean is generally used, unless extreme


values (outliers) exist
• Then median is often used, since the
median is not sensitive to extreme
values.
• Example: Median home prices may be
reported for a region – less sensitive to
outliers
Shape of a Distribution

• Describes how data are distributed


• Measures of shape
• Symmetric or skewed

Left-Skewed Symmetric Right-Skewed


Mean < Median Mean = Median Median < Mean
Measures of Variability

Variation

Range Interquartile Variance Standard Coefficient of


Range Deviation Variation

n Measures of variation give


information on the spread
or variability of the data
values.

Same center,
different variation
Range

• Simplest measure of variation


• Difference between the largest and the smallest
observations:

Range = Xlargest – Xsmallest


Example:

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

Range = 14 - 1 = 13
Disadvantages of the Range

• Ignores the way in which data are distributed

7 8 9 10 11 12 7 8 9 10 11 12
Range = 12 - 7 = 5 Range = 12 - 7 = 5

• Sensitive to outliers

1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,4,5

Range = 5 - 1 = 4

1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,4,120

Range = 120 - 1 = 119


Interquartile Range

• Can eliminate some outlier problems by using the


interquartile range

• Eliminate high- and low-valued observations and


calculate the range of the middle 50% of the data

• Interquartile range = 3rd quartile – 1st quartile

• IQR = Q3 – Q1
Interquartile Range

Example:
Median X
X Q1 Q3
(Q2) maximum
minimum
25% 25% 25% 25%

12 30 45 57 70

Interquartile range
= 57 – 30 = 27
Quartiles

• Quartiles split the ranked data into 4 segments with an


equal number of values per segment

25% 25% 25% 25%

Q1 Q2 Q3

n The first quartile, Q1, is the value for which 25% of the
observations are smaller and 75% are larger
n Q2 is the same as the median (50% are smaller, 50% are
larger)
n Only 25% of the observations are greater than the third
quartile
Quartile Formulas

Find a quartile by determining the value in the


appropriate position in the ranked data, where
First quartile position: Q1 = 0.25(n+1)

Second quartile position: Q2 = 0.50(n+1)


(the median position)

Third quartile position: Q3 = 0.75(n+1)

where n is the number of observed values


Quartiles

n Example: Find the first quartile


Sample Ranked Data: 11 12 13 16 16 17 18 21 22

(n = 9)
Q1 = is in the 0.25(9+1) = 2.5 position of the ranked data
so use the value half way between the 2nd and 3rd values,

so Q1 = 12.5
Variance

• Average of squared deviations of values from the


mean

å ( x - x)
n 2
i ni
s =2 i =1

Where X= arithmetic mean


n = sample size
Xi = ith value of the variable X
Standard Deviation

• Most commonly used measure of variation


• Shows variation about the mean
• Has the same units as the original data

• Sample standard deviation:

n
ni
= å ( xi - x)
2
S= s =
2

i =1 N
Calculation Example: Standard Deviation

Sample
Data (xi) : 10 12 14 15 17 18 18 24

n=8 Mean = x = 16

(10 - X)2 + (12 - x)2 + (14 - x)2 + ! + (24 - x)2


s=
n -1

(10 - 16)2 + (12 - 16)2 + (14 - 16)2 + ! + (24 - 16)2


=
8 -1

A measure of the “average” scatter


126
= = 3,96862
4.2426 around the mean
8
7
Measuring variation

Small standard deviation

Large standard deviation


Comparing Standard Deviations

Data A
Mean = 15.5

11 12 13 14 15 16 17 18 19 20 21
s = 3.338

Data B
Mean = 15.5
11 12 13 14 15 16 17 18 19 20 21 s = 0.926

Data C
Mean = 15.5

11 12 13 14 15 16 17 18 19 20 21 s = 4.570
Advantages of Variance and Standard Deviation

• Each value in the data set is used in the calculation

• Values far from the mean are given extra weight


(because deviations from the mean are squared)
Chebyshev’s Theorem

For any population with mean μ and standard deviation


σ , and k > 1 , the percentage of observations that fall
within the interval
[μ + kσ]
Is at least

100[1 - (1/k )]%


2
Chebyshev’s Theorem

Regardless of how data are distributed, at least (1 -


1/k2) of the values will fall within k standard deviations
of the mean (for k > 1)
• Examples:

At least within

(1 - 1/12) = 0% ……..... k=1 (μ ± 1σ)


(1 - 1/22) = 75% …........ k=2 (μ ± 2σ)
(1 - 1/32) = 89% ………. k=3 (μ ± 3σ)
The Empirical Rule

If the data distribution is bell-shaped, then the interval:


contains about 68% of the values in
the population or the sample

μ ± 1σ

68%

μ
μ ± 1σ
contains about 95% of the values in
μ ± 2σ the population or the sample
contains about 99.7% of the values
μ ± 3σ in the population or the sample

95% 99.7%

μ ± 2σ μ ± 3σ
Coefficient of Variation

• Measures relative variation


• Shows variation relative to mean
• Can be used to compare two or more sets of data
measured in different units

æ sö
CV = çç ÷÷ × 100%
èx ø
Comparing Coefficient of Variation

• Stock A:
• Average price last year = $50
• Standard deviation = $5
æs ö $5
CVA = çç ÷÷ ×100% = ×100% = 10%
èx ø $50
• Stock B:
Both stocks have
• Average price last year = $100 the same
• Standard deviation = $5 standard
deviation, but
stock B is less
variable relative
to its price
æs ö $5
CVB = çç ÷÷ ×100% = ×100% = 5%
èx ø $100
Moments re. Mean

n
ni
mr = å ( xi - x)r

i =1 N
n n
0 ni ni N
m0 = å
i =1
( xi - x)
N
= å
i =1 N
=
N
=1

n
n n
n n
n N
m1 = å å å i
( xi - x) = i =1 xi N x i =1
- = x-x = x-x =0
1 i i
N
i =1 N N
n
ni
m2 = å
2
( xi - x)2
=S
i =1 N
Form analysis: Assymmetry and Kurtosis

Form measures are indicators of the way in which


sample date are distributed

Assymetry:
Mean < Median Mean = Median Median < Mean

Kurtosis:
x

x
Assymmetry measures

• Coefficients of assymmetry of PEARSON:


x - Mo 3( x - Me)
Ap = =
S S

• Coefficient of assymmetry of FISHER:

∑%#$! " 𝑛#
𝑚" 𝑥# − 𝑥̅
𝑔! = " = 𝑁
𝑆 "'
∑%#$! 𝑥# − 𝑥̅ & 𝑛# &
𝑁
Assymmetry measures

Symmetric: g1 = 0 = Ap

Assymmetric
positive: Ap = g1 > 0

Assymmetric Ap = g1 < 0
negative:
Kurtosis

• It measures the sharpness of the peak of a frequency-


distribution curve.

• It cannot be measured directly, so it is a measure of


comparison.

• It is therefore measured comparing the shape against


a ”Normal” distribution.
Coefficient of Kurtosis

m4
g2 = 4 - 3
S
• Because, in a Normal distribution:

!
𝑚! = 3𝑆
Coefficient of Kurtosis

• Therefore, the distribution will be:

𝑔! = 0 MESOKURTIC (NORMAL)

𝑔! > 0 LEPTOKURTIC

𝑔! < 0 MESOKURTIC

You might also like