You are on page 1of 43

Session 2

Introduction to descriptive
analysis and mean comparison
Central Measures

Summary Measures

Central Tendency

Mean Mode
Median
The most frequently
occurring value in a set
Average of the group of data
of numbers
Middle value in an
ordered array of
numbers
0
Mean (Arithmetic Mean)

• The most common measure of


central tendency
• Affected by extreme values (outliers)
• Defined by:

0
Mean (Arithmetic Mean)
• Mean (arithmetic mean) of data values
– Sample mean
Sample Size

– Population mean
Population Size

0
Median
• Step 1: Calculate the position i (Where?)

n = # of data points

• Step 2: Calculate the value (How much?)


– If i is whole number, the VALUE of the median is the average of Xi and
Xi +1

– If i is not a whole number, round UP i to the next number and the


VALUE of the median is Xi UP

0
Median
• Example 1:
Ordered array: 21, 33, 37, 42

• Step 1: Calculate the position i

• Step 2: Calculate the value


– If i is whole number, the VALUE of the median is the average of Xi and
Xi +1

0
Median
• Example 2:
Ordered array: 21, 33, 37, 42, 48

• Step 1: Calculate the position i

• Step 2: Calculate the value


– If i is not a whole number, round UP i to the next number and the
VALUE of the median is Xi UP

0
Mode
• Value that occurs most often
• A measure of central tendency
• Not affected by extreme values
• Used for either numerical or categorical data
• There may be no mode
• There may be several modes

Examples: Data in 2 ordered arrays:

0.4 0.8 1 1 1 0.8 0.8 0.8 0.8 1


1 1 1.2 1.2 1.25 1 1 1 1.25 1.25
1.35 1.5 1.8 1.85 1.9 1.25 1.25 1.8 1.8 1.8
2 2.1 2.3 2.4 2.5 1.8 2.5 2.5 2.5 2.5
0
Mode = No
1 mode
Example I
• Midterm scores
– Student group A: – Student group C:
50 50 50 50 50 50 50 50 50 100
Mean: 50 Mean: 60
Median: 50 Median: 50
Mode: no mode Mode: 50

– Student group B: – Student group D:


25 50 50 50 50 25 25 50 100 100
Mean: 45 Mean: 60
Median: 50 Median: 50
Mode: 50 Mode: 25 and 100

0
Summary Measures

Summary Measures

Central Tendency Percentiles Variation


Quartiles

0
Phần trăm-Percentiles
• Xếp hạng số liệu từ nhỏ nhất đến lớn nhất
• Chia số liệu của bạn vào 100 phần riêng biệt
• Có 99 phần trăm trong trường hợp này
• Dãy số thứ tự của 87 phần trăm nói lên rằng, ít nhất có
87% số liệu nằm trong khoảng này, còn lại 13% thuộc
khoảng còn lại.

• Trung vị có phân vị của nó là 50% cuả hai phía như nhau


• Có thể được sử dụng cho số liệu thang điểm, khoảng
cách, tỷ lệ
• Không thể sử dụng cho nhóm tên
Phần trăm:
Cách tính phần trăm Pk?
Bước 1: Vị trí phần trăm trong dãy số (ở đâu?)
k
Vị trí của phần trăm: i = *n
100

Bước 2: Giá trị của vị trí phần trăm Pk (bao nhiêu?)


– Nếu i là số nguyên, phần trăm là trung bình của giá trị tại vị trí i và
vị trí (i+1)

– Nếu i không là số nguyên, làm tròn tăng i và giá trị của nó sẽ là giá
trị của Xi làm tròn tăng
Ví dụ: tính giá trị của phần trăm
Pk trong dãy số
• Tiền lương (triệu đồng/tháng) của 11 người như sau

8, 11, 7, 5, 9, 12, 15, 14, 13, 17, 6

• Thứ tự theo
X4dãy số từ nhỏ đến lớn như sau:

5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 17

• Yêu cầu xác định vị trí 30% trong dãy số liệu nêu trên(Pk =P30)
(ở đâu) :

➢ 3.3 không là số chẵn, vì thế chúng ta sẽ làm tròn tăng. Như vậy giá trị
của số có vị trí 30% trong dãy sẽ là P30 (bao nhiêu?) = giá trị của
X3.3lamtron = X4 . Tức là giá trị của 30% trong dãy số là số có thứ tự thứ
4 đó là 8

➢ Kết luận giá trị của thứ tự P30 = 8


VD2: Tính giá trị của phần trăm
Pk trong dãy số liệu
• Ví dụ điểm thi của 10 sinh viên như sau

15, 12, 13, 10, 11, 11, 14, 18, 16, 17

• Dãy số liệu theo tứ tự:


X6 X7

10, 11, 11, 12, 13, 14, 15, 16, 17, 18

• Vị trí số tứ tự là 60% (P60)(ở đâu?) :


Vị trí of P60
➢ 6 là số chẳng, vì thế giá trị của P60 là số trung bình của X6 and
X7. Giá trị của P60 (bao nhiêu?) = (14+ 15)/2 = 14.5.

➢ Kết luận giá trị của thứ tự ở 60 có giá trị P60 = 14.5
Tứ phân vị-Quartiles
• Dãy số được xếp thứ tự đi vào 4 phần như nhau Quarters

25% 25% 25% 25%

Q1: 25% của dãy thứ tự nằm ở vị trí ở sau của phân vị đầu tiên

Q2: 50% của dãy số thứ tự nằm vị trí ở sau của phân vị thứ hai

Q3: 75% của dãy số tứ tự nằm vị trí ở sau của phân vị thứ ba

Q1 bằng với phân vị của 25%


Q2 được xác định tại phân vị thứ 50%, bằng với vị trí của Trung vị (Median)

Q3 bằng với phân vị của 75%



Ví dụ: tính tứ phân vị
• Trọng lượng kg của 8 nhân viên được xêp theo dãy số
50, 53, 65, 69, 71, 75, 77, 79
Tính
Q1or P25 Vị trí của
Vị trí của P25 là số nguyên, chúng ta sẽ tính giá trị của nó là trung bình của X2 và X2+1

Q2 or P50 Vị trí của


Vị trí của P50 là số nguyên, chúng ta sẽ tính giá trị trị của nó là trung bình của X4 và X4+1

Q3 or P75 Vị trí của

Vị trí của P75 là số nguyên, chúng ta sẽ tính giá trị trị của nó là trung bình của X6 và X6+1
Chênh lệch
• Đo lường sự biến đổi
• Là chênh lệch giữa giá trị lớn nhất và nhỏ nhất:

• Không quan tâm đến số liệu phân phối trong mẫu

Chêch lệch = 12 - 7 = 5 Chêch lệch = 12 - 7 = 5

7 8 9 10 11 12 7 8 9 10 11 12
Chênh lệch tứ phân vị
Interquartile Range (IQR)
• Đo lường sự biến đổi
• Xác định được độ rộng ½ khoảng cách
– Độ rộng điểm giữa 50%
• Là chênh lệch giữa từ phân vị thứ nhất (Q1) và từ phân
vị thứ ba (Q3)
• Không bị ảnh hưởng bởi các giá trị bất thường
IQR = Q3 – Q1
Số liệu theo dãy thứ tự: 11 12 13 16 16 17 17 18 21

IQR = Q3 – Q1 = 17 - 13 = 4
Chênh lệch tứ phân vị
• Giới hạn dưới vừa phải-Reasonable Lower Bound =

• Giới hạn trên vừa phải-Reasonable Upper Bound =

Những giá trị dưới điểm RLB and trên điểm RUB được xem như
Là những giá trị bất thường vừa phải (mild outliers).

• Giới hạn dưới đặc biệt-Extreme Lower Bound =


Giới hạn trên đặc biệt-Extreme Upper Bound =

Những giá trị dưới điểm ELB and những giá trị trên điểm EUB
Được xem như là những giá trị bất thường đặc biệt (extreme outliers).
Range
• Measure of variation
• Difference between the largest and the smallest
observations:

• Ignores the way in which data are distributed

Range = 12 - 7 = 5 Range = 12 - 7 = 5

7 8 9 10 11 12 7 8 9 10 11 12
0
Interquartile Range (IQR)
• Measure of variation
• Also known as midspread
– Spread in the middle 50%
• Difference between the first and third quartiles
• Not affected by extreme values

IQR = Q3 – Q1

Data in Ordered Array: 11 12 13 16 16 17 17 18 21

IQR = Q3 – Q1 = 17 - 13 = 4
0
Interquartile Range (Cont.)
• Reasonable Lower Bound =

• Reasonable Upper Bound =

Numbers below the RLB and numbers above the RUB


are considered to be mild outliers.

• Extreme Lower Bound =


Extreme Upper Bound =

Numbers below the ELB and numbers above the EUB


are considered to be extreme outliers.
0
Variance
• Important measure of variation
• Shows variation about the mean
– Sample variance:

– Population variance:

0
Standard Deviation
• Most important measure of variation
• Shows variation about the mean
• Has the same units as the original data
– Sample standard deviation:

– Population standard deviation:

0
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 = .9258
Data C
Mean = 15.5
11 12 13 14 15 16 17 18 19 20 21 s = 4.57
0
Compare means and test
hypothesis
• Compare means and itst introduction to
testing hypothesis
• Independent samples T test: two
independent groups
• Paired samples T test: Paired variables
• Comparing more than two independent
groups: Analysis of Variance (ANOVA) or
Kruskal Wallis test
https://statistics.laerd.com/statistical-guides/independent-t-test-statistical-guide.php

https://statistics.laerd.com/spss-tutorials/independent-t-test-using-spss-statistics.php
Samples of hypothesis

Prob.1 H0: There is not a significance difference in income between male


and female
H1: Reject H0

Prob.2 H0: The energy (working hours) of female is equal to that of male
H1: Reject H0

Prob.3 H0: Sleeping hours of male and female are the same
H1: Reject H0
Level of Significance:
and the Rejection Region
H0: 1- = non-rejection region

H0: /2 = Rejection region /2 = Rejection region

Ha: Two-tail test


0
H0: 1- = non-rejection region
H0: = Rejection region

Ha: Upper-tail
test
0
H0:
H0: = Rejection region 1- = non-rejection region

Ha: Lower-tail
test
0
= level of significance

= Critical Value
Large sample test of hypothesis

• One-tailed test • Two tailed test


H0: H0:

Ha: Ha:

Where D0 = Hypothesized difference between the means (this is often 0)

Test statistic: Test statistic:

Where is the standard deviation of sample 1, is of the SD of sample 2

Rejection region:
Table value Rejection region:
Table value
Assumption: or

T table value: df. = n1+ n2 – 1

α
Compare means and test
• Calculate means of values, percent
• Show different between two groups
• Test significant differences
• Significant level
– Value of Sig. < 0.01 Significant at 1%
Reject H0
– 0.01 ≤ Value of Sig. < 0.05 Significant at 5%
Reject H0
– 0.05 ≤ Value of Sig. < 0.1 Significant at 10%
Reject H0
Compare means - SPSS
• File: dataspss2.2-Electronic
• Compare two groups of male and female
with satisfaction on Electronic
Supermarkets (Q9) (Q9.1)
• Discussion on empirical result
• Conclusion how different between two
groups
Manual Guide
Empirical result

Where to Significant level


check
=> Value of Sig. < 0.01 Significant at 1% Reject H0
significant => 0.01 ≤ Value of Sig. < 0.05 Significant at 5% Reject H0
=> 0.05 ≤ Value of Sig. < 0.1 Significant at 10% Reject H0
Conclusion
• There is an evident difference in revenue
between service and industry
• Or there is a significant difference at 5
percent level in revenue between service
and industry
• Of which the revenue of service is
significantly higher than that of industry.
Practice
File: CFVG MMSS9 student sample

• Compare means of “sleeping hours”


between married student and single
student
• Apply t-test to test a difference in mean
values of sleeping hours between married
and single students
• Discussion
Paired-Samples T-Test of Population
Mean Differences
• The same observation
• Two variables compared are seemly the
same kind of things that we want to
compare
• Compare between two periods, or between
two characteristics, etc
• File: dataspss2.2-Electronic
Practice : file: QUESTIONNAIRE-Electronic ; File: data-Electronic

• Paired sample t-test


• Nguyen Kim (Q9.5) vs. IDEAS (Q9.1)
• Nguyen Kim (Q9.5) vs. Phan Khang (Q9.2)
• Nguyen Kim (Q9.5) vs. Thien Hoa (Q9.3)
• Nguyen Kim (Q9.5) vs Cho Lon (Q9.4)
• Conclusion
Solving the problem with SPSS:
The paired-samples t-test - 1
Having satisfied the level of
measurement and assumption of
normality, we now request the
statistical test.

Select Compare Means > Paired-


Samples T Test… from the Analyze
menu.
Analysis of Variance (ANOVA)
• Comparing more than two independent
groups: Analysis of Variance (ANOVA) or
Kruskal Wallis test
Test three groups by ANOVA

H0:

H1: At least two treatment means differ

Assumptions:
1. All p population probability distribution are normal
2. The p population variances equal
3. Samples are selected randomly and independently from
respective populations
Application to test satisfaction on
supermarkets (Q9) regarding to income
(Q19)

• Identify groups available


• ANOVA test
Manual Guide
Group practice
• Each group checks its owned database
• Select two categorical variables
• Compare some variables
• Interpreting output

You might also like