0% found this document useful (0 votes)
8 views35 pages

Module 07 Inf OneSampleMean

This document outlines the methods of inference related to one-sample mean, focusing on constructing confidence intervals, conducting hypothesis tests, and interpreting p-values. It explains the Central Limit Theorem, point estimation, interval estimation, and the process of hypothesis testing, including Type I and Type II errors. Examples are provided to illustrate the application of these statistical methods in estimating population parameters and testing hypotheses.

Uploaded by

Shiwei Chen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views35 pages

Module 07 Inf OneSampleMean

This document outlines the methods of inference related to one-sample mean, focusing on constructing confidence intervals, conducting hypothesis tests, and interpreting p-values. It explains the Central Limit Theorem, point estimation, interval estimation, and the process of hypothesis testing, including Type I and Type II errors. Examples are provided to illustrate the application of these statistical methods in estimating population parameters and testing hypotheses.

Uploaded by

Shiwei Chen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

P8130: Biostatistical Methods I

Methods of Inference: One-Sample Mean

Instructor: Vahe Khachadourian, MD, MPH, PhD


Methods of Inference: One Sample Mean
This module focuses on inferential methods concerning one sample
mean.
You will learn how to:
• Construct a confidence interval to estimate a population mean.
• Conduct a hypothesis test using the appropriate distribution for a single
mean.
• How to carefully use and interpret a p-value.
Remember CLT
Let 𝑋!, 𝑋", …, 𝑋# represent an independent sample of size 𝑛 from a population with
mean E 𝑋$ = 𝜇 and variance Var 𝑋$ = 𝜎 ". Provided that 𝑛 is large enough (𝑛 ≥ 30)
or that the underlying population distribution is normal, then the shape of the
sampling distribution is approximately normal with:
𝜎"
.
𝑋~𝑁(𝜇, )
𝑛

And that is relevant because …


• It describes the distribution of all sample means from all possible random samples of
the same size taken from a population
• Provides context for making inferences when we only take a single sample of size n
and get only one sample mean 𝑋. to be used for estimating the true population mean
Statistical Inferences
Questions:
1. How is a specific random sample used to estimate the population
parameters of an underlying distribution for a population?
2. How to use the information we have from the sample to ‘infer’
properties of the population?
Statistical inferences include:
• Point Estimation
• Interval Estimation
• Hypothesis Testing
• Prediction
Point Estimation
A point estimate is a single number computed from the sample, that can be
regarded as a plausible value of the population parameter (characteristics).

Example: the computed value of the sample mean 𝑋. provides a point estimate of
the population mean 𝜇 (our best single guesstimate).

Because of sampling variability, rarely is the point estimate exactly equal to the
true parameter.
Solution: construct a confidence interval (CI) that contains plausible values for the
population parameter.
Interval Estimation: One-Sample Mean
CLT stated that under certain conditions, Remember the Empirical Rule for the
the distribution of the sample means is: normal distribution:

!
!
𝑋~𝑁 𝜇, ,
"

!
with 𝜎$# = "
called standard error (SE).
Interval Estimation: One-Sample Mean
Combining CLT + Empirical Rule:

• For most (95%) of the random samples,


𝑋! will fall within +/- 2 SE of the true
mean 𝜇

• This interval is called the 95%


confidence interval (CI) for the
population mean 𝜇
Interval Estimation: One-Sample Mean
How to derive this 95% confidence interval for a population mean, known variance:
% &
'()
.
Again CLT: Because the sample mean 𝑋~𝑁 𝜇, , it follows that %/ # ~𝑁(0,1).
#

𝑃 𝑧+,-./ < 𝑧 < 𝑧011./ = 0.95 → 𝑃 −1.96 < 𝑧 < 1.96 = 0.95

𝑋. − 𝜇
𝑃 −1.96 < < 1.96 = 0.95
𝜎/ 𝑛

Multiplying across by −𝜎/ 𝑛, and then adding 𝑋. leads to:


% %
𝑃 𝑋. − 1.96 #
≤ 𝜇 ≤ 𝑋. + 1.96 #
= 0.95.
Interval Estimation: One-Sample Mean
The 95% confidence interval for a population mean, known variance can be calculated
by:
𝜎 𝜎
.
𝑋 ± 1.96 .
≤ 𝜇 ≤ 𝑋 + 1.96
𝑛 𝑛

General: the 100 x (1-α)% confidence interval for the population mean with known
variance 𝜎 " is given by:
𝜎 𝜎
.
𝑋 − 𝑧!(2/" .
≤ 𝜇 ≤ 𝑋 + 𝑧!(2/"
𝑛 𝑛
Where:
𝑋. is the point estimate (sample mean)
%
#
is the standard error of the mean (measure of variability)
1 − 𝛼 is the desired level of confidence
Confidence Interval: Illustration
• Consider an underlying distribution: Y~𝑁(𝟗, 5). Point Estimates and 95% CIs for 100 random samples
• We take 100 random samples, each of size N=20
• We compute the 95% CI associated with each
sample

The sample means are denoted by points and the


confidence limits by gray lines.

What do you notice?


• Some intervals do not even contain the true
population mean (µ=9).
• Because µ is fixed, the probability that any
specific interval contains it is either 0 or 1.
µ=9
95% CI: Interpretations
1. Over the collection of all 95% confidence intervals that could be constructed from
repeated samples of size n, 95% of them will contain the true population mean.

2. We are 95% confident that the true population mean lies between the lower and
the upper limits of the interval.

Questions:
• If the confidence level increases, the width of the CI … ?
• If the population variance increases, the width of the CI … ?
• If the sample size increases, the width of the CI … ?
95% CI: Example 1
Let’s assume that cholesterol levels of male population follow a normal distribution. Ten
men are randomly selected and their average serum cholesterol was 175mg/dL. Given a
population standard deviation of 15 mg/dL:

1. Construct the 95% CI for the true mean serum cholesterol level.
95% CI: Example 1
Let’s assume that cholesterol levels of male population follow a normal distribution. Ten
men are randomly selected and their average serum cholesterol was 175mg/dL. Given a
population standard deviation of 15 mg/dL:

2. Construct the 99% CI for the true mean serum cholesterol level.
Interval Estimation: One-Sample Mean
What if we only knew the sample standard deviation?

A 100 x (1-α)% confidence interval for the population mean µ and unknown variance 𝜎 ":
𝑠 𝑠
.
𝑋 − 𝑡#(!,!(2/" .
≤ 𝜇 ≤ 𝑋 + 𝑡#(!,!(2/"
𝑛 𝑛
Where:
𝑋. is the point estimate (sample mean)
4
is the estimated standard error, 𝑠 = ∑#$5! 𝑋$ − 𝑋. "/(𝑛 − 1)
#
𝑡#(!,!(2/" is the percentile of the t-distribution with (n-1) degrees of freedom
&
'()
Notice that in this case: ~𝑡(#(!) , 𝑡 distribution with (n-1) degrees of freedom
4/ #
Two vs One-Sided Confidence Intervals
• A two-sided 100 x (1-α)% confidence interval for the population mean µ and
unknown variance 𝜎 % :
𝑠 𝑠
𝑋! − 𝑡"&','&)/% ≤ 𝜇 ≤ 𝑋! + 𝑡"&','&)/%
𝑛 𝑛

• One-sided 100 x (1-α)% confidence intervals:


+
Upper limit: (−∞, 𝑋! + 𝑡"&','&) "
)
+
Lower limit: (𝑋! + 𝑡"&', ) , ∞)
"
95% CI: Example 2
Let’s assume that cholesterol levels of male population follow a normal distribution.
Ten men are randomly selected and their average serum cholesterol was 175mg/dL.
Given the sample standard deviation of 15 mg/dL:

Construct the 95% CI for the true mean serum cholesterol level.
Variance Estimation
Let 𝑋' , 𝑋% , …, 𝑋" represent a simple random sample of size 𝑛 from a population
with mean 𝜇 and variance 𝜎 % .
The sample variance 𝑠 % is an unbiased estimator of 𝜎 % :
"

𝐸(4 𝑋, − 𝑋! % /(𝑛 − 1)) = 𝜎 %


,-'

Suppose that 𝑠 % is the sample variance of a random sample from a normal


distribution with variance 𝜎 % . It can be shown that:

! ! .! ("&')+ ! %
𝑠 % ~ "&' "#$
→ !!
~𝜒"&' ,
"
where 𝜒#(! is the Chi-squared distribution with (n-1) df.
CI for 𝜎 ! using 𝜒 ! distribution
A 100 x (1-α)% confidence interval for the population variance 𝜎 % is given by:
("&')+ ! ("&')+ !
!
."#$,$#&/!
, !
."#$,&/!
.

Note: this interval is valid under the assumption that the underlying population
distribution is normal.
Hypothesis Testing
• Hypothesis testing provides a framework for making decisions on an objective basis
rather than on a subjective basis by simply looking at the data.

• Objective basis – evaluation of the relative probabilities of different hypotheses.

The null hypothesis (𝐻8): hypothesis to be tested


vs.
The alternative hypothesis (𝐻! 𝑜𝑟 𝐻9 ): hypothesis contradicting the null

***Note that our decisions will always be with respect to the null hypothesis***
Hypothesis Testing: Motivation
Court room example - assume innocence until proven guilty.

𝐻8: the accused is innocent


vs.
𝐻!: the accused is not innocent

Decisions:
1. There is not enough evidence to show that the hypothesis of innocence is false
(fail to reject 𝐻8).
OR
2. There is enough evidence to show that the accused is not innocent
(reject 𝐻8).
Hypothesis Testing: Decision Table
Decision

Truth Fail to reject 𝐻8 Reject 𝐻8

𝐻8 is true Correct Decision Type I Error (α)

𝐻8 is false Type II Error (β) Correct Decision

Type I error : P(reject 𝐻8|𝐻8 is true) (type I = alpha =significance level)


Type II error : P(fail to reject 𝐻8|𝐻8 is false)
Power of a test: 1– type II error = P(reject 𝐻8|𝐻8 is false) (e.g., 0.80, 0.90)
Type I error and type II are inverse proportional. Type I increases -> type II decreases
Type I and Type II Errors
How to Conduct Hypothesis Testing
1. State the question of interest!
2. Specify the parameter of interest; set up the null/alternative hypotheses and the
significance level;
3. Clearly state the statistical methodology to be used and assumptions - why?;
4. Collect the data;
5. State the test statistic and determine the critical region/p-value;
6. Interpret the findings in the context of the question/problem;
7. Draw conclusions and compare the results to other findings (if available).
One-Sample, 1-sided Tests
Tests for the Mean of a Normal Distribution with Known Variance
𝐻1 : 𝜇 = 𝜇1 vs 𝐻' : 𝜇 < 𝜇1 𝐻1 : 𝜇 = 𝜇1 vs 𝐻' : 𝜇 > 𝜇1

With significance level α pre-specified, With significance level α pre-specified,


compute the test statistic: compute the test statistic:
# (
$&2 # (
$&2
𝑧= . 𝑧= .
!/ " !/ "
Reject 𝐻1 : if 𝑧 < 𝑧) Reject 𝐻1 : if 𝑧 > 𝑧'&)
Fail to reject 𝐻1 : if 𝑧 ≥ 𝑧) Fail to reject 𝐻1 : if 𝑧 ≤ 𝑧'&)

𝑧! is called the critical value and it’s ‘fixed.’


Values can be found in tables or using software (R).
One-Sample, 1-sided Tests
Tests for the Mean of a Normal Distribution with Known Variance
𝐻1 : 𝜇 = 𝜇1 vs 𝐻' : 𝜇 < 𝜇1 𝐻1 : 𝜇 = 𝜇1 vs 𝐻' : 𝜇 > 𝜇1

Critical or Critical or
Rejection Region Rejection Region
One-Sample, 2-sided Tests
Tests for the Mean of a Normal Distribution with Known Variance
𝐻1 : 𝜇 = 𝜇1 vs 𝐻' : 𝜇 ≠ 𝜇1

With significance level α pre-specified,


compute the test statistic:
# (
$&2
𝑧= .
!/ "
Reject 𝐻1 : if 𝑧 > 𝑧'&)/%
Fail to reject 𝐻1 : if |𝑧| ≤ 𝑧'&)/% Critical Region Critical Region

𝑧!"#/% is called the critical value and it’s ‘fixed.’


One-Sample, 1-sided Tests
Tests for the Mean of a Normal Distribution with Unknown Variance
𝐻1 : 𝜇 = 𝜇1 vs 𝐻' : 𝜇 < 𝜇1 𝐻1 : 𝜇 = 𝜇1 vs 𝐻' : 𝜇 > 𝜇1

With significance level α pre-specified, With significance level α pre-specified,


compute the test statistic: compute the test statistic:
# (
$&2 # (
$&2
𝑡= . 𝑡= .
+/ " +/ "
Reject 𝐻1 : if 𝑡 < 𝑡"&',) Reject 𝐻1 : if 𝑡 > 𝑡"&','&)
Fail to reject 𝐻1 : 𝑡 ≥ 𝑡"&',) Fail to reject 𝐻1 : 𝑡 ≤ 𝑡"&','&)

𝑡&"!,# is called the critical value and it’s ‘fixed.’


One-Sample, 2-sided Tests
Tests for the Mean of a Normal Distribution with Unknown Variance
𝐻1 : 𝜇 = 𝜇1 vs 𝐻' : 𝜇 ≠ 𝜇1

With significance level α pre-specified, compute the test statistic:


# (
$&2
t= .
+/ "
Reject 𝐻1 : if 𝑡 > 𝑡"&','&)/%
Fail to reject 𝐻1 : if |𝑡| ≤ 𝑡"&','&)/%

𝑡&"!,!"#/% is called the critical value and it’s ‘fixed.’


Hypothesis Testing: Example
A lab is testing a new drug to reduce the infarct size in patients who have a myocardial
infarction (MI) within the past 24h. Suppose we know that in untreated patients, the
mean infarct size is 25 units. Further, in 40 patients treated with this drug, the mean
infarct size is of 16 units with a sample standard deviation of 10.

Do treated patients truly have a different infarct size? Assume α=0.05.


Hypothesis Testing: Example
A lab is testing a new drug to reduce the infarct size in patients who have a myocardial
infarction (MI) within the past 24h. Suppose we know that in untreated patients, the
mean infarct size is 25 units. Further, in 40 patients treated with this drug, the mean
infarct size is of 16 units with a sample standard deviation of 10.

Do treated patients truly have a mean infarct size less than 25? Assume α=0.05.
Confidence Intervals vs Hypothesis Test
Suppose we are testing: 𝐻1 : 𝜇 = 𝜇1 vs 𝐻' : 𝜇 ≠ 𝜇1 .

𝐻1 is rejected with a two-sided level α test if and only if the two-sided


100% x (1- α) confidence interval for 𝜇 does not contain 𝜇1 .

𝐻1 is not rejected with a two-sided level α test if and only if the two-sided
100% x (1- α) confidence interval for 𝜇 does contain 𝜇1 .

The CI represents the ‘fail to reject’ region of the two-sided hypothesis


test.
P-values: Two-Sided Test
A p-value is the probability of observing something as extreme or more extreme when the null
hypothesis is true.

The p-values for one-sample, 2-sided, t-test for the mean of a normal distribution is given by:
) "
*+,
• If the observed value of the test statistic is: 𝑡 = ≤ 0, then:
-/ .

P-value = 2×P(𝑡.+/ < 𝑡|𝐻0 ),


P-value is 2 times the area under a 𝑡.+/ distribution to the left of the observed t (test statistic)

) "
*+,
• If the observed value of the test statistic is: 𝑡 = > 0, then:
-/ .

P-value = 2×P 𝑡.+/ ≥ 𝑡 𝐻0 = 2×[1 − P 𝑡.+/ ≤ 𝑡 𝐻0 ]


P-value is 2 times the area under a 𝑡.+/ distribution to the right of the observed t (test statistic)
P-values: Illustration
A p-value is the probability of observing something as extreme or more extreme when
the null hypothesis is true.
P-value: Interpretation
A p-value is the probability of observing something as extreme or more extreme when
the null hypothesis is true.

• If p-value < α, then we reject the null hypothesis at significance level α.

• A large p-value indicates weak evidence against the null.


• A p-value=0.4 means that data such as ours would occur 40% of the time if the null is
true, so not enough evidence to reject.

• A small p-value indicates strong evidence against the null.


• A p-value=0.001 means that data such as ours would occur 0.1% of the time if the null is
true; so we observe something very unlikely if the null were true.

• P-values should be carefully used and not (ab)used.


• P=0.05 can be deceiving and have no clinical significance
Readings
• Rosner, Fundamentals of Biostatistics 8th edition:

• Chapters 6 and 7: focus on the definitions and examples

You might also like