You are on page 1of 170

Statistical 

Inference 
Statistical Inference
#4

Wakgari Deressa, PhD.


Department of Preventive Medicine
School of Public Health, AAU
• Th
The process off drawing
d i conclusions
l i about
b t an
entire population based on the data in a
samplel is
i known
k as statistical
t ti ti l inference.
i f
• Methods of inference usually fall into one of
two broad categories: estimation or
hypothesis testing.
• We will focus on using the observations in a
sample to estimate a population parameter
E ti ti
Estimation
• Is
Is concerned with estimating the values of 
concerned with estimating the values of
specific population parameters based on 
sample statistics
sample statistics.

• iis about using information in a sample to make 
b i i f i i l k
estimates of the characteristics (parameters) 
of the source population.
f h l i
Example
p
• A sample survey revealed:
– Proportion of smokers among a certain
group of population aged 15 to 24.
– Mean of SBP among sampled population
– Prevalence of HIV-positive among people
involved in the study

The next question is what can we predict


about the characteristics of the population
from which the sample
p was drawn
Estimation Estimator & Estimate
Estimation,
♣ Estimation is the computation of a statistic from 
sample data, often yielding a value that is an 
approximation (guess) of its target, an unknown true 
population parameter value.
♣ The statistic itself is called an estimator
The statistic itself is called an estimator and can be 
and can be
of two types ‐ point or interval.
♣ The value or values that the estimator assumes are 
Th l l h h i
called estimates.
• Two methods of estimation are commonly
used: point estimation and interval
estimation
• Point estimation involves the calculation of a
single number to estimate the population
parameter
• Interval estimation specifies a range of
reasonable values for the parameter
p
Point vs.
vs Interval Estimators
• An estimator that represents a "single best 
guess" is called a point estimator.

• When the estimate is of the form of a "range 
of plausible values", it is called an interval 
of plausible values it is called an interval
estimator. 
1 Point Estimate
1.
• A single numerical value used to estimate
the corresponding population parameter.
Sample Statistics are Estimators of Population Parameters
Sample mean, µ
Sample variance, S2 2
Sample proportion, P or π
S
Sample
l Odd
Odds R
Ratio,
ti OŔ OR
Sample Relative Risk, RŔ RR
Sample correlation coefficient,
coefficient r ρ
2 IInterval
2. t lEEstimation
ti ti
• Interval estimation specifies
p a range
g of
reasonable values for the population
parameter based on a p
p point estimate.

• A confidence interval is a particular type of


interval estimator.
Confidence Intervals
• An interval estimate provides more
information about a population characteristic
than does a point estimate
• Such interval estimates are called confidence
intervals.
• CIs also give information about the precision
of an estimate.
estimate
• How much uncertainty is associated with a
point estimate of a population
pop lation parameter?
• When sampling variability is high,
high the CI will
be wide to reflect the uncertainty of the
observation.
observation
• Wider CIs indicate less certainty.
• CIs can also answer the question of whether
or not an association exists or a treatment is
beneficial or harmful. (analogous to p‐
values…))
e.g.,  if the CI of an odds ratio includes the value 1.0 we 
cannot be confident that exposure is associated with 
disease.
di
General Formula:
The general formula for all CIs is:
The value of the statistic in my sample
(eg., mean, odds ratio, etc.)

point estimate  (measure of how confident we


want to be)  (standard error)

From a Z table
F bl or a T table,
bl depending
d di
on the sampling distribution of the
statistic.

Standard error of the statistic.


Lower limit = Point Estimate - (Critical Value) x (Standard Error)

Upper
pp limit = Point Estimate + ((Critical Value)) x ((Standard Error))

• A wide interval suggests imprecision of


estimation.
ti ti
• Narrow CI widths reflects large sample
size
i or low
l variability
i bilit or both.
b th

• Note: Measure of how confident we want to be =


critical value = confidence coefficient
C fid
Confidence Level
L l
• Confidence Level
Confidence Level
– Confidence in which the interval will contain the 
unknown population parameter
unknown population parameter
• A percentage (less than 100%)
– Example: 95%
Example: 95%
• Also written (1 ‐ α) = .95
Definition: 95% CI
When sampling is from a normally distributed
population with known standard deviation,
we are 100 (1
(1‐α)
α) [e.g.,
[e g 95%] confident that the
single computed interval contains the
unknown population parameter.
parameter
Estimation for Single Population
• The standard normal distribution (Z‐distribution) is
used in interval estimates.
• It is also used to make both one and two‐tailed
tests.
• However, it should be noted that the Z‐test is
applied when the distribution is normal and the
population
l ti standard d i ti  is
t d d deviation i known
k or when
h
the sample size n is large ( n  30) and with
unknown  (by taking S as estimator of ) .
1. CI for a Single Population
1
Mean (normally distributed)
A. Known variance (large sample size)
• There are 3 elements to a CI:
1. P
1 Point
i t estimate
ti t
2. SE of the point estimate
3. Confidence coefficient
• Consider the task of computing a CI
estimate of μ for a population distribution
that is normal with σ known.
known
• Available are data from a random sample of
size = n.
Assumptions
 Population standard deviation () is known
 Population is normally distributed
 If population is not normal, use large sample
• A 100(1-)% C.I. for  is:

  is
i tto b
be chosen
h b
by th
the researcher,
h mostt common values
l off  are 0.05,
0 05
0.01 and 0.1.
3. Commonly used CLs are 90%, 95%, and
99%
Finding the Critical Value
Margin
g of Error
(Precision of the estimate)
Example:
p
1. Waiting times (in hours) at a particular hospital are
believed to be approximately normally distributed
with a variance of 2.25 hr.
a. A sample of 20 outpatients revealed a mean
waiting time of 1.52 hours. Construct the 95% CI
for the estimate of the population mean.
b. Suppose that the mean of 1.52 hours had resulted
from a sample of 32 patients.
patients Find the 95% CI.
CI
c. What effect does larger sample size have on the
CI?
a
a. 2.25
1.52  1.96  1.52  1.96(.33)
20
 1.52  .65  (.87, 2.17)
• We are 95% confident that the true mean waiting time is
between 0.87 and 2.17 hrs.

• Although
g the true mean may y or may
y not be in this interval, 95%
of the intervals formed in this manner will contain the true mean.

• An incorrect interpretation is that there is 95% probability that


this
interval contains the true population mean.
b.
2.25
1.52  1.96  1.52  1.96(.27)
32
 1.52  .53  ((.99, 2.05)

c. The larger the sample size makes the CI


narrower (more precision).
• When constructing CIs, it has been assumed
that the standard deviation of the underlying
population,  , is known
• What if  is not known?
• In practice, if the population mean μ is
unknown,, then the standard deviation,,
, , is
probably unknown as well.
• In this case,
case the SE of the population can be
replaced by the SE of the sample if the
sample size is large enough (n>30). With
large sample size, we assume a normal
distribution.
• 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.
minutes What is the 90% CI for µ? Ans: (15.0,
(15 0 19.4).
19 4)
• Since the sample size is fairly large (>30) and the population
SD is unknown, we assume the distribution of sample mean
t be
to b normally
ll distributed
di t ib t d based
b d on the th CLT andd the
th samplel
SD to replace population .
B. Unknown variance
(small sample size, n ≤ 30)
• What if the  for the underlying population is 
What if the  for the underlying population is
unknown and the sample size is small (n30 )?
• As an alternative we use Student Student’ss t
distribution.
Student’s t Distribution
• The t is a family of distributions
• The distribution is symmetrical,
symmetrical bell‐shaped,
bell‐shaped and
similar to the normal but more spread out.
• Flatter than the Normal (0,1). This means
( )
– The variability of a t is greater than that of a Z that is
normal(0,1)
– Thus, there is more area under the tails and less at center
– Because variability is greater, resulting confidence
intervals will be wider.
• For large sample sizes (n  30), both t and Z curves
are so close together and it does not much matter
which one you use.
use

• As the degrees of freedom decrease,


decrease the t‐
distribution becomes increasingly spread out
compared with the normal.
• Note: t approaches z as n increases
What happens as sample gets larger?

T-distribution and Standard Normal Z distribution

0.4
Z distribution
0.3
density

0.2 T with 60 d.f.


d

0.1

00
0.0

-5 0 5
Value

As the df gets larger, the student’s t-distribution looks more and more
like the SND with mean=0 and variance=1.
What happens to CI as sample gets larger?

 s 
x  Z 
For large samples:
g p
Z and t values 
 n become almost
become almost 
identical, so CIs are 

 s 
almost identical.

x  t 
 n
Degrees of Freedom (df)
df = Number of observations that are free to vary after
sample mean has been calculated
df = n-1
Student’s
Student s t Table
t distribution
di ib i values
l
• With comparison to the Z value
Example
Example

• Standard error =
• t-value at 90% CL at 19 df =1.729
E
Exercise
i
• Compute a 95% CI for the mean birth
weight based on n = 10, sample mean =
116 9 oz and s =21.70.
116.9 =21 70
• From the t Table, t9, 0.975 = 2.262
• Ans:
A (101 4 132.4)
(101.4, 132 4)
2. CIs for single population
2
proportion, p

• Is based on three elements of CI.


– Point estimate
– SE of point estimate
– Confidence coefficient
Lower limit = Point Estimate - (Critical Value) x (Standard Error of Estimate)

Upper limit = Point Estimate + (Critical Value) x (Standard Error of Estimate)

Hence,

is an approximate 95% CI for the true proportion p.


p
Example 1
• A random sample of 100 people shows that
25 are left-handed.
l ft h d d Form
F a 95% CI for
f the
th
true proportion of left-handers.
Interpretation
Changing the sample size
Example 2
• It was found that 28.1% of 153 cervical-cancer cases
had never had a Pap smear prior to the time of case
case’s
s
diagnosis. Calculate a 95% CI for the percentage of
cervical-cancer cases who never had a Pap test.


Example
p 3
• Suppose that among 10,000 female operating-room
nurses, 60 women have developed breast cancer over
five years. Find the 95% for p based on point estimate.
• Point estimate = 60/10,000 = 0.006
• The 95% CI for p is given by the interval:

• The 95% CI for p is:


Estimation for Two Populations
3. CI for the difference between
population
l ti means (normally
( ll distributed)
di t ib t d)

A. Known variances (2 independent samples)


A
• When 1 and 2 are known and both
populations are normal or both sample sizes
are at least 30, the test statistic is a z-
value…
value
A
Assumptions
ti
• Samples are randomly and independently
drawn
• Population distributions are normal or
both sample sizes are ≥30
• Population
P l ti standard
t d dd deviations
i ti are kknown
Illustration
• A researcher performs a drug trial
involving two independent groups.
groups
– A control group is treated with a placebo
while separately;
while,
– The intervention group is treated with an
active agent.
g
– Interest is in a comparison of the mean
control response with the mean
inter ention
intervention response under
nder the
assumption that the responses are
independent.
p
Examples
• We are interested in the similarity of the
two groups.
groups
1) Is mean blood pressure the same for males and
females?
2) Is body mass index (BMI) similar for breast
cancer cases versus non-cancer patients?
3) Is length of stay (LOS) for patients in hospital “A”
the same as that for similar patients in hospital
“B”?
Example
p
• Researchers are interested in the difference between
serum uric acid levels in patients with and without
Down’s syndrome.
syndrome
• Patients without Down’s syndrome
– n=12,
n=12 sample mean=4
mean=4.5 mg/100ml, 2=1.0
5 mg/100ml =1 0
• Patients with Down’s syndrome
– n=15,
15 sample
l mean=3.4 /100 l 2=1.5
3 4 mg/100ml, 15
• Calculate the 95% CI.
• SE = 00.43,
43 95% CI = 1
1.1
1 ± 1.96
1 96 (0
(0.43)
43) = (0
(0.26,
26 11.94)
94)
• WE are 95% confident that the true difference between
the two population means is between 0.26 and 1.94.
B. Unknown variances
B
(Independent samples)
I. Population variances equal (large sample)
• Assumptions:
– Samples are randomly and independently drawn
– Both sample sizes are ≥30
– Population standard deviations are unknown
Forming confidence estimates:
• Use sample standard deviation s to
estimate , and
• the test statistic is a zz-value
value
Example
• The mean CD4 + cells for 112 men with HIV
infection was 401.8
401 8 with a SD of 226.4.
226 4 For 75
men without HIV, the mean and SD were 828.2
and 274.9, respectively. Calculate a 99% CI for
the difference between population means.
• SE of the difference b/n two means = 38.28
38 28
• 99% CI = 426.4 ± 2.58 (38.28)
= (327.6,
(327 6 525
525.2)
2)
II P
II. Population
l ti variances
i equall (small
( ll
sample)
• Assumptions:
– Populations are normally distributed
– The populations have equal variances
– Samples are independent
– Both sample sizes are <30
– Population
p standard deviations are unknown

* If 0.5  s12/s22  2 then we assume that the population variances


are equal.
l
F
Forming
i confidence
fid estimates:
ti t
• The population variances are assumed
equal, so use the two sample standard
deviations and pool them to estimate 
• The test statistic is a t value with (n1 + n2 –
2) degrees of freedom
• The pooled estimate (s2p) is the weighted
average off the
th two
t samplel variances.
i
• The pooled standard deviation is :

• The standard error of the estimate is given


by:
Example 1
• A study was conducted to compare the serum iron levels
of children with cystic fibrosis to those of healthy
children. Serum iron levels were measured for random
samples of n1 = 9 healthy children and n2 = 13 children
with
ith cystic
ti fibrosis.
fib i
• The two underlying populations of serum
iron levels are independent and normally
distributed.
A t-value at 95% CL with 20 df is
2.086
Example 2
• Birth weights of children born to 14 heavy
smokers (group 1) and to 15 non-smokers
(group 2) were sampled from live births at a
large teaching hospital.
hospital For the heavy
smokers, sample mean = 3.17 kg, SD =
0 46 and for non-smokers,
0.46 non-smokers sample mean =
3.63 kg and SD = 0.36.
• Sp = 0.4121,
0 4121 SE = 0.1531,
0 1531 t-value
t l att 27 df = 2.05
2 05
• 95% CI = (0.14, 0.77)
III. Population variances unequal
III
(small sample)

• The confidence interval for μ1-μ


μ2 is:
• Where the degree of freedom (d’) is given
y
by:
Example
• For a t distribution with 19 df at 95% CL tt-
value is 2.093.
• Therefore,
Th f a 95% confidence
fid i t
intervall
would take the form
• Using the data from two samples of
patients with tuberculosis meningitis, the
95% CI for μ1 − μ2 is
C. Paired Samples
 Tests Means of 2 Related Populations
∆ Paired or matched samples
∆ Repeated measures (before/after)
∆ Use
U difference
diff b t
between paired
i d values:
l
d = x1-x2
 Eliminates
Eli i t variation
i ti among subjects
bj t
 Assumptions:
 Both populations are normally distributed,
 Or, if not normal, use large samples.
Paired Data
• Paired data arises when each individual (more
specifically,
ifi ll each h unit
i off measurement)) ini a
sample is measured twice.

• Measurement might be 
g
"pre/post”, "before/after", “right/left, “parent
/
/child”, etc.
,
Examples of paired data
1) Blood pressure prior to and following treatment,
2) Number of cigarettes smoked per week measured
prior to and following participation in a smoking
cessation program,
3) N b
3)  Number of sex partners in the month prior to and in 
f t i th th i t di
the month following an HIV education campaign.
• Notice in each of these examples p that the two
occasions of measurement are linked by virtue of the
two measurements being made on the same
individual.
• Longitudinal or follow‐up study
Paired differences
• If two measurements of the same
phenomenon
h (
(eg. bl d pressure, #
blood
cigarettes/week, etc) X and Y are measured
on an individual
i di id l andd if each
h is
i normally
ll
distributed, then their difference is also
di ib d normal.
distributed l

• The interest in the difference between two


measurements
• Where tα/2 has n-1 df.
Example
• Ten hypertensive patients are screened at
a neighborhood
i hb h d health
h lth clinic
li i and
d are given
i
methyl dopa, a strong antihypertensive
medication for their condition.
condition They are
asked to come back 1 week later and have
their blood pressures measured again. again
Suppose the initial and follow-up SBPs
((mm Hg)
g) of the p
patients are g
given below.
1. What is the mean and sd of the
difference?
2. What is the standard error of the mean?
3. Assume that the difference is normally
distributed, construct a 95% CI for μ.
Answer
• We have the following data and summary statistics
4. Two Population Proportions
• We are often interested in comparing
proportions
ti from
f 2 populations:
l ti
• Is the incidence of disease A the same in
t
two populations?
l ti ?
• Patients are treated with either drug D, or
with
ith placebo.
l b IsI the
th proportion
ti “improved”
“i d”
the same in both groups?
Confidence Interval for
Two Population Proportions
• SE of the difference =

• The confidence interval for p1 – p2 is:


The following formula is also equally used

• An approximate 95% confidence interval


takes the form
Example
• In a clinical trial for a new drugg to treat hypertension,
yp
N1 = 50 patients were randomly assigned to receive
the new drug, and N2 = 50 patients to receive a
placebo. 34 of the p
p patients receiving g the drugg
showed improvement, while 15 of those receiving
placebo showed improvement.
• Compute a 95% CI estimate for the difference
between proportions improved.
• p1 = 34/50 = 00.68,
68 p2 = 15/50 = 00.30
30
• The point estimate for the difference is:
= [0.68−0.30]=0.38
[ ]

• SE of the difference =

• 95% CI
– Lower = ( p
point estimate ) - ((Zα/2) ((SE))
= 0.38 – (1.96)(0.0925) = 0.20
– Upper = ( point estimate ) + (Zα/2) (SE)
= 0.38
0 38 + (1.96)(0.0925)
(1 96)(0 0925) = 0
0.56
56
• 95% CI = (0.20, 0.56)
Hypothesis Testing

One type of statistical inference
• The majority of statistical analyses involve
comparison, most obviously between
treatments or procedures or between groups
of subjects.
• Hypotheses are formulated, experiments are
performed, and results are evaluated for their
consistency (non-consistency) with a
hypothesis.
hypothesis
• Hypothesis Testing (HT) provides an
objective framework for making decisions
using probabilistic methods
Hypothesis
• Is a statement about one or more
• Is a claim (assumption) about a population
parameter
• Is frequently concerned with the parameters
off the
h population
l i about
b which
hi h the
h statement
is made.
Examples of Research Hypotheses
Population Mean
• The average length of stay of patients
admitted to the hospital is five days
• The mean birthweight of babies
delivered byy mothers with low SES is
lower than those from higher SES.
• Etc
Population Proportion
• The pproportion
p of adult smokers in Addis
Ababa is p = 0.40
• The prevalence of HIV among non non‐married
married
adults is higher than that in married adults
• Etc 
Etc
Types of Hypothesis
1. The Null Hypothesis, H0
 IIs a statement
t t t claiming
l i i th t there
that th i no
is
difference between the hypothesized value
and the population value.
value
 (The effect of interest is zero = no difference)
 States the assumption (hypothesis) to be
tested
 H0 isi a statement off agreement (or
( no
difference)
 H0 is
i always
l about
b t a population
l ti parameter,
t
not about a sample statistic
• Begin with the assumption that the Ho is true
– Similar to the notion of innocent until proven 
p
guilty
• Always contains 
Always contains “=” , , “ ≤≤” or 
or “≥≥ ” sign
sign
• May or may not be rejected
2. The
2 Th Alternative
Alt ti Hypothesis,
H th i HA
• Is a statement of 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
• May or may not be accepted
ay o ay ot be accepted
Steps in Hypothesis Testing
1. Formulate the appropriate statistical
h
hypotheses
th clearly
l l
• Specify HO and HA
H0:  = 0 H0:  ≤ 0 H0:  ≥ 0
H1:   0 H1:  > 0 H1:  < 0
two tailed
two-tailed one tailed
one-tailed one-tailed
one tailed
2. State the assumptions necessary for
computing probabilities
• A distribution is approximately normal (Gaussian)
• Variance is known or unknown
3 Select
3. S l t a sample
l and
d collect
ll t ddata
t
• Categorical, continuous
4. Decide on the appropriate test statistic
for the hypothesis. E.g., One population

OR
5. Specify the desired level of significance
for the statistical test (=0.05, 0.01, etc.)
6. Determine the critical value.
– A value the test statistic must attain to be
declared significant.

-1.96 1.96 1.645 -1.645


7. Obtain sample evidence and compute
the test statistic
8. Reach a decision and draw the
conclusion
• If Ho is rejected, we conclude that HA is
true ((or accepted).
p )
• If Ho is not rejected, we conclude that Ho
may be true.
Rules for Stating Statistical
H
Hypotheses
h
1. One population
p p
• Indication of equality (either =, ≤ or ≥) must
appear in Ho.
Ho: μ = μo, HA: μ ≠ μo
Ho: P = Po, HA: P ≠ Po
• Can we conclude that a certain population
mean is
– not 30?
Ho: μ = 50 and HA: μ ≠ 50
– greater than 50?
Ho: μ ≤ 50 HA: μ > 50
• Can we conclude that the proportion of
patients with leukemia who survive
more than six years is not 60%?
Ho: P = 0.6 HA: P ≠ 0.6
2. Two populations
Ho: μ1 = μ2 HA: μ1 ≠ μ2
Ho: P1 = P2 HA: P 1 ≠ P 2
In summary,
summary
1 What you hope to conclude should be
1.
placed in the HA.
2 The Ho should have a statement of
2.
equality, either =, ≤ or ≥.
3 The
3. Th Ho
H isi the
th hypothesis
h th i that
th t is
i tested
t t d
4. The Ho and HA are complementary.
Hypothesis
yp Testing
g Process
Decision Rule
• Computed from the data of the sample
• 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

• When the variance of the population is


unknown we use
unknown,
R j ti and
Rejection d Non-Rejection
N R j ti Regions
R i
• The values of the test statistic assume the
points 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.
true
• The values making the acceptance (non-rejection)
g
region are more likelyy to occur if the Ho is true.
Example: Two-sided test at α 5%

= 0.025 = 0.025
0.95

-1.96 1.96
Rejection region Non-rejection region Rejection region
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
non rejection region.
region
Level of Significance,
g ,α
• Is the probability of rejecting a true Ho
• Defines unlikely values of sample statistic if Ho is
true
– Defines rejection region
Defines rejection region of the sampling distribution
of the sampling distribution
• The decision is made on the basis of the level of
ssignificance,
g f ca ce, des
designated
g ated by α
α.
• More frequently used values of α are 0.01, 0.05 and
0.10.
• α is selected by the researcher at the beginning
O tail
One t il and
d two
t tail
t il tests
t t
• In a one tail test,
test the rejection region is
at one end of the distribution or the
other.
other
• In a two tail test, the rejection region is
split between the two tails.
tails
• Which one is used depends on the way
th Ho
the H isi written.
itt
Level of Significance
and the Rejection Region
Example:
• The average survival year after cancer
diagnosis is less than 3 years.
Another way to state conclusion
• Reject Ho if P-value < α
• Accept Ho if P-value ≥ α

P-value is the probability of obtaining a test


statistic as extreme as or more extreme
than the actual test statistic obtained if the
Ho is true
The larger the test statistic, the smaller is
the P-value. OR, the smaller the P-value
th stronger
the t th evidence
the id against
i t the
th Ho.
H
P – Value
• If it is small, conventionally less than 0.05, the null 
hypothesis is rejected as implausible. 
• In other words, an outcome that could occur less 
than one time in 20 when the null hypothesis is true 
would lead to the rejection of the null hypothesis. 
j yp
• In this formulation, when we reject the null 
hypothesis we accept a complementary alternative 
hypothesis. 
hypothesis
• If P > 0.05 this is often taken as suggesting that 
insufficient information is available to discount the 
null hypothesis.
ll h h i
P Value
P-Value
• When P is below the cut off level(), say 0.05, the 
result is called statistically significant( and below 
y g (
some lower level, such as 0.01, it may be called 
highly significant); when above 0.05 it is called not 
significant. 
significant.
• It is important to distinguish between the 
significance level and the p – value. 
• The significance level 
h f l l is the probability of making 
h b bl f k
a type I error. 
• This is set before the test is carried out. 
This is set before the test is carried out.
• The P – value is the result observed after the study 
is completed and is based on the observed data.
P Value
P-Value
• It would be better (informative) to give the 
exact values of P; such as, P = 0.02 or P = 0.15 
rather than P < 0.05 or P > 0.05 . 
• It is now increasingly common to see the 
expression of exact values largely due to the
expression of exact values largely due to the 
availability of computer programs which give 
the exact P – values.
the exact P 
C fid
Confidence interval
i t l or p – value?
l ?
• The
The key question in most statistical comparisons is 
key question in most statistical comparisons is
whether an observed difference between two 
groups of subjects in a sample is large enough to be 
evidence of a true difference in the population from 
which the sample was drawn . 
• As shown repeatedly in the previous sections there 
are two standard methods of answering this 
question. 
question
C fid
Confidence interval
i t l or p – value?
l ?
• A 95% confidence interval gives a plausible range of 
g p g
values that should contain the true population 
difference.
• On average, only 1 in 20 of such confidence 
l f h fd
intervals should fail to capture the true difference. 
• If the 95% confidence interval includes the point of 
If the 95% confidence interval includes the point of
zero difference then, by convention, any difference 
in the sample cannot be generalized to the 
population as if there is a significant difference
Confidence interval or p – value?
• Confidence
Confidence intervals and p
intervals and p‐values
values are based upon 
are based upon
the same theory and mathematics will lead to the 
same conclusion about whether a population 
difference exists. 
• Confidence intervals are preferable because they 
give information about the size of any difference in 
the population, and they also (crucially) indicate 
the amount of uncertainty remaining about the size
the amount of uncertainty remaining about the size 
of the difference.
Types
yp of Errors in Hypothesis
yp Tests

• Whenever we reject or accept the Ho, we


commit errors.
• Two types
yp of errors are committed.
– Type I Error
– Type II Error
Type
yp I Error
• The error committed when a true Ho is 
rejected
• Considered a serious type of error
• The
Th probability
b bili off a type I error is i the
h
probability of rejecting the Ho when it is true
• The
Th probability
b bili off type I error is
i α
• Called level of significance of the test
• Set by researcher in advance
Type II Error
• The error committed when a false Ho is not 
rejected
• The probability of Type II Error is 
The probability of Type II Error is 
• Usually unknown but larger than α
Power
• The probability of rejecting the Ho when it is
false.
Power = 1 – β = 1- p
probability
y of type
yp 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 - β].
β]
Action Reality
(Conclusion)
Ho True Ho False

Do not Correct action Type II error (β)


reject Ho ((Prob. = 1-α)) ((Prob. = β
β= 1-Power))

Reject Ho Type I error (α) Correct action


(P b = α = Sign.
(Prob. Si llevel)
l) (P b = P
(Prob. Power = 1
1-β)
β)
Type I & II Error Relationship
Hypothesis Test for One Sample
• Test for single
g mean
• Test for single proportion

Hypothesis Test for Two Samples


• Test for the difference between two
population means
• Test for the difference between two
population proportions
1. Hypothesis Testing of a Single Mean
(N
(Normally
ll Distributed)
Di t ib t d)
1.1 Known Variance
Example:
p Two-Tailed Test
1. A simple random sample of 10 people from a certain
population has a mean age of 27. Can we conclude that
th mean age off the
the th population
l ti is
i nott 30? The
Th variance
i i
is
known to be 20. Let = .05.

• Answer, "Yes we can, if we can reject the Ho that it is 30."


A. Data
n = 10, sample mean = 27, 2 = 20, α = 0.05
B. Assumptions
Si l random
Simple d sample
l
Normally distributed population
C Hypotheses
C.
Ho: μ = 30
HA: μ ≠ 30
D. Test statistic
As the population variance is known, we use Z
as the test statistic.
E Decision Rule
E.
• Reject Ho if the Z value falls in the rejection region.
• Don’t reject Ho if the Z value falls in the non-rejection region.
• Because of the structure of Ho it is a two tail test. Therefore,
reject Ho if Z ≤ -1.96 or Z ≥ 1.96.
F. Calculation of test statistic

G. Statistical decision
We reject the Ho because Z = -2.12 is in the rejection
region. The value is significant at 5% α.
H Conclusion
H.
We conclude that μ is not 30. P-value = 0.0340

A Z value of -2.12 corresponds to an area of 0.0170. Since there


are two parts to the rejection region in a two tail test, the P-value is
twice this which is .0340.
Hypothesis test using
confidence
fid interval
i l
• 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. However, it
will not give a probability.

• Confidence interval
Example: One -Tailed
Tailed Test
• A simple
p random sample p of 10 ppeople
p 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.
20 Let α = 0.05.
0 05
• Data
n = 10, 27 2 = 20,
10 sample mean = 27, 20 α = 0.05
0 05
• Hypotheses
Ho: μ ≥ 30, HA: μ < 30
• Test
T t statistic
t ti ti

• Rejection Region

Lower tail test

• With α = 0.05 and the inequality, we have the entire rejection region
at the left. The critical value will be Z = -1.645. Reject
j Ho if Z < -
1.645.
• Statistical decision
– We reject the Ho because -2.12 < -1.645.

• Conclusion
– We conclude that μ < 30.
– p = .0170 this time because it is only a one tail test and not a two
tail test.
• Suppose that the Ho and HA take the form
Ho: μ = μo, HA: μ > μo
• In
I this
thi case, Ho
H would ld b
be rejected
j t d ffor llarge
values of test statistic (critical values >0)
• The P-value would correspond to the area
in the upper tail of the SND, to the right of
the value of the test statistic.

Upper tail test


1.2 Unknown Variance
• In most practical applications the standard
deviation of the underlying population is not
known
• In hi case,  can be
I this b estimated
i dbby the
h
sample standard deviation s.
• If the underlying population is normally
distributed, then the test statistic is:
Example: Two-Tailed
Two Tailed Test
• A simple 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%?
• Ho: μ = 35, HA: μ ≠35
• Test statistic

• If the assumptions are correct and Ho is true, the test statistic


f ll
follows St d t' t distribution
Student's di t ib ti with
ith 13 degrees
d off freedom.
f d
• 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
2.1604 or t ≥ 2.1604.

• Do not reject Ho because -1.58 is not in the rejection


region. Based on the data of the sample, it is possible
th t μ = 35.
that 35 P-value
P l = 0.1375
0 1375
Sampling from a population that
is not normally distributed
• Here, we do not know if the population
displays a normal distribution.
• However, with a large sample size, we know
from the Central Limit Theorem that the
sampling distribution of the population is
distributed normally.
• With a large sample, we can use Z as the test
statistic calculated using the sample sd.
1.3 Known Variances
(Independent Samples)
• Wh
When two
t independent
i d d t samples l are d drawn
from a normally distributed population with
k
known variance,
i th
the ttestt statistic
t ti ti for
f testing
t ti
the Ho of equal population means is:
Example:
• Researchers wish to know a difference in mean serum
uric acid (SUA) levels between normal individuals and
individuals with Down’s syndrome. The means SUA
levels on 12 individuals with Down’s syndrome and 15
normall individuals
i di id l are 4.5 4 5 and d 3.4
3 4 mg/100
/100 ml,l
respectively. with variances. (2=1, 2=1.5, respectively).
Is there a difference between the means of both groups
at α 5%?
• Hypotheses:
H μ1- μ2 = 0 or Ho:
Ho: H μ1 = μ2
HA: μ1 - μ2 ≠ 0 or HA: μ1 ≠ μ2
• With α = 0.05,
0 05 the critical values of Z are -1 1.96
96 and
+1.96. We reject Ho if Z < -1.96 or Z > +1.96.

• Reject Ho because 2.57 > 1.96.


• From these data, it can be concluded that the
population means are not equal. A 95% CI would
give the same conclusion. P-value = 0.01.
1.4 Unknown Variances
i. Equal variances (Independent samples)
• With equal population variances,
variances we can obtain a
pooled value from the sample variances.
• The test statistic for μ1 - μ2 is:

• Where tα/2 has (n1 + n2 – 2) df., and


Example:
p
• We wish to know if we may conclude, at the 95%
confidence level, that smokers, in general, have
greater lung damage than do non-smokers.

• Calculation of Pooled
Variance
• Hypotheses:
Ho: μ1 ≤ μ2 = 0, HA: μ1 > μ2
• With α = 0.05
0 05 and df = 23,
23 the critical value of t is 1
1.7139.
7139 We
reject Ho if t > 1.7139.
• Test statistic

• Reject Ho because 2 2.6563


6563 > 1 1.7139.
7139 On the basis of the
data, we conclude that μ1 > μ2.
ii. Unequal variances (Independent samples)
ii
• We are still interested in testing
H0 : μ1 = μ2 vs HA: μ1 ≠ μ2
• The test statistic used is:
Hypothesis Tests for Proportions
• Involves categorical values
• Two possible outcomes
– “Success” (possesses a certain  
(p
characteristic)
– “Failure”
Failure  (does not possesses that     
(does not possesses that
characteristic)
• Fraction
Fraction or proportion of population in the 
or proportion of population in the
“success” category is denoted by p
Proportions
1 Hypothesis Testing about a Single
1.
Population Proportion
((Normal Approximation
pp to Binomial Distribution))
Example
p
• 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?
0 014? Α = 5%

H0 : p = 0.014
HA: p ≠ 0.014
• The test statistic is given by:
• Th
The critical
iti l value
l off Zα/2 att α=5%
5% iis ±1.96.
±1 96
• Don’t reject Ho since Z (=1.14) in the non-
rejection region between ±1.96.
• P-value = 0.2548
• We do not have sufficient evidence to
conclude that the pprobability
y of developing
p g
asthma for children whose mothers smoke
in the home is different from the probability
p y
in the general population
4. Hypothesis Tests about the Difference
Between
Two Population Proportions
Where X1 = the observed number of events in the first sample
and X2 = the observed number of events in the second sample
Example
p
• A study was conducted to investigate the
possible cause of g gastroenteritis outbreak
following a lunch served in a high school
cafeteria. Among the 225 students who ate the
sandwiches,
d i h 109 became
b ill While,
ill. Whil among the
th
38 students who did not eat the sandwiches, 4
became ill.ill Is there a significant difference
between the two groups at α =5%.
• We wish to test
Ho: p1 = p2 against the alternative
HA: p1 ≠ p2
• Assume that the sample sizes are large
enough, and the normal approximation to
the binomial distribution is valid.
valid
• If the Ho is true, then p1 = p2 = p
The area under the standard normal curve to the
right of 4.36
4 36 is less than 0.0001.
0 0001 Therefore,
Therefore p <
0.0002. We reject H0 at the 0.05 level.

The proportion of students who became ill


differs in the two groups; those who ate the
prepared sandwiches were more likely to
develop gastroenteritis.

You might also like