0% found this document useful (0 votes)
16 views49 pages

2.descriptive Statistics

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views49 pages

2.descriptive Statistics

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 49

Descriptive Statistics

Class content

In this class:
•The central tendency
•The variation
•The shape
Descriptive Statistics

 THE CENTRAL TENDENCY is the extent to which all the data values
group around a typical or central value.

 THE VARIATION is the amount of dispersion or scattering of values

 THE SHAPE is the pattern of the distribution of values from the lowest
value to the highest value.
Measures of Central Tendency:
The Mean

THE ARITHMETIC MEAN (often just called the “mean”) is the most
common measure of central tendency
For a sample of size n:

The ith value


Pronounced x-bar
n

X i
X1  X 2    Xn
X i 1

n n
Sample size Observed values
Measures of Central Tendency:
The Mean (cont.)
• The most common measure of central tendency
• Mean = sum of values divided by the number of values
• Affected by extreme values (outliers)
11 12 13 14 15 16 17 18 19 20 11 12 13 14 15 16 17 18 19 20

Mean = 13 Mean = 14
11  12  13  14  15 65 11  12  13  14  20 70
 13  14
5 5 5 5
Measures of Central Tendency:
The Median
In an ordered array, THE MEDIAN is the “middle” number
(50% above, 50% below)

11 12 13 14 15 16 17 18 19 20 11 12 13 14 15 16 17 18 19 20

Median = 13 Median = 13

Not affected by extreme values


Measures of Central Tendency:
Location of the Median
The location of the median when the values are in numerical order
(smallest to largest):

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
Note that is not the value of the median, only the position of
2
the median in the ranked data
Measures of Central Tendency:
The Mode
• Value that occurs most often
• Not affected by extreme values
• Used for either numerical or categorical (nominal) 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

Mode = 9 No Mode
Measures of Central Tendency:
Review Examples

House Prices:  Mean: ($3,000,000/5)


$2,000,000
= $600,000
$ 500,000
$ 300,000  Median: middle value of ranked data
$ 100,000 = $300,000
$ 100,000  Mode: most frequent value
Sum $ 3,000,000 = $100,000
Measures of Central Tendency:
Which Measure to Choose?

 THE MEAN is generally used, unless extreme values


(outliers) exist.
 THE MEDIAN is often used, since the median is not
sensitive to extreme values. For example, median home
prices may be reported for a region; it is less sensitive to
outliers.
 In some situations it makes sense to report both the mean
and the median.
Measures of Central Tendency:
Summary
Central Tendency

Arithmetic Median Mode


Mean
n

X i
X  i1 Middle value in Most frequently
n
the ordered array observed value
Measures of Variation

Variation

Range Variance Standard Coefficient of


Variation
Deviation

 Measures of variation give


information on the spread
or variability or dispersion
of the data values.

Same center,
different variation
Measures of Variation:
The Range
 Simplest measure of variation
 Difference between the largest and the smallest values:

Range = Xlargest – Xsmallest


Example:

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

Range = 13 - 1 = 12
Measures of Variation:
Why The Range Can Be Misleading
 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
Measures of Variation:
The Sample Variance

Low variation: more points close to the mean


High variation: more points far from the mean

So, measure the distance to the mean


Measures of Variation:
The Sample Variance
• Average (approximately) of squared deviations of values from
the mean n

• Sample variance:
2
 (X i  X) 2

S  i 1
n -1
Where X = arithmetic mean
n = sample size
Xi = ith value of the
variable X
Measures of Variation:
The Sample Standard Deviation
• Most commonly used measure of variation
• Shows variation about the mean
• Is the square root of the variance
• Has the same units as the original data
n
• Sample standard deviation:  (X i  X) 2

S i1
n -1
Measures of Variation:
Comparing Standard Deviations
Smaller standard deviation

Larger standard deviation


Locating Extreme Outliers:
Z-Score
X X
Z
S
For a bell-shape (Normal) distribution,
|Z| < 1 for 68% of data
|Z| < 2 for 95% of data
|Z| < 3 for 99.7% of data
So, values X with large |Z| can be outliers.
Locating Extreme Outliers:
Z-Score
 Suppose the mean math SAT score is 490, with a standard
deviation of 100.
 Compute the Z-score for a test score of 620.
X  X 620  490 130
Z   1.3
S 100 100

A score of 620 is 1.3 standard deviations above the mean and


would not be considered an outlier.
General Descriptive Stats Using
Microsoft Excel Functions
House Prices Descriptive Statistics
$ 2,000,000 Mean $ 600,000 =AVERAGE(A2:A6)
$ 500,000 Standard Error $ 357,770.88 =D6/SQRT(D14)
$ 300,000 Median $ 300,000 =MEDIAN(A2:A6)
$ 100,000 Mode $ 100,000.00 =MODE(A2:A6)
$ 100,000 Standard Deviation $ 800,000 =STDEV(A2:A6)
Sample Variance 640,000,000,000 =VAR(A2:A6)
Kurtosis 4.1301 =KURT(A2:A6)
Skewness 2.0068 =SKEW(A2:A6)
Range $ 1,900,000 =D12 - D11
Minimum $ 100,000 =MIN(A2:A6)
Maximum $ 2,000,000 =MAX(A2:A6)
Sum $ 3,000,000 =SUM(A2:A6)
Count 5 =COUNT(A2:A6)
General Descriptive Stats Using
Microsoft Excel Data Analysis Tool
1. Select Data.
2. Select Data Analysis.
3. Select Descriptive
Statistics and click OK.
General Descriptive Stats Using
Microsoft Excel

4. Enter the cell


range.
5. Check the
Summary
Statistics box.
6. Click OK
Excel output

Microsoft Excel House Prices

descriptive statistics output, Mean 600000


using the house price data: Standard Error 357770.8764
Median 300000
House Prices: Mode 100000
Standard Deviation 800000
Sample Variance 640,000,000,000
$2,000,000 Kurtosis 4.1301
500,000 Skewness 2.0068
300,000 Range 1900000
Minimum 100000
100,000 Maximum 2000000
100,000 Sum 3000000
Count 5
Numerical Descriptive Measures for a
Population

 Descriptive statistics discussed previously described a sample, not the


population.

 Summary measures describing a population, called parameters, are denoted


with Greek letters.

 Important population parameters are the population mean, variance, and


standard deviation.
Numerical Descriptive Measures
for a Population: The mean µ
 The population mean is the sum of the values in the population divided
by the population size, N

X i
X1  X 2    XN
 i 1

N N
Where μ = population mean
N = population size
Xi = ith value of the variable X
Numerical Descriptive Measures For A
Population: The Variance σ2

 Average of squared deviations of values from the mean


N

 Population variance:
2
 (X i  μ) 2

σ  i 1
N
Where μ = population mean
N = population size
Xi = ith value of the variable X
Numerical Descriptive Measures For A
Population: The Standard Deviation σ
 Most commonly used measure of variation
 Shows variation about the mean
 Is the square root of the population variance
 Has the same units as the original data

 Population standard deviation:  (X i  μ) 2

σ i 1
N
Sample statistics versus population
parameters

Measure Population Sample


Parameter Statistic
Mean
 X
Variance
2 S2
Standard  S
Deviation
Quartiles

 Quartiles split the ranked data into 4 segments with an equal number of
values per segment

25% 25% 25% 25%

Q1 Q2 Q3
 The first quartile, Q1, is the value for which 25% of the observations are
smaller and 75% are larger
 Q2 is the same as the median (50% of the observations are smaller and
50% are larger)
 Only 25% of the observations are greater than the third quartile
Quartiles: Locating Quartiles

 Find a quartile by determining the value in the appropriate


position in the ranked data,
 where
• First quartile position: Q1 = (n+1)/4 ranked value

• Second quartile position: Q2 = (n+1)/2 ranked value

• Third quartile position: Q3 = 3(n+1)/4 ranked value

where n is the number of observed values


Quartiles: Calculation Rules

 When calculating the ranked position use the following rules


• If the result is a whole number then it is the ranked position to use
• If the result is a fractional half (e.g. 2.5, 7.5, 8.5, etc.) then average the
two corresponding data values.

• If the result is not a whole number or a fractional half then round the
result to the nearest integer to find the ranked position.
Quartile Measures
Calculating The Quartiles: Example
Sample Data in Ordered Array: 11 12 13 16 16 17 18 21 22
(n = 9)
Q1 is in the (9+1)/4 = 2.5 position of the ranked data,
so Q1 = (12+13)/2 = 12.5
Q2 is in the (9+1)/2 = 5th position of the ranked data,
so Q2 = median = 16
Q3 is in the 3(9+1)/4 = 7.5 position of the ranked data,
so Q3 = (18+21)/2 = 19.5

Q1 and Q3 are measures of non-central location


Q2 = median, is a measure of central tendency
Interquartile Range (IQR)

• The IQR is Q3 – Q1 and measures the spread in the middle 50% of the data

• The IQR is also called the mid-spread because it covers the middle 50% of
the data

• The IQR is a measure of variability that is not influenced by outliers or


extreme values

• Measures like Q1, Q3, and IQR that are not influenced by outliers are called
resistant measures
Calculating The Interquartile Range

Example:

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

12 30 45 57
70

Interquartile range
= 57 – 30 = 27
The Five-Number Summary

• The five numbers that help describe the center, spread and shape
of data are:
•X smallest

• First Quartile (Q1)


• Median (Q2)
• Third Quartile (Q3)
•X largest
Five Number Summary:
Shape of Boxplots
• If data are symmetric around the median then the box and central line
are centered between the endpoints

Xsmallest Q1 Median Q3 Xlargest

• A Boxplot can be shown in either a vertical or horizontal orientation


Distribution Shape and The Boxplot

Left-Skewed Symmetric Right-Skewed

Q1 Q2 Q3 Q1 Q2 Q3 Q1 Q2 Q3
Measures Of The Relationship Between
Two Numerical Variables

• Scatter plots allow you to visually examine the relationship


between two numerical variables and now we will discuss two
quantitative measures of such relationships.

• THE COVARIANCE
• THE COEFFICIENT OF CORRELATION
The Covariance

• The covariance measures the strength of the linear relationship


between two numerical variables (X & Y)
• The sample covariance:
n

 (X i  X )(Yi  Y )
cov( X , Y )  i 1
n 1

• Only concerned with the strength of the relationship


• No causal effect is implied
Interpreting Covariance

• COVARIANCE between two variables:


cov(X,Y) > 0 X and Y tend to move in the
same direction

cov(X,Y) < 0 X and Y tend to move in


opposite directions

cov(X,Y) = 0 X and Y are independent

• The covariance has a major flaw:


• It is not possible to determine the relative strength of the relationship
Coefficient of Correlation

• Measures the relative strength of the linear relationship between


two numerical variables
• SAMPLE COEFFICIENT OF CORRELATION:
cov (X , Y)
r
where SX SY

n n n
 (X  X)(Y  Y)
i i  (X  X)
i
2
 (Y  Y )
i
2

cov (X , Y)  i1 SX  i1


SY  i1
n 1 n 1 n 1
Features of
The Coefficient of Correlation
• The population coefficient of correlation is referred as ρ.
• The sample coefficient of correlation is referred to as r.
• Either ρ or r have the following features:
• Unit free
• Ranges between –1 and 1
• The closer to –1, the stronger the negative linear relationship
• The closer to 1, the stronger the positive linear relationship
• The closer to 0, the weaker the linear relationship
Scatter Plots of Sample Data with
Various Coefficients of Correlation
Y Y

X X
r = -1 r = -.6
Y
Y Y

X X X
r = +1 r = +.3 r=0
The Coefficient of Correlation Using
Microsoft Excel Function
Test #1 Score Test #2 Score Correlation Coefficient
78 82 0.7332 =CORREL(A2:A11,B2:B11)
92 88
86 91
83 90
95 92
85 85
91 89
76 81
88 96
79 77
The Coefficient of Correlation Using
Microsoft Excel Data Analysis Tool
1. Select Data
2. Choose Data Analysis
3. Choose Correlation &
Click OK
The Coefficient of Correlation
Using Microsoft Excel
Excel function: =correl
Or use the Data
Analysis Tool,
“covariance” and
“correlation”.

4. Input data range and select


appropriate options
5. Click OK to get output
Mentor: PhD. s. Shaig E.Kazimov

Thank you
for your
attention

You might also like