PPT07 - Discrete Data Analysis
PPT07 - Discrete Data Analysis
PPT07 - Discrete Data Analysis
Applied Statistics
Topik – 7
Discrete Data Analysis
LEARNING OUTCOMES
LO2 : Use proper statistical techniques for statistical
decision making in the real problem
Random sample of
size n
With Without
characteristic characteristic
X
pˆ
n
Inferences on a population
proportion
Confidence Interval
• For large enough values of n the sample proportion can be taken to have
approximately the normal distribution
pˆ p
p (1 p ) ~ N 0,1
pˆ ~ N p, p (1 p )
n
n
• Confidence Interval Estimation
ˆ (1 p
p ˆ) ˆ (1 p
p ˆ)
ˆ z / 2
p ˆ z / 2
p p
n n
Inferences on a population
proportion
Hypothesis Test
Hypothesis Test Statistic Critical value
H0: p po z z
H1: p < po
pˆ po
z
H0: p po po (1 po )
z z
H1 : p > p o n
z z / 2 or
H0: p = po
z z / 2
H1: p ¹ po
Inferences on a population
proportion
Example
A biologist is interested in whether opossums give birth to male and female progeny with equal
probabilities. A group opossums is observed, and out of 23 births, 14 are male and 9 are female.
Suppose that each opossum offspring has a probability p of being male, independent of any
other births. The number of male births out of 23 births is then a random variable with a
B(23,p) distribution. Use α=5%
H0: p = 0,5
H1: p ¹ = 0,5
Inferences on a population
proportion
Test statistics :
pˆ po 14 / 23 0,5
z 0,83
po (1 po ) 0,5(1 0,5)
n 23
Critical Value :
z z / 2 or z z / 2 z 1,96 or z 1,96
X1 ~ B(n1, p1)
p1 – p2
x1 x2
pˆ 1 pˆ 2
Difference n1 n2
x1 x2
pˆ 1 pˆ 2
n1 n2
Confidence Interval
Confidence Interval Estimation :
pˆ 1qˆ1 pˆ 2 qˆ 2 pˆ 1qˆ1 pˆ 2 qˆ 2
( pˆ 1 pˆ 2 ) z / 2 ˆ ˆ
( p1 p2 ) ( p1 p2 ) z / 2
n1 n2 n1 n2
Where,
qˆ1 1 pˆ 1
qˆ 2 1 pˆ 2
Hypothesis Test
H0: p1-p2 ≥ 0
Z
pˆ1 pˆ 2 p1 p2 z z
H1: p1-p2 < 0
1 1
pˆ (1 pˆ )
H0: p1-p2 ≤ 0 n1 n2 z z
H1: p1-p2 > 0 X1 X 2 X1 X2
p̂ , p̂1 , p̂ 2
n1 n 2 n1 n2
H0: p1-p2 = 0 z z / 2 or
where X1 and X2 are the number of
z z / 2
H1: p1-p2 ≠ 0 successes in samples 1 and 2
Example
Recall that x = 19 of then n = 33 offspring raised by opossums with the enhanced diet are
male, and that y = 15 of the m = 30 offspring raised by opossums without the enhanced
diet are male. The Trivers-Willard hypothesis suggest that proportion with enhanced diet
higher than proportion of without enhanced. α = 5%.
Hypothesis :
H0: p1-p2 = 0
H1: p1-p2 > 0
Example
• Hypothesis:
H0: p1-p2 0
H1: p1-p2 > 0
• α = 5% = 0,05
• Statistic Test:
Z
pˆ1 pˆ 2 p1 p2
19 / 33 15 / 30 0 0,6
1 1 1 1
ˆp (1 pˆ ) 0,54(1 0,54)
n1 n2 33 30
19 15
p̂ 0,54
33 30
Example
Critical values :
Reject H0 if
z z
z 1,645
Conclusion : Don’t reject H0
Because 0,6 < 1,645
Goodness of fit tests for one-way
contingency tables
Definition
Goodness of fit test, offered to as Chi Square test, are used to test
the hypothesis.
Definition
Population
Classification
χ (2k -1),α
is chi square distribution with degrees of freedom k-1
Example
Recall that out of n=46 machine breakdown x 1=9 are attributable to electrical
problems, x2=24 are attribute to mechanical problems, and x 3=13 are attribute
to operator issues.
2 2 2
(9 9, 2) (24 23) (13 13,8)
χ2 0,0942
9,2 23 9,213,8
Testing for independence in two
way
Definition
xij where1≤ i ≤ r 1 ≤ j ≤ c
Definition
Statistic test
r c (x ij e ij ) 2
χ 2
i 1 j1 e ij
x i.x .j
where the expected cell eij
n
Hypothesis Test
Critical value
Reject H0 if
χ 2 χ (r2 1)(c1),α
is chi square distribution with degrees of freedom (r-
1)(c-1) χ (r2 1)(c1),α
Example
• Test whether gender and type of products that are of interest related
(α=5%)
Type of product
Gender Total
A B
r c (x ij eij ) 2
χ 2
i 1 j1 e ij
2 2 2
(12 14.4) (108 105.6) (24 21.6)
2
14.4 105.6 21.6
2
(156 158.4)
0.758
158.4
Example
χ 2 χ (r2 1)(c1),α
χ (21),5% 3.841
Conclusion : Don’t reject H0.
There is no relationship between gender and types of products.
Application with MINITAB
(5) Application with Minitab
Inferences on a Population Proportion
(Example 1)