SB (Final-Note)
SB (Final-Note)
S2 = {1, 4} → 𝑥
2
= 2. 5, tính tương tự với {1, 3}, {2, 3}, {2, 4}, {3, 4}
→ 𝑋 (S1) = 1.5 → 𝑋: 𝑠𝑎𝑚𝑝𝑙𝑒 𝑚𝑒𝑎𝑛
1.5+2+2.5+2.5+3+3.5
µ𝑋 = σ
= 2. 5 = µ
1 1 2
Practice. P (𝑋 = 1. 5) = P ({1, 2}) = 2 = 6
⇒ 𝐶4 𝑙à 𝑐ℎọ𝑛 2 𝑠ố 𝑡ừ 𝑡ậ𝑝 4 𝑠ố 𝑛ℎư 𝑡𝑟ê𝑛
𝐶4
Get samples from the population. Make inferences about population from sample.
*NOTE:
Uncontrollable Controllable
µ − σ − π 𝑥− 𝑠 − 𝑝
𝑛 2
𝑛 ∑ (𝑥𝑖−𝑥)
1 𝑖=1
Sample mean: 𝑥 = 𝑛 ∑ 𝑥 Sample SD: 𝑠 = 𝑛−1
𝑖
𝑖=1
𝑥
Sample proportion: 𝑝 = 𝑛
Sampling error: the difference between an estimate and the corresponding population parameter
𝑠𝑎𝑚𝑝𝑙𝑖𝑛𝑔 𝑒𝑟𝑟𝑜𝑟 = 𝑥 − µ
Bias: the difference between the expected value of the estimator and the true parameter
𝐵𝑖𝑎𝑠 = 𝐸(𝑋) − µ
● Central limit theorem: allows us to approximate the shape of the sampling distribution of 𝑋
3
Range of sample means
σ
● Expected range of sample means: µ ±𝑧
𝑛
● We use the familiar z-values for the standard normal distribution. If we know µ and σ, the CLT allows us
to predict the range of sample means for sample of size n:
σ σ σ
µ ± 1. 645 µ ± 1. 960 µ ± 2. 576
𝑛 𝑛 𝑛
n = 16 σ𝑥 = σ/ 16 = σ/4
n = 64 σ𝑥 = σ/ 64 = σ/8
Exercise. Consider a discrete uniform distribution consisting of integers {0, 1, 2, 3}. The population parameters
are µ = 1. 5 and σ = 1. 118
𝑁
1 0+1+2+3
µ = 𝑁
∑ 𝑥𝑖 = 4
= 1. 5
𝑖=1
𝑛
2
∑ (𝑥𝑖−µ) 2 2 2 2
𝑖=1 (0−1.5) +(1−1.5) +(2−1.5) +(3−1.5)
σ = 𝑁
= 4
= 1. 118
Với n = 2, chọn 2 số bất kỳ trong tập hợp {0, 1, 2, 3} → có 16 trường hợp xảy ra: (0, 0); (0, 1); (0, 2);...
𝑥1+𝑥2 0+0
Each sample mean: 𝑥 = = = 0 (𝑣í 𝑑ụ 𝑐ℎ𝑜 𝑡𝑟ườ𝑛𝑔 ℎợ𝑝 (0, 0))
2 2
α
1 − α = 95% → α = 5% ⇒ 2
= 0. 025
𝑧𝑎/2 = 𝑞𝑛𝑜𝑟𝑚(0. 025) =− 1. 96
Degrees of freedom
𝑑. 𝑓 = 𝑛 − 1 (𝑑𝑒𝑔𝑟𝑒𝑒𝑠 𝑜𝑓 𝑓𝑟𝑒𝑒𝑑𝑜𝑚 𝑓𝑜𝑟 𝑎 𝑐𝑜𝑛𝑓𝑖𝑑𝑒𝑛𝑐𝑒 𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙 𝑓𝑜𝑟 µ)
● As n increases, the range of sample proportion p = x/n narrows b/c n appears in the denominator of the
standard error:
π(1−π)
σ𝑃 = 𝑛
6
→ therefore, the sampling variation can be reduced by increasing the sample size
*NOTE: the sample proportion p = x/n may be assumed normal if both 𝑛π ≥ 10 and 𝑛(1 − π) ≥ 10
𝑝(1−𝑝)
Confidence interval for π: 𝑝 ± 𝑧 𝑛
𝑎/2
The width of the confidence interval for π depends on:
● Sample size
● Confidence level
● Sample proportion p
● If we want a narrower interval, we could either increase the sample size or reduce the confidence
level (e.g. from 95% to 90%)
● All business managers need at least a basic understanding of hypothesis testing b/c managers often
interact with specialists, read technical reports,...
Steps
★ Rejecting the null hypothesis when it is true → Type I error (false positive)
★ Failure to reject the null hypothesis when it is false → Type II error (false negative)
Decision rule
● Extreme outcomes occurring in the left tail would cause us to reject the null hypothesis in a right-tailed
test, the same for right tail
● Rejection region: the area under the sampling distribution curve that defines an extreme outcome
● Test statistic: measures the difference between the sample statistic and the hypothesised parameter
Steps
5 Take action
P-value method
For a right-tailed test, the decision rule using the p-value approach is stated as:
𝑟𝑒𝑗𝑒𝑐𝑡 𝐻0 𝑖𝑓 𝑃(𝑍 > 𝑧𝑐𝑎𝑙𝑐) < α, otherwise fail to reject 𝐻0
Two-tailed test
Steps
5 Take action
P-value approach
In a two-tailed test, the decision rule using the p-value method is the same as one-tailed test:
10
𝑟𝑒𝑗𝑒𝑐𝑡 𝐻0 𝑖𝑓 𝑝 − 𝑣𝑎𝑙𝑢𝑒 < α, otherwise, do not reject 𝐻0
Testing proportion
Our rule is to assume normality if 𝑛π≥ 10 and 𝑛(1 − π0) ≥ 10
0
If we can assume a normal sampling distribution, then the test statistic would be the z-score. The sample
proportion is:
𝑥 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑠𝑢𝑐𝑐𝑒𝑠𝑠𝑒𝑠
𝑝 = 𝑛 = 𝑠𝑎𝑚𝑝𝑙𝑒 𝑠𝑖𝑧𝑒
Test statistic for a proportion
𝑝−π0 𝑝−π0
𝑧𝑐𝑎𝑙𝑐 = σ𝑝
=
π0(1−π0)
𝑛
Two-sample tests
● Two-sample tests: compare 2 sample estimates with each other, whereas one-sample tests compare a
sample estimate with a non sample benchmark or target
E.g. manufacturer A’s sample mean was 510.5 with a SD of 147.2 in 18 tests, compare with manufacturer B’s
mean of 628.9 with a SD of 237.9 in 17 tests
Test procedure
Larger samples are always desirable because they permit us to reduce the chance of making either a Type I
error or Type II error, however, large samples take time and cost money, so we often must work with available
data.
11
For the common situation of testing for a zero difference (𝐷 = 0) in 2 population means the possible pairs of
0
null and alternative hypotheses are:
Large samples
𝑥1−𝑥2
𝑧𝑐𝑎𝑙𝑐 = 2 2
𝑠1 𝑠2
𝑛1
+𝑛
2
● Unequal variances:
Paired t test
In the paired t test we define a new variable 𝑑 = 𝑋1 − 𝑋2 as the difference between 𝑋1 and 𝑋2
𝑛
∑ 𝑑𝑖
𝑖=1
𝑑= 𝑛
(𝑚𝑒𝑎𝑛 𝑜𝑓 𝑛 𝑑𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑐𝑒𝑠)
𝑛 2
(𝑑𝑖−𝑑)
𝑠𝑑 = ∑ 𝑛−1
(𝑠𝑡𝑑. 𝑑𝑒𝑣. 𝑜𝑓 𝑛 𝑑𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑐𝑒𝑠)
𝑖=1
Sample proportions
Pooled proportion
If 𝐻 is true, there is no difference between π and π .
0 1 2
𝑥1+𝑥2 #𝑠𝑢𝑐𝑐𝑒𝑠𝑠𝑒𝑠 𝑖𝑛 𝑐𝑜𝑚𝑏𝑖𝑛𝑒𝑑 𝑠𝑎𝑚𝑝𝑙𝑒𝑠
𝑝𝑐 = 𝑛1+𝑛2
= 𝑐𝑜𝑚𝑏𝑖𝑛𝑒𝑑 𝑠𝑎𝑚𝑝𝑙𝑒 𝑠𝑖𝑧𝑒𝑠
(𝑝𝑜𝑜𝑙𝑒𝑑 𝑝𝑟𝑜𝑝𝑜𝑟𝑡𝑖𝑜𝑛)
Test statistic
14
𝑝1(1−𝑝1) 𝑝2(1−𝑝2)
(𝑝1 − 𝑝2) ± 𝑧𝑎/2 𝑛1
+ 𝑛2
The rule of thumb for assuming normally is that 𝑛𝑝 ≥ 10 and 𝑛(1 − 𝑝) ≥ 10 for each sample
Comparing 2 variances
Format of hypotheses
An equivalent way to state these hypotheses is to look at the ratio of the 2 variances. A ratio near 1 would
indicate equal variances
.
The F test
If the null hypothesis of equal variances is true, this ratio should be near 1:
𝐹𝑐𝑎𝑙𝑐≌ 1 (𝑖𝑓 𝐻0 𝑖𝑠 𝑡𝑟𝑢𝑒)
If the test statistic F is much less than 1 or much greater than 1, we would reject the hypothesis of equal
population variances.
2 2
● The numerator 𝑠 has degrees of freedom 𝑑𝑓 = 𝑛 − 1, while the denominator 𝑠 has degrees of
1 1 1 2
freedom 𝑑𝑓 = 𝑛2 − 1
2
2 2
● F can’t be negative, since 𝑠 and 𝑠 can’t be negative
1 2
Two-tailed F test
The critical values for the F test are denoted 𝐹 (left tail) and 𝐹 (right tail)
𝐿 𝑅
Notice that the rejection regions are asymmetric
15
A right-tail critical value 𝐹 may be found from Appendix F using 𝑑𝑓 and 𝑑𝑓 degrees of freedom.
𝑅 1 2
𝐹𝑅 = 𝐹𝑑𝑓 ,𝑑𝑓 (right-tail critical F)
1 2
1
𝐹𝐿 = 𝐹𝑑𝑓 ,𝑑𝑓
(left-tail critical F with reversed 𝑑𝑓 and 𝑑𝑓 )
1 2
2 1
Steps
Folded F test
The test statistic for the folded F test is:
2
𝑠𝑚𝑎𝑥
𝐹𝑐𝑎𝑙𝑐 = 2 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻0 𝑖𝑓 𝐹𝑐𝑎𝑙𝑐 > 𝐹α/2
𝑠𝑚𝑖𝑛
*NOTE: the largest variance goes in the numerator and the smaller variance in the denominator
➢ ‘Larger’ refers to the variance
➢ But the hypotheses are the same as two-tailed test:
2 2
𝐻0: σ1/σ2 = 1
2 2
𝐻1: σ1/σ2 ≠ 1
16
One-tailed F test
Suppose that the firm was interested in knowing whether the new bumper had reduced the variance in collision
damage cost. We would then perform a left-tailed test.
Steps
In this chapter, you will learn how to compare more than 2 means simultaneously and how to trade sources of
variation to potential explanatory factors by using analysis of variance (ANOVA)
Variation in the response variable about its mean either is explained by one or more categorical independent
variables (the factors) or is unexplained (random error)
𝑣𝑎𝑟𝑖𝑎𝑡𝑖𝑜𝑛 𝑖𝑛 𝑌 = 𝑒𝑥𝑝𝑙𝑎𝑖𝑛𝑒𝑑 𝑣𝑎𝑟𝑖𝑎𝑡𝑖𝑜𝑛 + 𝑢𝑛𝑒𝑥𝑝𝑙𝑎𝑖𝑛𝑒𝑑 𝑣𝑎𝑟𝑖𝑎𝑡𝑖𝑜𝑛
● Each possible value of a factor or combination of factors is a treatment
If we are only interested in comparing the means of C groups, we have a one-factor ANOVA
If subjects (individuals) are assigned randomly to treatments, we call this completely randomised model
(most common ANOVA model)
The total number of observations:
𝑛 = 𝑛1 + 𝑛2 + 𝑛3 +... + 𝑛𝑐
If we interested in only what happens to the response for the particular levels of the factor that were selected
(fixed-effects model), the hypotheses to be tested are:
𝐻0: 𝑇1 = 𝑇2 =... = 𝑇𝐶 = 0
𝐻1: 𝑛𝑜𝑡 𝑎𝑙𝑙 𝐴𝑗𝑎𝑟𝑒 𝑧𝑒𝑟𝑜
True ➢ Observation x came from treatment j does not explain the variation
in Y
➢ ANOVA model collapses to:
𝑦𝑖𝑗 = µ + ε𝑖𝑗
Group means
𝑛𝑗
1
𝑦𝑖 = 𝑛𝑗
∑ 𝑦𝑖𝑗 (mean of each group)
𝑖=1
𝑐 𝑛𝑗 𝑐
1 1
𝑦= 𝑛
∑ ∑ 𝑦𝑖𝑗 = 𝑛
∑ 𝑛𝑗𝑦𝑗 (overall sample mean)
𝑗=1 𝑖=1 𝑗=1
⚠️ the sums SSB and SSE may be used to test the hypothesis that the treatment means differ from the grand
mean.
● The F test statistic is the ratio of the resulting mean squares.
Test statistic
Decision rule
Steps
5 Take action
Multiple comparisons
To maintain the desired overall probability of Type I error, we need to create a simultaneous confidence interval
🤓
for the difference of means based on the pool variances for all c groups
𝑐(𝑐−1)
For all c groups, there are distinct pairs of means to be compared
2
😘
𝑗 𝑘
we would reject 𝐻 if 𝑇
0 𝑐𝑎𝑙𝑐
> 𝑇𝑐,𝑛−𝑐, where 𝑇𝑐,𝑛−𝑐 is a critical value for the desired level of significance
Tukey’s test statistic could also be written as:
2
𝑠𝑚𝑎𝑥
𝐻𝑐𝑎𝑙𝑐 = 2
𝑠𝑚𝑖𝑛
20
In this two-factor ANOVA without replication (or non repeated measures design), each factor combination is
observed exactly once
👏 The random error is assumed to be normally distributed with zero mean and the same variance for all
treatments
21
ANOVA table
22
Total = between + within
Between df = SS between / MS between = 12471.6 / 2078.6 = 6