Week 12-1 Pre
Week 12-1 Pre
Yaoming Zhen
1 / 30
Roadmap
1. Confidence Interval
2 / 30
Roadmap
1. Confidence Interval
3 / 30
Normal Confidence Intervals for the Mean
4 / 30
Critical Values
5 / 30
Critical Values
6 / 30
α-level
7 / 30
Confidence Intervals for µ: σ 2 known
8 / 30
Confidence Intervals for µ: σ 2 known
Example
Suppose we collect 100 data points from a N(µ, 32) distribution
and the sample mean is x̄ = 12. Give the 95 % confidence
interval for µ.
9 / 30
Confidence Intervals for µ: σ 2 unknown
X̄ − µ
√ .
σ/ n
X̄ − µ
√ ∼ T (n − 1)
S/ n
10 / 30
t-distribution
Let X ∼pN(0, 1), W ∼ χ2 (m). If X is independent with W ,
then X / W /m ∼ T (m).
11 / 30
Critical Values
12 / 30
Confidence Intervals for µ: σ 2 unknown
s s
[x̄ − √ tn−1,α/2 , x̄ + √ tn−1,α/2 ]
n n
13 / 30
Confidence Intervals for µ: σ 2 unknown
Example
Suppose the data 2.5, 5.5, 8.5, 11.5 was drawn from a N(µ, σ 2 )
distribution with µ and σ both unknown. Give interval estimates
for µ by finding the 95%, 80% and 50% confidence intervals.
(t3,0.025 = 3.1824, t3,0.05 = 2.3533, t3,0.1 = 1.6377,
t3,0.25 = 0.7649 )
14 / 30
Confidence Intervals for µ when σ 2 unknown: big n
The central limit theorem states that as n → ∞, things tend
to the normal distribution. In this case,
X̄ − µ d
√ → Z ∼ N(0, 1)
S/ n
X̄ − µ
P(−zα/2 < √ < zα/2 ) ≈ 1 − α
S/ n
X − np
p
np(1 − p)
is approximately N(0,1)
Therefore,
X − np
P(−zα/2 < p < zα/2 ) ≈ 1 − α
np(1 − p)
16 / 30
Confidence Intervals for Binomial p
The confidence interval is characterized by
X − np
(p )2 < (zα/2 )2
np(1 − p)
17 / 30
Confidence Intervals for Binomial p
Example
Of a series of 100 i.i.d chemical experiments, 70 were
concluded successfully. Construct an approximating 90% CI for
the success probability of this type of experiment. (z0.05 = 1.64)
18 / 30
Sample Size
19 / 30
Sample Size
Example
What sample size do we need if we want to be 99% confident
that the sample mean age of undergraduate U of T students is
within 2 years of the population mean age? Suppose we are
given that the standard deviation in ages is 4 years.
(z0.005 = 2.58)
20 / 30
One Sided Intervals
21 / 30
One Sided CI: σ 2 unknown
X̄ − µ
P( √ < tn−1,α ) = 1 − α
S/ n
22 / 30
Roadmap
2. Hypothesis testing
23 / 30
Hypothesis Testing
24 / 30
Null and Alternative Hypotheses
Elements of hypothesis testing:
26 / 30
Test Statistic
Test Statistic
For a dataset modeled on a realization of the random variable
X1 , ..., Xn , a test statistic is any sample statistic T = h(X1 , .., Xn )
whose numerical value is used to decide whether or not to
reject H0 .
27 / 30
Hypothesis Test Setup
Example
Suppose a mayoral candidate of Toronto claims she will get
more than 50% of the votes in an election, and thereby be the
winner. We do not believe this claim, so we would like to test
the candidate’s claim as a hypothesis test. Set up the elements
of a statistical test (hypothesis test):
null hypothesis
alternative hypothesis
test statistic
rejection/critical region
28 / 30
Type I and II Errors
29 / 30
Significance
Significance Level:
30 / 30