Lecture 5
Lecture 5
1
Introduction
In the real world, the values of population parameters are fixed
and usually not known.
Instead, we must try to say something about the way in which
a variable is distributed using the information contained in a
sample of observations.
The process of drawing conclusions about an entire population
based on the data in a sample is known as statistical inference.
Two broad categories: Estimation and Hypothesis testing.
2
Estimation
Is concerned with estimating the values of specific population
parameters based on sample statistic.
Is about using information in a sample to make estimates of the
characteristics (parameters) of the source population.
5
Point versus Interval Estimators
♣ An estimator that represents a "single best guess" is called a
point estimator.
Thus,
A point estimate is of the form: [ Value ],
7
Estimating the Sampling Error
9
The sampling error is dependent on sample size (n) and the
10
Example
Suppose that the mean ± sd of DBP on 20 old males is 78.5 ± 10.3
mm Hg.
11
The following table gives the se for mean of DBP for different
sample sizes.
Our best estimate of µ is 78.5.
12
1. Point Estimate
A single numerical value used to estimate the corresponding
population parameter.
Sample Statistic are Estimators of Population Parameters
Sample mean, µ
Sample variance, S2 2
Sample P or π
proportion, p OR
Sample Odds Ratio,
RR
OŔ
ρ 13
Sample Relative Risk, RŔ
2. Interval Estimation
Interval estimation specifies a range of reasonable values for
the population parameter based on a point estimate.
A confidence interval is a particular type of interval estimator.
Confidence Intervals
Give a plausible range of values of the estimate likely to include
the “true” (population) value with a given confidence level.
An interval estimate provides more information about a
population characteristic than does a point estimate
14
CIs also give information about the precision of an estimate.
16
A confidence interval has 3 components:
population parameter
A percentage (less than 100%)
Example: 95%
Also written (1 - α) = .95
18
Definition of 95% CI
1. Probabilistic interpretation:
If all possible random samples of a given sample size were obtained
and if each were used to obtain its own CI, then 95% of all such CIs
would contain the unknown population parameter; the remaining 5%
would not.
2. Practical interpretation
When sampling is from a normally distributed population with known
standard deviation, we are 100 (1-α) [e.g., 95%] confident that the
single computed interval contains the unknown population
parameter. 19
Estimation for Single Population
20
1. CI for a Population Mean (normally distributed)
21
Assumptions
Population standard deviation () is known
23
Finding the Critical Value
24
Margin of Error
(Precision of the estimate)
25
Factors Affecting Margin of Error
28
b. 2.25
1.52 1.96 1.52 1.96(.27)
32
1.52 .53 (.99, 2.05)
29
When constructing CIs, it has been assumed that the standard
deviation of the underlying population, , is known
What if is not known?
30
Example: It was found that a sample of 35 patients were 17.2
minutes late for appointments, on the average, with SD of 8
minutes. What is the 90% CI for µ? Ans: (14.98, 19.42).
Since the sample size is fairly large (>30) and the
population SD is unknown, we assume the distribution
of sample mean to be normally distributed based on
the CLT and the sample SD to replace population .
31
B. Unknown variance
(small sample size, n ≤ 30)
What if the for the underlying population is unknown and
the sample size is small?
32
33
Student’s t Distribution
The t is a family of continuous probability distributions
Bell Shaped
35
Student’s t Table
36
t distribution values
With comparison to the Z value
37
Example
Standard error =
38
39
2. CIs for population proportion, p
Confidence coefficient
40
41
42
Lower limit = Point Estimate - (Critical Value) x (Standard
Error of Estimate)
Upper limit = Point Estimate + (Critical Value) x (Standard
Error of Estimate)
Hence,
43
Example 1
A random sample of 100 people shows that 25 are left-
handed. Form a 95% CI for the true proportion of left-
handers.
44
Interpretation
45
Example
It was found that 28.1% of 153 cervical-cancer cases had never
had a Pap smear prior to the time of case’s diagnosis. Calculate
a 95% CI for the percentage of cervical-cancer cases who never
had a Pap test.
46
Sample size Determination
Too small sample size :
May fail to detect an important effect
48
Steps to determine sample size:
1. Specify tolerable error (i.e., desired precision and confidence
level via d and )
4. Solve for n
50
Examples
1. A survey is being planned to determine what proportion of
families in a certain area are medically indigent. It is found
that the proportion is 0.35 from previous studies. A 95%
confidence interval is desired with d=5% What size sample of
families should be selected?
2. Suppose that you are interested to know the proportion of
infants who breastfed >18 months of age in a rural area.
Suppose that in a similar area, the proportion (p) of breastfed
infants was found to be 0.20. What sample size is required to
estimate the true proportion within ±3% points with 95%
confidence. Let p=0.20, d=0.03, α=5%
52
Example
3. Suppose that for a certain group of cancer patients, we are
interested in estimating the mean age at diagnosis. We would like
a 95% CI and wants margin of error of 2 units.
= 1.96*1.96*124 = 119
2*2
53
Suppose there is no prior information about the proportion
(p) who breastfeed
54
An estimate of p is not always available.
56
Using design effect
The loss of effectiveness by the use of cluster sampling,
instead of simple random sampling, is the design effect.
The design effect is basically the ratio of the actual variance,
under the sampling method actually used, to the variance
computed under the assumption of simple random
sampling
Using design effect cont.…
When simple and systematic random sampling
techniques are used design effect is one.
When clustering sampling technique is used design
effect is two.
When multi stage sampling technique is used design
effect is equal to the number of stages.
Hypothesis Testing
60
Introduction
In statistical analyses hypotheses are formulated, experiments are
performed, and results are evaluated for their consistency (non-
consistency) with a hypothesis.
Hypothesis Testing (HT) provides an objective framework for making
decisions using probabilistic methods.
The purpose of HT is to aid the clinician, researcher or administrator
in reaching a decision (conclusion).
61
Hypothesis
A statistical hypothesis is an assumption, claim or a statement
which may or may not be true concerning one or more
populations.
Is a statement about one or more population parameter
62
Examples of Research
Hypotheses
Population Mean
The average length of stay of patients admitted to the hospital is five
days
The mean birth weight of babies delivered by mothers with low SES is
lower than those from higher SES.
Population Proportion
The proportion of adult smokers in Harar is P = 0.40
65
2. The Alternative Hypothesis, HA
Is a statement what we will believe is true if our sample data causes
us to reject Ho.
Is generally the hypothesis that is believed(or needs to be supported)
by the researcher.
Is a statement that disagrees (opposes) with Ho (The effect of
interest is not zero).
Never contains “=” , “ ≤” or “≥ ” sign
69
Decision Rule
The decision to reject or not to reject the Ho is based on the
magnitude of the test statistic.
An example of a test statistic is the quantity
70
Rejection and Non-Rejection
Regions
The values the test statistic assume on the horizontal axis of the
normal distribution and are divided into two groups:
Rejection region, and
Non-rejection region.
The values of the test statistic forming the rejection region are less
likely to occur if the Ho is true.
The values making the non-rejection region are more likely to occur
if the Ho is true.
71
Example: Two-sided test at α
5%
= 0.025 = 0.025
0.95
-1.96 1.96
72
Statistical
Decision
Reject Ho if the value of the test statistic that we compute from our
sample is one of the values in the rejection region
Don’t reject Ho if the computed value of the test statistic is one of
the values in the non-rejection region.
73
Level of
Significance, α
Is the probability of rejecting a true Ho (type 1 error)
74
One tail and two tail
tests
In a one tail test, the rejection region is at one end of the distribution or the
other.
In a two tail test, the rejection region is split between the two tails.
75
76
Types of Errors in
Hypothesis Tests
Whenever we reject or accept the Ho, we commit errors.
77
Type I Error
The error committed when a true Ho is rejected
78
Type II Error
The error committed when a false Ho is not rejected
The probability of Type II Error is
Power
The probability of rejecting the Ho when it is false.
Power = 1 – β = 1- probability of type II error
We would like to maintain low probability of a Type I error (α)
And low probability of a Type II error (β) [high power = 1 - β].
79
Action Reality
(Conclusion)
Ho True Ho False
80
Type I & II Error
Relationship
81
1. Hypothesis Testing of a Single
Mean
(Normally Distributed)
82
1.1 Known
Variance
83
Example:
1. A simple random sample of 10 people from a certain population
has a mean age of 27. Can we conclude that the mean age of the
population is not 30? The variance is known to be 20 and
population is normally distributed. Take α = .05.
Data : n = 10, sample mean = 27, 2 = 20, α = 0.05
84
State the Hypotheses
Ho: µ = 30
HA: µ ≠ 30
Test statistic
As the population variance is known, we use Z as the test
statistic.
85
Decision Rule
Reject Ho if the Z value falls in the rejection region.
86
Calculation of test statistic
Statistical decision
87
Hypothesis test using confidence
interval
A problem like the above example can also be solved using a
confidence interval.
A confidence interval will show that the calculated value of Z does
not fall within the boundaries of the interval.
Confidence interval
88
Example: One -Tailed Test
A simple random sample of 10 people from a certain population has a
mean age of 27. Can we conclude that the mean age of the population
is less than 30? The variance is known to be 20. Let α = 0.05.
Data
n = 10, sample mean = 27, 2 = 20, α = 0.05
Hypotheses
Ho: µ ≥ 30, HA: µ < 30
89
Test statistic
Rejection Region
With α = 0.05 and the inequality, we have the entire rejection region at the left.
The critical value will be Z = -1.645. Reject Ho if Z < -1.645.
90
Statistical decision
We reject the Ho because -2.12 < -1.645.
Conclusion
We conclude that µ < 30.
91
Suppose that the Ho and HA take the form
92
1.2 Unknown Variance
In most practical applications the standard deviation of the
underlying population is not known
In this case, can be estimated by the sample standard deviation
s.
If the underlying population is normally distributed, then the test
statistic is:
93
Example: Two-Tailed Test
A random sample of 14 people from a certain population gives a
sample mean body mass index (BMI) of 30.5 and sd of 10.64. Can we
conclude that the BMI is not 35 at α 5%?
Test statistic
If the assumptions are correct and Ho is true, the test statistic follows
Student's t distribution with 13 degrees of freedom.
94
Decision rule
We have a two tailed test. With α = 0.05 it means that each tail is 0.025. The
critical t values with 13 df are -2.1604 and 2.1604. We reject Ho if the t ≤ -
2.1604 or t ≥ 2.1604.
95
Summary
Population mean, known population variance (or standard
deviation): Normal test.
Population mean, Unknown population variance (or standard
deviation) and small sample: Student’s t-test.
Single population proportion: Normal test.
96
Hypothesis Tests for
Proportions
Involves categorical values
97
Hypothesis Testing for Population Proportion
98
Example
We are interested in the probability of developing asthma over a
given one-year period for children 0 to 4 years of age whose mothers
smoke in the home.
In the general population of 0 to 4-year-olds, the annual incidence of
asthma is 1.4%. If 10 cases of asthma are observed over a single year
in a sample of 500 children whose mothers smoke, can we conclude
that this is different from the underlying probability of p0 = 0.014?
alpha = 5% H0 : p = 0.014
HA: p ≠ 0.014
99
The test statistic is given by:
100
The critical value of Zα/2 at α=5% is ±1.96.
101
Chi-squared
test
The Chi-squared test measures the disparity between observed
frequencies (data from the sample) and expected frequencies.
Helps to check association between categorical variables.
Expected Frequency (E) for i th row and the jth column ( Eij )
( row i total ) ( column j total ) ri c j
Eij
sample size n
ri row i total c j column j total n total sample size
Consider the following 2X2 table. Is there association between wearing Helmet and head injury??
Use 95% confidence level.
Head injury Wearing helmet
Yes No Total
Yes 17 218 235
Step 1: hypothesis
No 4 34 38
Step 4: decision: since 17.6>3.84 then reject the null hypothesis and
decide as there is association between eating sandwich and
gastrointestinal pain
Parametric vs nonparametric
test
Statistical methods which depend on the assumptions about
the distribution of parameters in the population are referred
to as parametric methods
Parametric tests include t-test, ANOVA, Regression,
Correlation, and so on
To use a parametric test, we must assume a normal
distribution for the dependent variable, equality of variance
where populations are compared, and large sample size
However, in real research situations things do not come with
labels detailing the characteristics of the population of origin
111
01/19/25
Parametric vs
nonparametric test
Non-parametric statistics (we call sometimes distribution free
statistics) were designed to be used when we know nothing
about the distribution of the variable of interest in the
population
It requires fewer assumptions about the population
probability distribution
It also handles data collected in the form of ranking
Nonparametric methods are often the way to analyze
nominal or ordinal data and draw statistical112conclusions.
01/19/25
Parametric vs
nonparametric test
More generally, a nonparametric method has the following
advantages;
Methods are quick and easy to apply.
More powerful when the assumptions of normality have been
violated.
Can be used with small sample size.
•Not affected by the presence of outliers.
•Less sensitive for measurement error as it uses ranks.
•Inherently robust due to lack of stringent assumption.
113
01/19/25
Parametric Versus Non-
parametric tests
Parametric Non-parametric
Unpaired t- Wilcoxon rank sum test/
test Mann-Whitney-Wilcoxon Test
Paired t-test Wilcoxon signed rank test
One way Kruskal-Wallis test
ANOVA
114
01/19/25
1. Wilcoxon Signed-
Rank Test
This test is the nonparametric alternative to the
parametric matched-sample test.
01/19/25
116
1. Wilcoxon Signed-Rank Test
(cont’d)
Stata outputs
01/19/25 117
2. Wilcoxon rank-sum test / Mann-
Whitney-Wilcoxon Test
It is frequently used as the nonparametric analogy of the
Student’s t-test to compare two sets.
118
01/19/25
2. Wilcoxon rank-sum test / Mann-
Whitney-Wilcoxon Test (cont’d)
This method tests to determine whether the two
populations are identical.
119
01/19/25
2. Wilcoxon rank-sum test /
Mann-Whitney-Wilcoxon Test
(cont’d)
01/19/25
120
2. Wilcoxon rank-sum test /
Mann-Whitney-Wilcoxon Test (cont’d)
Stata outputs
01/19/25 121
2. Wilcoxon rank-sum test /
Mann-Whitney-Wilcoxon Test
(cont’d)
Student class activity 1
1. Check the existence of length difference among male
and female infants (assume that normality
distribution is violated even after transformation )
01/19/25 122
3. Kruskal-Wallis
Test
For a Gaussian outcome the means of three or more
independent groups are compared by one-way ANOVA.
123
01/19/25
3. Kruskal-Wallis Test
(cont’d)
The Mann-Whitney-Wilcoxon test can be used to test whether two
populations are identical.
The MWW test has been extended by Kruskal and Wallis for cases
of three or more populations.
01/19/25
125
3. Kruskal-Wallis Test (cont’d)
Stata outputs
01/19/25 127
Spearman rank correlation
• Measures the strength and direction of association between
two variables that are measured on an ordinal or
continuous scale.
• The Spearman correlation coefficient is often denoted by
the symbol rs (or the Greek letter ρ, pronounced rho).
• It is a useful test when Pearson's correlation cannot be run
due to violations of normality, a non-linear relationship or
when ordinal variables are being used.
• Stata code: spearman variable 1 variable 2 or using menu
bar Statistics > Nonparametric analysis > Tests of hypotheses >
Spearman's rank correlation
01/19/25 128
Quiz
Write null and alternative hypothesis for the following statements (1&2).
5. Researcher who is rejecting true null hypothesis when in fact it is True is committing which
Type of errors? A. Type one error
129
THE END OF THE COURSE
THANKS!!!
130