Module 5
Introduction to Inference
Module Objectives
• At the end of the module students should be
able to
– understand the meaning of statistical inference
– calculate confidence intervals
– know the meaning of a P‐value
P value
Introduction
• The term statistical inference deals with the
collection of data on a relatively small number
of cases so as to form conclusions about the
general population from which the sample
was taken
taken.
Introduction
• The standard normal distribution (Z (Z‐distribution)
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
p p
standard deviation σ is known or when the sample
size n is large ( n ≥ 30) and with unknown σ (by
taking S as estimator of σ)) .
Introduction
• But, what happens
pp when n<30 and σ is unknown?
• We will use a t‐distribution which depends on the
number of degrees of freedom (df).
• The tt‐distribution
distribution is a theoretical probability
distribution (i.e, its total area is 100 percent ) and is
defined by a mathematical function.
• The distribution is symmetrical, bell‐shaped, and
similar to the normal but more spread out.
• For large sample sizes (n ≥ 30),
30) both t and Z curves
are so close together and it does not much matter
which you use.
Introduction
• As the degrees
g of freedom decrease,, the t‐
distribution becomes increasingly spread out
compared with the normal.
• The
h sample l standard
d d deviation
d is used
d as an estimate
of σ (the standard deviation of the population which
is unknown) and appears to be a logical substitute.
• This substitution, however, necessitates an alteration
in the underlying theory, an alteration that is
especially important when the sample size, n, is
small.
Example
• If a random sample p of 50 nonsmokers have a mean
life of 76 years with a population standard deviation
of 8 years, and a random sample of 65 smokers live
68 yyears with a population
p p standard deviation of 9
years,
A) What is the point estimate for the difference of the
population means ?
B) Find a 95% C.I. for the difference of mean lifetime of
nonsmokers and smokers.
C) Test the hypothesis that there is no difference
between the mean lifetimes of nonsmokers and
smokers at a .01 level of significance.
Solutions
• Population x (non smokers) nx nx=50
50 , = 76,
x Sx = 8,
σ 2 = 82 /50
x =1.28 years
p
• Population y ((smokers)) ny=65
y y, Sy = 9,,
, = 68,
σ 2 = 92 /65
y =1.25 years
A) A p
point estimate for the difference of population
p p
means (μx‐ μy) = ‐ = 76‐68 = 8x years y
Solutions
• B) At a 95% confidence level, Zα/2/2 = ± 1.96, σ( ‐ )
= SQRT(1.28
x y + 1.25) = 1.59 years
Hence,, 95% C.I. for μ
μx‐ μy
= ( ‐x ) y± 1.96 σ( ‐x ) y
= 8 ± 1.96 (1.59)
= 8 ± 3.12
= (4(4.88
88 to 11
11.12
12 years)
Solutions
C) Test of hypothesis
• Hypotheses:
• HO : μt = μc or HO : μt ‐ μc = 0
• HA : μt ≠ μc or HA : μt ‐ μc ≠ 0
• α = .01
01 ( two tailed ) ⇒ Z (tabulated) = ± 2.58 2 58
( x − y ) − (μ x − μ y )
Z cal =
SEthe difference b/n the two means
• Standard error of the difference of means
SEthe difference between the two means = 1.28 + 1.25
= 1.59
Solutions
• Hence, Zcalc = (76 – 68) / 1.59
= 8 / 1.59 = 5.03
• The corresponding P‐value is less than .003.003
• Because Zcalc > Ztab (i.e., P‐value < the given
α value),
value) the null hypothesis ( HO ) is
rejected. That is, there is a statistically
significant difference in the mean lifetimes of
non smokers and smokers
Solutions
• Please note that we use the following
f
formulal for
f constructing confidence
fd
interval for the difference between
σ 12 σ 22
two population means, if the ( x1 − x 2 ) ± Z α
n1
+
n2
population variance is known and the 2
data is normaly distributed.
• For the above situation we use the
following Z‐static for testing a ( x1 − x 2 ) − ( μ 1 − μ 2 )
Z=
hypothesis on the difference between σ 12 σ 22
+
two population means. n1 n2
P – Values
• Having set up the null hypothesis, we then evaluate the
probability
b b l thath we could ld h
have obtained
b d the
h observed
b dd
data (or
(
data that were more extreme) if the null hypothesis were
true.
• This
Thi probability
b bilit isi usually
ll called
ll d the
th P – value.
l If it is
i small,
ll
conventionally less than 0.05, the null hypothesis is rejected
as implausible.
• In other words,
ords an outcome
o tcome that co could
ld occur
occ r less than one
time in 20 when the null hypothesis is true would lead to the
rejection of the null hypothesis.
• In this formulation,
formulation when we reject the null hypothesis we
accept a complementary alternative hypothesis.
• If P > 0.05 this is often taken as suggesting that insufficient
information is available to discount the null hypothesis.
hypothesis
P Value
P‐Value
• When P is below the cut off level(α), ( ) sayy 0.05, the
result is called statistically significant( and below
some lower level, such as 0.01, it may be called
highly
g y significant);
g ); when above 0.05 it is called not
significant.
• It is important to distinguish between the
significance level and the p – value.
value
• The significance level α is the probability of making a
type I error.
• 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 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
0 05 or P > 0.05
0 05 .
• It is now increasingly common to see the
expression of exact values largely due to the
availability of computer programs which give
the exact P – values.
values
Testing a single Proportion
• For testing a single population proportion against a
hypothesized value, we can use the Z‐statistic using
the following formula
H0: π = π0
H1: π ≠ π0
P -π0
Z=
π 0 (1 − π 0 )
n
Testing two Proportions
• H0 : π 1 = π 2
H1 : π1 ≠ π 2
• We use a pooled sample estimate for the common
hypothesized proportion, which is a weighted
average of the sample proportions, with the sample
size as weights.
n1 P1 + n 2 P2
P=
n1 + n 2
• The standard error of the difference is given by
P(1− P) P(1− P) ⎛ 1 1⎞
SE(P1−P2) = + = P(1− P)⎜ + ⎟
n1 n2 ⎝n1 n2 ⎠
( P1 − P2 ) − (π 1 − π 2 )
• The test statistic becomesZ =
SE(P1−P2 )
Example
• Significance testing for the Oxpentifylline trial
Oxypentifylline Placebo
(n=38
(n=38)) (n=42
(n=42))
ulcer healed 23((61
23 61%
%) 12((29
12 29%
%) 0.011
p<0
p<
completely
l l
1 Chi-squared test
“In the sample, ulcers treated with Oxpentifylline were more than twice as likely to heal”
Example
• Confidence Interval for the true treatment
difference
– The 95% confidence interval is best thought of as
a plausible range for the true treatment difference
in the p
population
p at large
g
– All plausible values indicate that oxpentifylline is
more effective than placebo
Significance Test
• Oxpentifylline and placebo are equally
effective
• The risk of healing is the same for
Oxpentifylline and placebo
• (Note that the null hypothesis refers to the
treatment difference in the study population)
• Does the evidence we have support this
hypothesis?
Significance Test
• Suppose
pp Oxpentifylline
p y and placebo
p are reallyy
equally effective, then we would expect roughly
equal proportions healed in each group
• ..the
h chance
h off getting a result
l as ffar ffrom equall
proportions healed as this (i.e. 23/38 healed with
Oxpentifylline 12/42 healed with placebo), is less
than 1/100
• ie. For equally effective treatments, you would
almost never get a result as extreme as this.
Significance Test
• Either we have an extremely unusual
result.....or (more likely) outcomes with
Oxpentifylline and placebo in the population
at large are indeed different.
• In other words, P‐value is more commonly
defined as “the probability that chance
variation could explain the observed
diff
difference assuming
i thath theh nullll h
hypothesis
h i iis
true”.
What is the conclusion?
• Under the assumption p of no difference in
treatments, the result (23/38 vs 12/42) is implausible
(p is less than 0.05 =1/20)
• “there
“h is statistically
ll significant
f evidence
d ((at the
h 5%
level) that oxpentifylline is more effective than
placebo
placebo”
• By convention, a p value less than 0.05 is implausible
under hypothesis of no difference; conclude there is
a statistically significant difference.
What is the conclusion?
• A p value greater than 0.05
0 05 is plausible under
hypothesis of no difference; conclude that
there is no evidence of a statistically
significant difference.
Confidence interval or p – value?
• The 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
Confidence interval or p – value?
• A 95% confidence interval ggives a plausible
p range
g of
values that should contain the true population
difference.
• On average, only
l 1 in 20 off suchh confidence
fd
intervals should fail to capture the true difference.
• 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 intervals and p
p‐values
values 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 of
the difference.