1. In this week, we learned about the confidence interval which is the measurement of the degree of uncertainty or certainty in a sampling method. For instance, if there is a 95% confidence interval, this means that if we have samples and 95% will contain the true value. I was confused about whether the confidence interval is equivalent to the pvalue. Can we say that the probability to get the true value is 95%?
2.Hi, we learned that the confidence interval can be set as 90%,95%, 99%. I’m confused that when we should use the interval at 90%, 95%, or 99%, and does the choice of the confidence interval would affect the results? In addition, is the confidence interval at 99% can bring more accurate results than the confidence interval at 90%? Can anyone give me some idea, thanks!
3.Hi guys, I do have a question about the situation that we should use bootstrap to simulate the distribution. If the question doesn’t tell us the specific distribution then which means we should use bootstrap to help us find the distribution?Or are there other ways for us to find the distribution except using the bootstrap?
STA 238
Probability, Statistics and Data Analysis II
Professor K. H. Wong
Week 7: February 28/March 1
February 26, 2022
1 / 22
Learning Outcomes
By the end of this lecture, we will have covered how to…
Explain the intuition behind confidence intervals
Use the results of Central Limit Theorem to derive plausible intervals
for population mean µ based on sampled data
Compute the (1 ≠ –)100% confidence interval for population mean
Correctly interpret confidence intervals as well as critique and correct
flawed interpretations of CIs
February 26, 2022
2 / 22
Where are we in the statistical process?
So far, we’ve discussed very briefly:
Proposing a research question/hypothesis we want to investigate
Exploratory Data Analysis – graphical summaries and descriptive
statistics.
Parameter Estimation: Using the data along with theory to come up
with plausible estimators (Law of Large Numbers, Estimation
methods (MOM/MLE))
What other information can we extract from our data?
Is it possible to incorporate uncertainty to our point estimates?
Can we tie variability and point estimation together to construct
intervals of plausible values of parameter ◊?
Can we quantify how certain we are in the computed values?
February 26, 2022
3 / 22
Distinguishing Randomness vs Fixed Outcomes
#
Using our quick class survey, where we have !” students whose sex is male,
and $% students whose sex is female. Consider the following three questions:
1. If a student is picked at random from the pool who participated in the
survey, what is the probability that a male is selected? !”&'( ) +&(,
)
*
)
*
)
$%,(.
2. If a student is picked at random from the pool who participated in the
/0##01
survey, and
was selected, what is the probability that a
!&!
!22,
2‘ 3
male was selected?
3. A student is picked at random from the pool who participated in the survey.
Their name is placed in a hat. What is the probability that a male was
2<
45
6789
596789
:;
selected? !22! 45

)
)

)
What is the difference between the two? Can we use any prior information to
determine how “sure” we feel that the student picked in (3) is male or female?
=#5741
)
7>?
)
@
+2<
*

05 87#A4#B
?97A>
February 26, 2022
4 / 22
Toy Example
Recall Chebyshev’s Inequality for a random variable X with E (X ) = µ and
17#A06
V (X ) = ‡ 2 :
A
1
P(X ≠ µ < k‡) Ø 1 ≠ 2
k
Which holds for all RVs with finite variance. It tells us there is at least...
February 26, 2022
5 / 22
Toy Example
Recall Chebyshev’s Inequality for a random variable X with E (X ) = µ and
05>D7#AA97=A7?0#>
V (X ) = ‡ 2 :
C
B
1
I
G0H/=DD91
P(X ≠ µ < k‡) Ø 1 ≠ 2 E
k
:
K00
J
I L
;I
64H10
Which holds for all RVs with finite variance. It tells us there is at least...
G
F
F
F
;

F
HM0
F
F
@
75% of outcomes lie within 2 standard deviations of its mean
(i.e. 75% chance we get a value in (µ ≠ 2‡, µ + 2‡))
89% of outcomes lie within 3 standard deviations of its mean
(i.e. 89% chance we get a value in (µ ≠ 3‡, µ + 3‡))
7>
)
Y
!<
08
>f9H454H
)
7
)
)
4D
)
4>
)
51
O
0=DH069
E
H0#D74#4#B
05 )
H?7#H9
)
D4f
Z
)
05
H?7#H9
D?9
–
#0D ) /
i
f10h
–
)
4D
7
)
–
Q
Z
H0#D74#>
JDM0
L
?97A>
05 87#A4#B
H?7#H9
Z
Z
4>
)
)
K
:
O
I;;
c
r
W
4#D0
I=
)
4>
–
)Z
)
Y
s
9#0=B?
Q?97D
[17#>5016 )
S
l[
4>
B9#917D9A
17#A068d
Z
S
05
4#D91V78>
+’! H0#>D1=HD9AZ
–
F!+,
7#A
501
2+’
7
f i
#01678
)
871B9
J#0Q#
Z
–
7#D?96
L
!+,
F
;
719
F
;55
)
F
T
?+,e5B
!+,Jv
>
4>
L
>0
)
D?9
4#
)
H9#D19
17#A06
)
SG
;
F
t
T
4#D91V78
D?9
9#Af04#D>
i
i
;m5
T
;
F
9
69
;
!+,
ET
F
;
Y
F
F2+’
D?9
,%u!*2+’
F2L>
)
F!!+,v Y
F2+’
February 26, 2022
11 / 22
Confidence Interval for µ (‡ known)
Continuing from the previous slide, we collect a random sample from the
population and recorded the following data:
A7D9
[?4>
17.29
17.18
q
xi = 127.11
14.05
16.50
F
+’%
f10h
)
–
4#D91V78
i
R
O
)
F
+’%
/;
–
;#D91f19D
R
)
;
R
+’%
D0
) 7>
/;
)
?4B?
)
15.77
17.45
q 2
xi = 2036.214
;
Z
!Z+,
F
*
Z
;
!”F,,2,
%$!!,+
)
D?7D
!”,22,
L
5106
NGE
F%,Z2*% Y
Y
D?9 ) ,
!$!!,+
Y
!”
H0=8A
,,2,
D?4>
Q?7D
h9
–
Z
Z
)
B941717D9A4#
13.31
15.56
F!!Z+,2#g Y
i
!’Z””””
)
4>
H0#54A9#D
) 7>
F!+,w
i ;
*!(<
+'%
[?9
7#
)
;
5
)
7>
Y
697#>
80Q
)
7>
)
4>
Q9
!$!!,+
–
February 26, 2022
12 / 22
Large Sample Confidence Interval for µ
(1 ≠ –)100% CI for µ (‡ 2 known)
For large sample sizes OR for normally distributed data (of any sample size), the
(1 ≠ –)100% confidence interval for the unknown population mean µ where the
population variance ‡ 2 is known is:
3
4
‡
‡
x n ≠ z–/2 · Ô , x n + z–/2 · Ô
n
n
(1 ≠ –) is called the confidence level, and z–/2 · Ô‡n is called the margin of error.
Note: z–/2 denotes the zscore with upper tail probability –/2.
You should try to derive this result by generalizing the example on the previous
slide!
February 26, 2022
13 / 22
Confidence Interval – Properties
There are a variety of factors that can affect the width of a confidence interval,
and you should spend some time understanding how these factors affect the CI
;
(it’s not wise to just memorize!): +’! /; 501 E i ; F!+,F(
;
671B4# 05
x!+,Jv
)
R
Z
–
;
)
; ) !+, )
0Q#
The confidence interval is always centred around the estimate ◊ˆ if the
sampling distribution of ◊ˆ is symmetric around ◊.
;#
91101
6
February 26, 2022
14 / 22
Confidence Interval – Properties
There are a variety of factors that can affect the width of a confidence interval,
and you should spend some time understanding how these factors affect the CI
(it’s not wise to just memorize!):
The confidence interval is always centred around the estimate ◊ˆ if the
sampling distribution of ◊ˆ is symmetric around ◊.
To achieve a higher level of confidence, ceteris paribus (all other things
Q4A91
unchanged), the
the confidence interval.
For the same level of confidence: higher variability will lead to
confidence intervals.
Q4A91
For the same level of confidence: larger sample sizes will lead
#7110Q91
to
confidence intervals.
9e9>
–
;#
oT;N Y
F
F
7D
Z
V74#
;D
February 26, 2022
14 / 22
Confidence Interval – Example
Example 1 MIPS 24.8 A bottling machine is known to fill wine bottles with
amounts that follow an N(µ, ‡ 2 ) distribution, with ‡ = 5. Additionally, the wine
bottles involved are normally distributed and weigh an average of 250 grams with
a standard deviation of 15 grams. For a sample of 16 bottles, an average weight of
998 grams was found. You may assume that 1 mL wine = 1 g. Construct a 95%
confidence interval for the expected amount of wine per bottle, µ, and interpret.
February 26, 2022
15 / 22
Case 3: CI for µ when ‡ 2 Unknown
Recall the Tdistribution, which is (generally) the ratio of a standard normal
random variable Z ≥ N(0, 1) and the square root of a ‰2‹ /‹ random variable:
TDistribution
For a random sample X1 , …, Xn where Xi ≥ N(µ, ‡ 2 ), the random variable:
Xn ≠ µ
Ô
S/ n
T =
;5
501)
)
#
/l[
BQA
871B9 9#0=B?
4> )
)
Z
69
)
7ff10e
B9D
H7#
Z
Q&
)
A4>D 3
) [
has a Tdistribution with (n ≠ 1) degreesÛof freedom (df).
qn
2
i=1 (Xi ≠ X n )
S is the sample standard deviation, S =
.
n≠1
Note: The notation tdf ,p is the critical value where P(Tdf Ø tdf
:,p ) = p
4#D9#>4549A
#7??
Ru
This definition can be used to build confidence intervals for the population mean
)
4#D91V78
D916>
E 4>
05 ;
µ when ‡ 2 is unknown. r g4#A f10h
)
–
;
–
r
)O
4#
Z
) O
64 T667=>
;
February 26, 2022
7#7>
16 / 22
Confidence Interval for µ when ‡ 2 Unknown
(1 ≠ –)100% CI for µ (‡ 2 Unknown)
For normally distributed data (of any sample size), the (1 ≠ –)100% confidence
interval for the unknown population mean µ where the population variance ‡ 2
is unknown and is estimated using Sn2 is:
3
4
sn
sn
x n ≠ t(n≠1),–/2 · Ô , x n + t(n≠1),–/2 · Ô
n
n
(1 ≠ –) is called the confidence level, and t(n≠1),–/2 · Ô‡n is called the margin of
error.
Note: t(n≠1),–/2 denotes the tscore with upper tail probability –/2.
February 26, 2022
17 / 22
Confidence Interval Example
Example 2 Sulfur dioxide (SO2 ) and nitrogen oxide are both products of fossil
fuel consumption. These compounds can be carried long distances and converted
to acid before being deposited in the form of “acid rain”. Data were obtained on
SO2 concentration (µg/m3 ) in 24
2 independent locations in a Bavarian forest
thought to have been damaged by acid rain. The following (rounded) summary
statistics were computed:
x̄24 = 53.9167
s = 10.0737
HF
s 2 = 101.4797
Use the data to estimate the average sulfur dioxide concentration in the Bavarian
forest and construct a 98% confidence interval for your estimate.
#
F
F
(%
SD
501
/;
–
?7V9
) Q9
–
–
0
4>
–
)
)
9>?6
;Hd
)
*
‘$+!,<
)
6B !6>
L
N/:
;
=#J#0Q#
7>
Z
05
9>D467D01
9>D467D9
)
Q&
6
@
>76f84#B
A4>D755>
@
[A5
Z
)j
–
#
F
;
‘*!224#B
(v
e
R
!2.D4549A
F
F
;#
F!*($
#
F
F
4 )
00
Z
TY
D
P7V7147#
5019>D
5=# z
February 26, 2022
19 / 22
What if CLT does not apply?
The previous derivations for confidence intervals relies on the fact that ‡ is
known, and the sample size n is large enough such that CLT allows us to use a
normal approximation, or that the population is already normally distributed.
What if we have a sample that does not meet these assumptions?
February 26, 2022
20 / 22
What if CLT does not apply?
In order for us to construct a confidence interval for our estimates, we need the
following properties:
ˆ should be known
The sampling distribution of our estimator (◊)
The sampling distribution should not depend on the parameter ◊ that we are
trying to estimate (e.g. where X̄n ≥ N(◊, ‡ 2 /n), X̄n ≠ ◊ ≥ N(0, ‡ 2 /n))
With the sampling distribution, derive the general probability interval of ◊ˆ
TD7 T#
)
h
)
that contain ◊
Th
T#
Y
7
9umC
@
F
e
L
Z
This interval will tell us how frequently the ◊ˆ will be ‘near’ the target ◊
Rearrange so we have an interval with random endpoints that have
(1 ≠ –)100% chance of capturing ◊
C
Challenge: Use the above steps to derive the 90% confidence
F2interval for ‡2 for
normally distributed data X1 , X2 , …, Xn before next class!
February 26, 2022
21 / 22
What if CLT does not apply?
In the case where the sampling distribution cannot be derived or simulated, we can
rely on bootstrapping! Let’s examine the case for bootstrapped CI for mean µ:
Empirical Bootstrap of Studentized Mean
F
Given a dataset x1 , x2 , …, xn , determine its ECDF: Fn as an estimate of F. The
expectation corresponding to Fn is µú = x̄n .
1. Generate bootstrap dataset x1ú , x2ú , .., .xnú from Fn .
2. Compute the studentized mean for the bootstrap dataset:
tú =
x¯nú ≠ x̄n
Ô
snú / n
where xnú , snú are the sample mean and standard deviation of the
bootstrapped dataset x1ú , x2ú , .., .xnú . Note that t ú is not required to have a
Tdistribution!
3. Repeat steps (1) and (2) for multiple bootstrap resamples (B > 1000)
February 26, 2022
22 / 22
Discussion Board Rubric
a
has
Points
Quality of
contribu
tion
1 point
Student has made
substantial contribution
with detailed explanations
and/or clearly out
lined / described process in
approaching a problem,
and/or
015 points
Student has made a con
tribution to the discussion
that is dismissive and/or
lacking in detail, provides
no elaboration nor further
discussion that fosters a
collaborative learning en
vironment.
0 points
Student
not
contributed to
the
weekly discussion
topic thread, or
Contributions are off
topic or irrelevant to
the thread, or
was
Student
involved
in followup discussions
and worked collaboratively
with their peers to develop
a better understanding of
the concepts involved.
The only consists of
a solution with no ex
planation or justifica
tion of steps/process.
Examples: Responses
such as you just need to
integrate this and solve
for it’ or ‘this is what I
did’ or posting solutions
with minimal explanations
of thought process
justifications.
or
January 10, 2022
10/30
Delivering a highquality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a moneyback guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarismdetection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more