Chapter 4 Inferential

Download as pdf or txt
Download as pdf or txt
You are on page 1of 135

Department of Public Health

Inferential biostatistics (Estimation and


Hypothesis Testing)

Teresa Kisi (MPH in Epidemiology and Biostatistics)


6/21/2017 Teresa K. 1
Inferential Statistics

Is the process of generalizing or drawing


conclusions about the target population on
the basis of results obtained from a sample.

6/21/2017 Teresa K. 2
Basic terms

 Parameter: The true quantities of the population


(which are rarely known for certain).

 Statistic: is a quantity calculated from a sample,


which describes a particular feature or Descriptive
measure obtained from a sample. E.g. if we want to
know the mean age of all Egyptian bladder cancer
cases, We take a portion of bladder cancer cases and
calculate the mean age.

6/21/2017 Teresa K. 3
Inferential Statistics cont’d…

How information from the sample is linked to the


population?
Via sampling distribution
Sampling distribution:
- This is not the distribution of sample.
- It is the distribution of a statistic.
- The frequency distribution of the statistic taken
over all possible samples.
Procedure:
If we take many, many samples and get the
statistic for each of those samples, the
distribution of all those statistic is the sampling
distribution.
6/21/2017 Teresa K. 4
Inferential Statistics cont’d…

 A sampling distribution of sample means is a


distribution obtained by using the means computed
from random samples of a specific size taken from a
population.

6/21/2017 Teresa K. 5
Properties of Sampling Distribution

Three things about sampling distribution


Its mean
Its variance
Its shape
The mean of the samples means will be the same as
the population mean.
The standard deviation of the sample means will be
smaller than the standard deviation of the
population, and it will be equal to the population
standard deviation, divided by the square root of the
sample size.

6/21/2017 Teresa K. 6
The Central Limit Theorem

Regardless of the shape of the frequency distribution


of a characteristic in the parent population;

As the sample size n increases, the shape of the


distribution of the sample means taken from a
population with mean µ and standard deviation of σ
will approach a normal distribution. As previously
shown, this distribution will have a mean µ and
standard deviation σ/√n (called the standard error of
the mean).

6/21/2017 Teresa K. 7
The central limit theorem cont’d...

The central limit theorem states that the sampling


distribution of any statistic will be normal or nearly
normal, if the sample size is large enough.

How large is "large enough"?

As a rough rule of thumb, many statisticians say that a


sample size of 30 or more is large enough for
continuous data

6/21/2017 Teresa K. 8
Sampling Distribution of the proportion

Suppose we choose a random sample of size n, the


sampling distribution of the sample proportions p posses
the following properties.

 The sample proportion p will be an estimate of the


population proportions p.
 The standard deviation of p is: p (1 − p)
=
n
(called the standard error of the proportion).
 Provided n is large enough the shape of the sampling
distribution of p is normal.
6/21/2017 Teresa K. 9
Sampling Distribution of the proportion cont’d...

In this case, np ≥ 5 and nq ≥ 5 are the requirements


for sufficiently large n ( central limit theorem for
proportions) .

6/21/2017 Teresa K. 10
Standard deviation and Standard error

Standard deviation is a measure of variability between


individual observations (descriptive index relevant to
mean)
Standard error refers to the variability of summary
statistics (e.g. the variability of the sample mean or a
sample proportion)
Standard error is a measure of uncertainty in a sample
statistic. i.e. precision of the estimate of the estimator

6/21/2017 Teresa K. 11
Parameter Estimations

In parameter estimation, we generally assume that the


underlying (unknown) distribution of the variable of
interest is adequately described by one or more
(unknown) parameters, referred as population
parameters.

As it is usually not possible to make measurements on


every individual in a population, parameters cannot
usually be determined exactly.

Instead we estimate parameters by calculating the


corresponding characteristics from a random sample
estimates .
6/21/2017 Teresa K. 12
Estimation cont’d …

Estimation is a procedure in which we use the


information included in a sample to get inferences
about the true parameter of interest.
An estimator is a statistic that is used to estimate an
unknown population parameter.
There are two types of estimation:
1. Point estimation: is a specific numerical value
estimate of parameter.
It uses the information in the sample to arrive at a
single number (that is called an estimate) that is
intended to be close to the true value of the
parameter.
6/21/2017 Teresa K. 13
Estimation cont’d …

2. Interval estimation: An interval estimate of a


parameter is a range of values used to estimate the
parameter.
It uses the information of the sample to end up at
an interval (i.e. construct 2 endpoints) that is
intended to enclose the true value of the parameter.

6/21/2017 Teresa K. 14
Point Estimation

Estimator is a rule (formula) that tells us how to calculate


the value of an estimate based on the measurements
contained in a sample.
Suppose we want to estimate the true (population)
mean, μ, of a random variable X , from a sample Xi, i = 1,
2, ...n.
One possible point estimator is the sample mean
n

∑x
i =1
i
x =
n
6/21/2017 Teresa K. 15
Point Estimation cont’d …

For the same population parameter many different


estimators may be used.
For instance, apart from the sample mean, the
median, or the mode can be used as estimators for
the true parameter.

6/21/2017 Teresa K. 16
6/21/2017 Teresa K. 17
Point estimations cont’d …

 So, some of the point estimates are:


– Point estimate for the population mean µ is
sample mean.
– Point estimation for population standard deviation
σ is sample standard deviation s.
– Point estimation of population P is sample
proportion p and so on.

6/21/2017 Teresa K. 18
Point estimations cont’d …

• However, there are pitfalls of point estimation.


These are:
– As we have seen under sampling distribution
section, different samples end with different
estimate for a single unknown population
parameter. Therefore point estimate does not take
sample to sample variability into account.
– Point estimate does not give the precision of the
estimate and hence we need another method of
estimation which handles these problems.

6/21/2017 Teresa K. 19
Example

The mean survival time of 91 laboratory rats after


removal of the thyroid gland was 82 days with a
standard deviation of 10 days (assume the rats were
randomly selected).
In the above example, the point estimates for the
population parameters µ and δ ( with regard to the
survival time of all laboratory rats after removal of the
thyroid gland) are 82 days and 10 days respectively.

6/21/2017 Teresa K. 20
Interval Estimation

A confidence interval for a parameter is an interval


computed from sample data containing the true value
of the parameter within a certain level of confidence.
It consists of three parts:
A confidence level,
The statistic and margin of error.
Interval estimators are commonly called confidence
intervals.
The confidence coefficient identifies the fraction of the
time (e.g. 95% of the times), in repeated sampling, that
the interval constructed will
6/21/2017 Teresa K.
contain the true parameter
21
That is, if we take 100 samples, we expect the true
value of the parameter to lie within the calculated
intervals in 95 of them (and not to lie within the
intervals in 5 of them).

6/21/2017 Teresa K. 22
Meaning of confidence Interval

6/21/2017 Teresa K. 23
Interval Estimation cont’d …

Confidence interval takes into account the sample to


sample variation of the statistic and gives the measure
of precision.
The general formula used to calculate a Confidence
interval is:
CI = Estimate ± K × Standard Error, k is called
reliability coefficient
Most commonly the 95% confidence intervals are
calculated, however 90% and 99% confidence intervals
are sometimes used.

6/21/2017 Teresa K. 24
Interval Estimation cont’d …
σ
 The term zα /2 ( ) is called the maximum error of
the estimate. n

The maximum error of the estimate is the maximum


difference between the point estimate of a parameter
and the actual value of the parameter.

6/21/2017 Teresa K. 25
Interval estimation cont’d…

6/21/2017 Teresa K. 26
Confidence interval cont’d…

Comparison of confidence Interval


90% CI is narrower than 95% CI since we are only 90%
certain that the interval includes the population
parameter.

On the other hand 99% CI will be wider than 95% CI; the
extra width meaning that we can be more certain that
the interval will contain the population parameter. But
to obtain a higher confidence from the same sample,
we must be willing to accept a larger margin of error (a
wider interval).

6/21/2017 Teresa K. 27
Confidence interval cont’d…

For a given confidence level (i.e. 90%, 95%, 99%) the


width of the confidence interval depends on the
standard error of the estimate which in turn depends
on the:
1. Sample size:-The larger the sample size, the
narrower the confidence interval (this is to mean
the sample statistic will approach the population
parameter) and the more precise our estimate. Lack
of precision means that in repeated sampling the
values of the sample statistic are spread out or
scattered. The result of sampling is not repeatable.
6/21/2017 Teresa K. 28
Confidence interval cont’d…

To increase precision (of an SRS), use a larger sample.


You can make the precision as high as you want by
taking a large enough sample. The margin of error
decreases as √n increases.

2. Standard deviation:-The more the variation among


the individual values, the wider the confidence
interval and the less precise the estimate. As sample
size increases standard error decreases.

6/21/2017 Teresa K. 29
The t-distribution

When n < 30 and δ is unknown?


We will use a t-distribution which depends on the
number of degrees of freedom(df.).
The t-distribution is a theoretical probability
distribution (i.e, its total area is 100 percent)

6/21/2017 Teresa K. 30
The t-distribution cont’d…

The t-distribution is symmetrical, bell-shaped, and


similar to the normal but more spread out.
For large sample sizes (n ≥ 30), both t and Z curves
are so close together and it does not much matter
which you use.
As the degrees of freedom decrease, the t-
distribution becomes increasingly spread out
compared with the normal.

6/21/2017 Teresa K. 31
Characteristics of the t distribution

 The t distribution is similar to The t distribution differs


the standard normal from the normal distribution
distribution(Z) in the following in:
ways: 1. The variance is greater than
1. It is bell shaped. one
2. It is symmetrical about the 2. The t distribution is actually
mean. a family of curves based on
the concept of degree of
3. The mean, median, and freedom, which is related to
mode are equal to 0 and sample size.
located at the centre. 3. As sample size increase, the
4. The curve never touches t distribution approaches
the x axis the standard normal
6/21/2017 Teresa K.
distribution(z). 32
The t-distribution cont’d…

Degrees of Freedom
As explained earlier, the t-distribution involves the
degrees of freedom (df).
It is defined as the number of values which are free
to vary after imposing a certain restriction on your
data.
Example: If the weight of three individuals have a mean
of 40Kg, how many of the individuals can be freely
chosen?

6/21/2017 Teresa K. 33
The t-distribution cont’d…

Solution
The first and the second individuals could be chosen
freely (i.e., 20Kg and 30Kg, 15Kg and 25KG, 50KG &
40Kg, etc.) But the third individual is fixed (i.e., 70,
80, 20, etc.)
Hence, there are two degrees of freedom.

6/21/2017 Teresa K. 34
The t-distribution cont’d…
Table of t-distributions
The table of t-distribution shows values of t for
selected areas under the t curve.
Different values of df appear in the first column. The
table is adapted for efficient use for either one or
two-tailed tests.
Example 1. If df = 8, 5% of t scores are above what
value?
Example 2. Find to if n =13 and 95% of t scores are
between –to and +to.
Example 3. If df =5, what is the probability that a t
score is above 2.02 or Teresa
6/21/2017
below K.
-2.02? 35
The t-distribution cont’d…
Solutions
1. Look at the table (t-distribution ). Along the row
labeled “one tail” to the value 0.05; the intersection
of the 0.05 column and the row with 8 in the df
column gives the value of t = 1.86.
2. df =13-1 = 12. If 95% of t scores are between -to and
+ to, then 5% are in the two tails. Look at the table
along the row labeled “two tail” to the value 0.05;
the intersection of this 0.05 column and the row
with 12 in the df column gives to = 2.179.
3. Two tails are implied. Look along the “df =5” row to
find the entry 2.02. The
6/21/2017
probability is 0.10 .
Teresa K. 36
Confidence interval for a single mean (for continuous
variable )

 Interval estimation for mean


– A (1 - α)100% confidence interval estimation for
the unknown population mean can be defined as:

σ σ
CI = ( x - zα /2 , x + zα /2 )
n n

6/21/2017 Teresa K. 37
Confidence interval for a single mean cont’d…

Formula for a specific confidence interval for the


mean when σ is Unknown and n < 30

s s
CI = ( x - tα /2, n-1 , x + tα /2, n-1 )
n n
Where, n-1 = degree of freedom for student’s t-
distribution and s = sample standard deviation.

6/21/2017 Teresa K. 38
Confidence interval for a single mean cont’d…

When to use tα/2 or zα/2 for finding confidence interval

Is σ known? yes Use zα/2 values


no maters what the sample size is,*
No
Is n ≥ 30 yes Use zα/2 values and
s in place of σ in the formula.

No
Use tα/2 values and s in the formula.**

*Variable must be normally distributed when n < 30.


** variable must be approximately normally distributed.
6/21/2017 Teresa K. 39
Interval estimation for difference of mean

The point estimation for the difference of two means,


µ1-µ2, is given by x - x.
1 2

A(1 - α)100% confidence interval estimation for the


difference of means µ1-µ2 , is defined as:

 σ σ
2 2
σ σ
2 2 
CI =  ( x1 - x2 ) - zα /2 + , ( x1 - x2 ) + zα /2 + 
 n n n n 
 1 2 1 2 

6/21/2017 Teresa K. 40
Interval estimation for difference of mean cont’d…

• Where ,
σ2 σ2
+
n1 n2

The standard deviation of the sampling distribution


of differences of means, also called the
standard error of differences of means (pooled
standard error).

6/21/2017 Teresa K. 41
Interval estimation for difference of mean cont’d…

If the sample size is less than 30 and the population


standard deviations are not given, then the
confidence interval estimation will take t-distribution
instead of z as:

 s12 s2 2 s12 s2 2 
CI =  ( x1 - x2 ) - tα /2, n1 + n 2 −2 + , ( x1 - x2 ) + tα /2, n1 + n 2 −2 + 
 n n n n 
 1 2 1 2 

Where as: n1+n2-2 = degree of freedom for


student’s t-distribution.
6/21/2017 Teresa K. 42
Interval estimation for single proportion

The point estimate for population proportion π is given


by p.
A (1-α)100% confidence interval estimate for the
unknown population proportion π is given by:

 
CI =  p − Z α π (1 − π ) / n , p + Z α π (1 − π ) / n 
 2 2 
When np and nq are greater than or equal to 5
6/21/2017 Teresa K. 43
Confidence interval for the difference of two
proportions
The point estimate for the difference of two
population proportion, π1- π2 is given by p1-p2.
A(1-α)100% confidence interval estimate for the
difference of population proportions, p1-p2 is given
by:

 π1 (1 − π1 ) π 2 (1 − π 2 ) π1 (1 − π1 ) π 2 (1 − π 2 ) 
CI =  (p1 − p2 ) − Z α + , ( p1 − p2 ) + Z α + 
 2
n1 n2 2
n1 n2 

6/21/2017 Teresa K. 44
In general the width of confidence interval depends
on:
Sample size,
Level of confidence and
The standard error.

6/21/2017 Teresa K. 45
Examples
Example 1
A SRS of 36 apparently healthy subjects yielded the
following values of urine excreted (milligram per day);
0.007, 0.03, 0.025, 0.008, 0.03, 0.038, 0.007, 0.005,
0.032, 0.04, 0.009, 0.014, 0.011, 0.022, 0.009, 0.008,
0.012, 0.03, 0.05, 0.009, 0.008, 0.007, 0.006, 0.02,
0.034, 0.007, 0.008, 0.036, 0.007, 0.023, 0.011, 0.012,
0.022, 0.03, 0.04, 0.04
Compute point estimate of the population mean

6/21/2017 Teresa K. 46
Example 1 cont’d…
If x1 , x 2 , ..., x n are n observed values , then
n

∑ xi
0.704
x= i =1
= = 0.0196
n 36
Construct 90% and 95% confidence interval for the
mean:
90%CI =(0.0196-1.65x0.0123/6, 0.0196+1.65x0.0123/6)
=(0.0134, 0.0235)

95%CI=(0.0196-1.96x0.0123/6,0.0196+1.96x0.0123/6)
=(0.0124, 0.0245)
6/21/2017 Teresa K. 47
Example 2
The mean diastolic blood pressure for 225 randomly
selected individuals is 75 mmHg with a standard
deviation of 12.0 mmHg. Construct a 95% confidence
interval for the mean
Solution
n=225
mean =75mmhg
Standard deviation=12 mmHg
confidence level 95%
The 95% confidence interval for the unknown population mean is
given
95%CI = (75 ±1.96x12/15) = (73.432,76.56)
6/21/2017 Teresa K. 48
Example 3
In a survey of 300 automobile drivers in one city, 123
reported that they wear seat belts regularly. Estimate
the seat belt rate of the city and 95% confidence
interval for true population proportion.

Solution
The point estimate of p = 123/300
=0.41 (41%)

95% CI Estimate of p for the seat belt of the city:


95% CI = p ± zα/2 × (√(p(1-p) /n))
=0.41 ± 1.96× (√0.41(1-0.41) /300)
6/21/2017 =(0.35,0.47) Teresa K. 49
Example 4

If a random sample of 50 non-smokers have a mean


life of 76 years with a standard deviation of 8 years,
and a random sample of 65 smokers live 68 years with
a 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
non-smokers and smokers.

6/21/2017 Teresa K. 50
Given
Population 1 (non-smokers)
n 1=50 , = 76, S1 = 8,

δ2 =

= 82/50 =1.28 years


Population 2 (smokers)
n 2= 65 , = 68, S2 = 9,

δ2 =

= 92/65 =1.246 years

6/21/2017 Teresa K. 51
Example 4

Solution
A. The point estimation of the difference of mean is:
point estimation of the difference = -
= 76 – 68
=8
B. 95% CI
CI =

= (8-1.96*1.28, 8+1.96*1.246)
=(5.491,10.442)
6/21/2017 Teresa K. 52
Example 5
Each of two groups consists of 100 patients who
have leukemia. A new drug is given to the first group
but not to the second (the control group). It is found
that in the first group 75 people have remission for 2
years; but only 60 in the second group.

Find 95% confidence limits for the difference in the


proportion of all patients with leukemia who have
remission for 2 years.

6/21/2017 Teresa K. 53
Example 5 cont’d ….

Solution
Note that
n1p1=100*0.75=75>5
n1q1 = 100*0.25=25>5
n2p2 = 100*0.60=60>5
n2q2 =100*0.40=40>5
p1 = 0.75, q1 = 0.25, n1=100
p2 = 0.60, q2= 0.40, n2=100
δ21 = p1q1/n1 = 0.75*0.25/100= 0.001875
δ22 = p2q2/n2 =0.60*0.40/100= 0.0024
Hence, δ2(1-2) = 0.001875+ 0.0024 = 0.004275
δ(1-2) = = 0.0653
6/21/2017 Teresa K. 54
Example 5 cont’d ….

At a 95% Confidence level, Z = ± 1.96


The difference of the two independent random samples
is (0.75 - 0.60) = 0.15 .
Therefore, a 95 % C.I. for the difference in the proportion
with 2-year remission is:
95%CI = (0.15 ± 1.96 (0.065) ) = (0.15 ± 0.13)
= (0.02,0.28).

6/21/2017 Teresa K. 55
Assignment
1. In a hospital, the mean noise level in the 170 ward
areas was 58.0 decibels and the standard deviation
was 4.8. Find 95% confidence interval for the true
mean?
2. In Addis Ababa, a survey of 350 students showed that
28% carried their lunch to school. Find the 95% CI for
the true population proportion of students who carried
their lunch to school?
3. A recent study in Gondar from 100 people found that
22 were obese. Find the 95% confidence interval for
the true population proportion?
6/21/2017 Teresa K. 56
Assignment

4. In a sample of 125 experimental subjects, the mean


score on a post-experimental measure of aggression
was 55 with a standard deviation of 5. Construct a
95% confidence interval for the population mean.

5. The mean weight of 100 men in a particular heart


study is 61 kg with a standard deviation of 7.9 kg.
Construct a 95% confidence interval for the mean.

6/21/2017 Teresa K. 57
6. The standard hemoglobin reading for normal males of
adult age is 15 g/100 ml. The standard deviation is
about 2.5 g/100 ml. For a group of 36 male
construction workers, the sample mean was 16 g/100
ml.
– Construct a 95% confidence interval for the male
construction workers. What is your interpretation of
this interval relative to the normal adult male
population?
– What would the confidence interval have been if the
above results were obtained based on 49
construction workers?

6/21/2017 Teresa K. 58
HYPOTHESIS TESTING

The formal process of hypothesis testing provides us


with a means of answering research questions.

Hypothesis is a testable statement that describes the


nature of the proposed relationship between two or
more variables of interest.
It is a conjecture about a population parameter.

The purpose of the study is to collect data which will


allow the researcher to test the hypothesis.
6/21/2017 Teresa K. 59
Hypothesis Testing cont’d…

This statement (assumption) may or may not be true.


Statistical tests can prove (with a certain degree of
confidence), that a relationship exists.
The best way to determine whether a statistical
hypothesis is true would be to examine the entire
population.
Since that is often impractical, researchers typically
examine a random sample from the population.

6/21/2017 Teresa K. 60
Hypothesis Testing cont’d…

 In hypothesis testing, the researcher must define


the population under study, state the particular
hypothesis that will be investigated, give the
significance level, select a sample from the
population, collect the data, perform the
calculations required for the statistical test, and
reach a conclusion.

6/21/2017 Teresa K. 61
Example of Hypothesis?

A hypothesis is an
assumption about the Example of hypothesis
population parameter. I assume the mean GPA of this
class is 3.5!
– A parameter is a
characteristic of the
population, like its mean or
variance.
– The parameter must be
identified before analysis.

© 1984-1994 T/Maker Co.


Examples of hypothesis cont’d…

The mean height of Arsi University, College of health


Sciences students’ is 1.63m.
There is no difference between the distribution of Pf
and Pv malaria in Ethiopia (i.e. are distributed in
equal proportions.)
Hypothesis Testing cont’d…

Types of hypothesis;
1. The null hypothesis:
Null hypothesis (represented by HO) is the
statement about the value of the population
parameter. That is the null hypothesis postulates
that ‘there is no association between factor and
outcome’ or ‘there is no an intervention effect’.
It is the main hypothesis which we wish to test .
pronounced
H “nought”

H0: parameter = hypothesized value.


6/21/2017 Teresa K. 64
Hypothesis Testing cont’d…

HO is always a statement about a parameter ( mean,


proportion, etc. of a population).
It is not about a sample, nor are sample statistic used in
formulating the null hypothesis.
HO is about an equality ( like: µ = 1.63m) rather than an
inequality ( µ ≥ 1.63m or µ < 1.63m).
The null hypothesis (H0) will always state that the
parameter equals the value specified in the
alternative hypothesis (H1)

6/21/2017 Teresa K. 65
Hypothesis Testing cont’d…

2. The alternative hypothesis: The alternative hypothesis,


(represented by HA or H1), contains the values of the
parameter we accept if we reject the null.
It states the ‘opposing’ view that ‘there is an
association between factor and outcome’ or ‘there is
an intervention effect’.
Example:
Null hypothesis (HO): there is no association between
variable A and B.
Alternative hypothesis(HA): there is an association
between variable A and B.
But, taking a sample we can reject or accept the former
(the null) statement.
6/21/2017 Teresa K. 66
Hypothesis Testing cont’d…

Choosing the Alternative Hypothesis (HA)


HA must also be formulated before a sample is
tested, so it, like the null hypothesis (HO), does not
depend on sample values.
If the mean height of students is questioned as:
HO: µ = 1.63m,
Then the possible alternative hypothesis is set as:
–HA :µ ≠ 163 m.
–HA : µ > 1.63 m.
– HA : µ < 1.63 m.
6/21/2017 Teresa K. 67
Hypothesis Testing cont’d…

 Possible choices of HA :
If Ho is Then HA is
µ = A(single mean) µ ≠ A or µ < A or µ > A
P = B(single proportion) p ≠ B or p < B or p> B
µ1- µ2 = C (difference of means) µ1- µ2 ≠ C or µ1- µ2 < C or µ1- µ2 > C
P1-p2 = D(difference of proportion) P1-p2 ≠D or p1-p2 < D or P1-P2 > D

Where: A,B, C, and D are constants

6/21/2017 Teresa K. 68
Hypothesis Testing cont’d…

Exercises
State HA and HO for each of the following
1. A researcher thinks that if expectant mothers use vitamin
pills, the birth weight of the babies will increase. The
average of the birth weight of the population is 8.6
pounds.
2. A psychologist feels that if he plays soft music during a test,
the result of the test will be changed. He is not sure whether
the grade will be higher or lower. In the past the mean of
the scores was 73.
3. Is the average height of the CHS students 1.63 m or is it
something different?
4. There is a belief that 10% of the smokers develop lung
cancer in country x.
5. Are men and women infected by malaria in equal
proportions, or is a higher proportion of men get malaria in
6/21/2017
Ethiopia? Teresa K. 69
Hypothesis Testing cont’d…

 In order to state hypothesis correctly, researchers


must translate the conjecture or claim from words
into mathematical symbols.

6/21/2017 Teresa K. 70
Hypothesis Testing cont’d…

Level of significance
A method for making a decision must be agreed
upon.
If HO is rejected, then HA is accepted.
How is a “significant” difference defined?
A null hypothesis is either true or false, and it is
either rejected or not rejected.
No error is made if it is true and we fail to reject it, or
if it is false and rejected.
An error is made, however, if it is true but rejected,
or if it is false and we fail to reject it.
6/21/2017 Teresa K. 71
Hypothesis Testing cont’d…

A random sample of size n is taken and the information


from the sample is used to reject or accept (fail to
reject) the null hypothesis.
It is not always possible to make a correct decision since
we are dealing with random samples.
Therefore, we must learn to live with probabilities of
type I (α) and type II (β) errors.

6/21/2017 Teresa K. 72
Hypothesis Testing cont’d…

Error in hypothesis Testing

Null hypothesis

Decision rule Ho is true Ho is false

Reject Ho Type I error (α) Correct

Do not reject Ho Correct Type II error (β)

6/21/2017 Teresa K. 73
Hypothesis Testing cont’d…

Type I Error: A type I error occurs when one rejects the


null hypothesis while it is true.
The probability of committing a type I error is the
level of significance of the test of hypothesis, and is
denoted by α.
Type II Error: A type II error occurs when one rejects
the alternative hypothesis (fails to reject the null
hypothesis) when the alternative hypothesis is true.
The probability of committing a type II error is
denoted by β.
6/21/2017 Teresa K. 74
Hypothesis Testing cont’d…

When we test the hypotheses, we can never be 100%


certain of our conclusions.
We can only be confident to a certain level - hopefully
a high one.

The level of significance(α) is the maximum


probability of commuting a type I error

6/21/2017 Teresa K. 75
Hypothesis Testing cont’d…

In practice, the level of significance ( α ) is chosen


arbitrarily and the limits for accepting Ho are
determined.

6/21/2017 Teresa K. 76
Hypothesis Testing cont’d…

Types of test to be set up:


The form of HA will determine the kind of test to
be set up (either one tailed or two tailed tests ) .
Consider the situation when HA includes the
symbol " ≠".
That is, HA: µ ≠ …,P ≠ …, µ1-µ2 ≠ ….,P- P ≠ ….
etc (two tailed test)

6/21/2017 Teresa K. 77
Level of Significance (α), critical value and the Rejection
Region

One tailed test


H0: µ = µ0 α Critical
Value(s)
H1: µ < µ0
0
Rejection Regions

H0: µ = µ0
H1: µ > µ0 0
α/2
H0: µ = µ0
H1: µ ≠ µ0
0
Two tailed test
6/21/2017 Teresa K. 78
Alpha (α ) vs. critical value.
The α-level is represented by
the clouded areas.
Sample results in this area lead
to rejection of H0.

Region of
DOUBT Region of
/rejection DOUBT /rejection
region region

Acceptance region

Critical value

6/21/2017 Teresa K. 79
Alpha (α ) vs. critical value cont’d...

The critical or rejection region is the


range of values of the test value that
indicates the significant difference
and that the null hypothesis should
be rejected.
Region of
DOUBT Region of
/rejection DOUBT /rejection
region region

Acceptance region

The critical value(s) separates the critical region


from the noncritical region.
6/21/2017 Teresa K. 80
Alpha (α ) vs. critical value cont’d...

Region of
DOUBT Region of
/rejection DOUBT /rejection
region region

Acceptance region

None critical or non rejection region is the range of the


test value that indicates the difference was probably
due to chance and that the null hypothesis should not
be rejected.
6/21/2017 Teresa K. 81
Hypothesis testing for population mean cont’d…

In case of the two tailed test, we will have two rejection


area (extreme left and extreme right), however for the
second two alternative hypothesis we have only one
region of rejection, either right or left extreme.

6/21/2017 Teresa K. 82
What Do We Test

Effect or Difference we are interested in


Mean and proportion in the population
Difference in Means or Proportions
Odds Ratio (OR)
Relative Risk (RR)
Correlation Coefficient

6/21/2017 Teresa K. 83
Hypothesis testing for population mean
Test procedure for two tailed test
1. state the null hypothesis: H0: µ =µ0
2. state the alternative hypothesis:H1:µ≠µ0
3. fix the level of significance(α) and compute the
test statistics under the null (assuming the null
hypothesis is true) as:
x − µ0
z =
se
Note that: this is not the only test statistics.
depending on the type of data and sample size, we
may need to compute z-score, t-score or x2-score
For large samples (n≥30), the test statistic has
standard normally distribution
6/21/2017 z ~ N (0, 1) Teresa K. 84
Steps for two tailed Test cont’d…

 For small sample (n<30) and if the true variance (σ2)


is unknown. the test statistic is distributed as a
student t-distribution with n-1 degrees of freedom.
 If the interest is to check the presence or absence of
association then x2_ score distribution will be used

6/21/2017 Teresa K. 85
4. Find the critical values corresponds to the given alpha
(α) from the distribution table.
5. Decision rule: For the hypothesis which is two tailed,
the decision is defined by:
Reject the null Hypothesis if:

x - µo
zcal = > ztab = zα /2
SE
Do not reject the null hypothesis if:
x - µo
zcal = < ztab = zα /2
SE
6/21/2017 Teresa K. 86
Example:

– The average age of staffs of Arsi university is 30 years


with variance of 20 years. To check this assumption
a graduating MPH student wants to proof whether
the assumption made about average age is true or
not. He took a random sample of 10 staffs and found
the average age (mean) of 27 years. Test that the
average age of the staffs is 30 years.
Solution: Test procedure:
1. Null hypothesis: Ho: µ = 30
2. Alternative hypothesis: HA: µ ≠ 30

6/21/2017 Teresa K. 87
Example: cont’d…

3. Test statistics:
x - µo 27 - 30
Z = = = -2.12
SE 20
10

4. Critical value: is Z value with level of significance α/2


= 0.025 if the test is two test. Thus the value of Zα/2 =
Z0.025 = 1.96. So, the critical value will be ±Zα/2 =
±1.96. Therefore we will reject the null hypothesis if
the calculated value of z is less than -1.96 or greater
than +1.96.

6/21/2017 Teresa K. 88
Example: cont’d…

5. Decision rule:

sin ce −2.12 is greater than ±1.96 , then reject the


null hypothesis

6/21/2017 Teresa K. 89
Test procedure for one tailed test

Test procedure for one tailed test is similar with that of


the two tailed test except at some steps
1.State the null hypothesis Ho: µ = µo
2.State the alternative hypothesis: H1: µ < µo or H1: µ >
µo.
The choice of the two type depends on the objective of
the test.

6/21/2017 Teresa K. 90
Test procedure for one tailed test cont’d…

 If we are interested to check whether the true


parameter is less than the hypothesized value, then
we will choose H1: µ < µo as our alternative.
 However, if the interest is to check whether the true
parameter is greater than the hypothesized value,
then H1: µ > µo will be chosen as the alternative.

6/21/2017 Teresa K. 91
Test procedure for one tailed test cont’d…

3. Fix the level significance (α) and compute the test


statistic: this step is the same with that of two
tailed test. In addition, the choice of the test
statistic is also the same. That is the test statistics
for one test is defined as:

x - µo
Z =
SE

6/21/2017 Teresa K. 92
Test procedure for one tailed test cont’d…

4. Find the critical values in the tails of distribution of


the test statistic that given for the 95% distribution.
The critical value can be obtained from the
distribution table of the test statistic.
– Hence the critical value is the value of Z at level of
significance α = 0.05.
• If the alternative hypothesis is H1: µ< µo, then
the critical value is given by ztab = -zα, while
• If the alternative hypothesis is H1: µ > µo, then
the critical value is given by ztab = zα.
6/21/2017 Teresa K. 93
Test procedure for one tailed test cont’d…

 Not that these values are the values from the


distribution table of the test statistic at the given
value of level of significance.
5. Decision rule: as the alternative hypothesis is one
tailed, the followings are the rules:
• If the alternative hypothesis is H1: µ < µo, then
the decision should be:
–Reject the null hypothesis if

x - µo
Z cal = < zα
6/21/2017
SE
Teresa K. 94
Test procedure for one tailed test cont’d…

 Otherwise do not reject the null hypothesis if:


x -µ
zcal = > zα
SE
 If the alternative hypothesis is H1: µ > µo, then the
decision will be:
– Reject the null hypothesis if:
x -µ
zcal = > zα
SE
– Otherwise do not reject the null hypothesis if:
x -µ
zcal = < zα
6/21/2017
SE
Teresa K. 95
Example:

Consider the above example, but now with different


objective. The objective is to check whether the true
average of the staffs is greater than 30years or not
Solution: Test procedure:
1.Null hypothesis: Ho: µ = 30
2.Alternative hypothesis: HA: µ > 30

6/21/2017 Teresa K. 96
Example: cont’d …

3. Test statistics:
x - µo 27 - 30
Z = = = -2.12
SE 20
10

4. Critical value: is Z value with level of significance α/2 =


0.05 if the test is one tail. Thus the value of Zα = Z0.05 =
1.65. So, the critical value will be Zα = 1.65. Therefore we
will reject the null hypothesis if the calculated value of z
is grater than 1.65. as -2.12 is less than 1.65, the decision
is do not reject the null hypothesis.
6/21/2017 Teresa K. 97
Or acceptance
region

Critical value

6/21/2017 Teresa K. 98
Comparison of two Means

The purpose of this section is to extend the arguments


of the single mean to the comparison of two sample
means.
In the comparison of two means, there are two
samples of observations from two underlying
populations (often treatment and control groups)
whose means are denoted by µt and µc and whose
standard deviations are denoted by δt and δc

6/21/2017 Teresa K. 99
The relevant null hypothesis is that the means are
identical, i.e.,
HO: µt = µc or HO : µt- µc = 0
The rationale for the test of significance is as before.
Assuming the null hypothesis is true (i.e., that there is
no difference in the population means), one determines
the chance of obtaining differences in sample means as
discrepant as or more discrepant than that observed.
If this chance is sufficiently small, there is reasonable
evidence to doubt the validity of the null hypothesis;
hence, one concludes there is a statistically significant
difference between the means of the two populations
(i.e., one rejects the null Teresa
6/21/2017
hypothesis).
K. 100
Example
If a random sample of 50 non-smokers have a mean life
of 76 years with a standard deviation of 8 years, and a
random sample of 65 smokers live 68 years with a
standard deviation of 9 years,
Test the hypothesis that there is no difference
between the mean lifetimes of non smokers and
smokers at a 0.01 level of significance.

6/21/2017 Teresa K. 101


Given
Population 1 (non-smokers)
n 1=50 , = 76, S1 = 8,

δ21 =

= 82/50 =1.28 years


Population 2 (smokers)
n 2= 65 , = 68, S2 = 9,

δ22 = = 92/65 =1.246 years

δ(n-s) = =

 pooled standard error of the mean


6/21/2017 Teresa K. 102
Hypotheses:
HO: µ1= µ2 or Ho: µ1 - µ2= 0
HA: µ1 ≠ µ2 or HA: µ1 - µ2 ≠ 0
α = 0.01 ( two tailed ) ⇒ Z (tabulated) = ± 2.58
Z calc = { ( - ) - (µ1- µ2) } / Standard error
of the difference of means
Standard error of the difference of means
δ(n-s) = = = 1.59 years
Hence, zcal = (76-68)/1.59 = 5.03
Because Zcalc > Ztab (i.e., P-value < the given α
value), the null hypothesis ( Ho) is rejected. That is,
there is a statistically significant difference in the
6/21/2017
mean lifetimes of nonTeresasmkers
K.
and smokers 103
Hypothesis Testing for Single Population Proportion
(two tail)
1. State the hypothesis
• State the null hypothesis, Ho: P = Po
• State the alternative hypothesis, HA: P ≠ Po
2. Fix the level of significance and compute the test
statistics under the null (assuming the null hypothesis is
true) as:
Alike that of testing population mean, the test statistics
will be chosen based on the size of the sample.
For large sample, (np ≥ 5, nq ≥ 5), the test statistics has
approximate standard normally distribution:
Z ~ N( np, npq)
6/21/2017 Teresa K. 104
3. Find the critical value and compute the test
statistics
4. Decision Rule:
Reject the null hypothesis if:
p-π
zcal = > ztab = zα /2
SE

Do not reject the null hypothesis if:

p-π
zcal = < ztab = zα /2
SE
6/21/2017 Teresa K. 105
Example:
• The national institute of mental health published an
article stating that in any one year period,
approximately 9.5 percent of American adults suffer
from depression or a depressive illness. Suppose that
in a survey of 100 people in a certain town, seven of
them suffered from depression or a depressive
illness. Conduct a hypothesis test to determine if the
true proportion of the people in that town suffering
from depression or depressive illness is different
from the percent in the general adult American
population.

6/21/2017 Teresa K. 106


Example:

• Solution: the hypothesis can be stated as:


–Ho: P = 0.095
–HA: P ≠ 0.095
The level of significance for the test is α = 0.05.
The critical value can be obtained from the normal
distribution at the mentioned level of significance.
Thus, Zα/2 = Z0.025 = ± 1.96.

6/21/2017 Teresa K. 107


Example: cont’d…

• To compute the calculated value of the test statistics,


first we need to calculate sample proportion from
the data. That is p = 7/100= 0.07. Then this the
standard error of proportion is defined as:
pq 0.095*0.905
σp = = = 0.0293
n 100
• Then the calculated value of z from the data is given
by:
p - π 0.07 - 0.095
z= = = -29.08
SE 0.0293
• Decision reject the null hypothesis.
6/21/2017 Teresa K. 108
Procedure for one tailed test of proportion

The procedure for the one sided test of proportion is


quit similar with one tailed of population mean. The
only difference is the standard deviation of proportion.
Example:
Consider the national institute of mental health example
given above, but with different objective. Now we want
to conduct a hypothesis test to determine if the true
proportion of people in that town suffering from
depression is greater than the percent in the adult
American population.
6/21/2017 Teresa K. 109
Procedure for one tailed test of proportion cont’d…

Solution:
 Hypothesis: Ho: π = 0.095
HA: π > 0.095
 The level of significance for the test is the same, α =
0.05. The critical value can be Z value corresponding
to the given alpha. i.e. zα = z0.05 = 1.65.
 Test statistics:

p −π 0.07-0.09
zcal = = = -29.08
6/21/2017
SE 0.0293
Teresa K. 110
Decision: since Zcal is less than the tabulated value of
Z, then the decision is do not reject the null
hypothesis

6/21/2017 Teresa K. 111


Hypothesis testing for two proportions
A similar approach is adopted when performing a
hypothesis test to compare two proportions. The
standard error of the difference in proportions is again
calculated, but because we are evaluating the
probability of the data on the assumption that the null
hypothesis is true we calculate a slightly different
standard error.

Se(p1-p2) =

Which is pooled standard error of the proportions.


6/21/2017 Teresa K. 112
Hypothesis testing for two proportions cont’d…

If the sample size is large and n1p1≥5, n1(1-p1) ≥ 5, n2p2 ≥ 5,


and n2(1-p2) ≥ 5, then:

zcal =

If the sample size is small and n1p1<5, n1(1-p1)<5 , n2p2<5


and n2(1-p2)<5, then use student’s t-statistic at n1+ n2-2
degrees of freedom with the given level of significant.

6/21/2017 Teresa K. 113


Hypothesis testing for two proportions cont’d…

The hypothesis for two proportions


Ho: π1-π2 =0
HA: π1-π2 ≠0
The test statistic is given by

( p1 − p2 ) − (π 1 − π 2 )
z cal =
p1 (1 − p1 ) p2 (1 − p2 )
+
n1 n2

6/21/2017 Teresa K. 114


Example:

A health officer is trying to study the malaria situation of


Ethiopia. From the records of seasonal blood survey (SBS)
results, he came to understand that the proportion of
people having malaria in Ethiopia was 3.8% in 1978 (Eth.
Cal). The size of the sample considered was 15000. He
also realized that during the year that followed (1979),
blood samples were taken from 10,000 randomly selected
persons. The result of the 1979 seasonal blood survey
showed that 200 persons were positive for malaria.
Help the health officer in testing the hypothesis that the
malaria situation of 1979 did not show any significant
difference from that of 1978 (take the level of
significance,
6/21/2017
a =0.01). Teresa K. 115
solutions

Ho: π1978 = π1979 or π1978-π1979 =0


HA: π1978 ≠ π1979 or π1978-π1979 ≠0
P1978 =0.038, n1978 =15,000
P1979 =0.02, n1979 = 10,000
Ztab (α=0.01, two tailed) = 2.58
Test statistics:

Z cal = =

6/21/2017
= Teresa K.
= 0.018/0.0021=8.571 116
Decision: reject Ho
Because Z calc > Z tab; in other words, the p- value is
less than the level of significance (i.e., α= 0.01)

6/21/2017 Teresa K. 117


One tailed test
Help the health officer in testing the hypothesis that the
malaria prevalence of 1978 was greater than that of
1979 (take the level of significance, a =0.01).
Solution
Ho: π1978 = π1979 or π1978-π1979 =0
HA:π1978 > π1979 or π1979 -π1978 > 0
P1978 =0.038, n1978 =15,000
P1979 =0.02, n1979 = 10,000
Ztab (α=0.01, one tailed) = 2.33

6/21/2017 Teresa K. 118


solutions

Test statistics:

Z cal = =

= = 0.018/0.0021=8.571

Decision: reject Ho
Because Zcalc > Ztab; in other words, the p- value is less
than the level of significance (i.e., α= 0.01)
6/21/2017 Teresa K. 119
Hypothesis testing for means and proportion of small
samples

We have seen in the preceding sections how the


Standard normal distribution can be used to carryout
tests of significance for the means and proportions of
large samples.
In this section we shall see how similar methods may be
used when we have small samples, using the t-
distribution.

6/21/2017 Teresa K. 120


Tests of Hypothesis using the t - distribution

Tests of hypotheses about the mean are carried out with


the t distribution just as for the normal distribution,
except that we must consider the number of degrees of
freedom and use a different table (the table of t
distribution).

6/21/2017 Teresa K. 121


Tests of Hypothesis using the t – distribution
cont’d…
Types of t-test:
– One-sample t-test: which is used to compare a
single mean to a fixed number or "gold standard".
– Paired t-test: which is used to compare two
means based on samples that are paired in some
way.
– Two-sample t-test: which is used to compare two
population means based on independent samples
from the two populations or groups.

6/21/2017 Teresa K. 122


Tests of Hypothesis using the
t - distribution cont’d…
Example:
The mean pulse rate and standard deviation of a
random sample of 9 first year male medical students
were 68.7 and 8.67 beats per minute respectively.
(Assume the pulse rate is normal distribution).

6/21/2017 Teresa K. 123


Tests of Hypothesis using the t - distribution cont’d…

If past experience indicates that the mean pulse rate of


first year male medical students is 72 beats per minute,
test the hypothesis that the above sample estimate is
consistent with the population mean at 5% level of
significance.
Solution:
Hypotheses :
Ho: µo = 72
HA: µ ≠ 72
tcal = = = -3.3/2.89 = -1.14

6/21/2017 Teresa K. 124


Tests of Hypothesis using the t - distribution cont’d…

This corresponds to a P-value of greater than 0.10


ttab ( with α = 0.05 and 8 df) = ± 2.31
 Rule: Reject HO
when t-calculated is either greater than 2.31 or less
than –2.31. (in other words, when the p-value is less
than the α - value)
Therefore, the above null hypothesis is accepted.
Conclusion: The result (sample estimate) obtained
from the sample is consistent with the population
mean. That is, the mean pulse rate of the randomly
selected male medical students did not show any
significant difference from the total mean pulse rate
of male medical students at 5% level of significance.
6/21/2017 Teresa K. 125
P-value

Is the probability of getting the observed difference, or


more extreme, in the sample purely by chance from a
population where the true difference is zero.
If the P-value is greater than α (like 0.05) then, by
convention, we conclude that the observed difference
could have occurred by chance and there is no
statistically significant evidence (at the α (like 5%) level
of significance) for a difference between the groups in
the population.

6/21/2017 Teresa K. 126


P-value cont’d…

So , with large p-value, we can not ignore the effect


of chance.
If the p-value < α (like 0.05), then we say the
difference is significant and hence reject the null
hypothesis of no difference.
While if p-value > α (like 0.05), then the difference is
not significant and hence do not reject the null
hypothesis.

6/21/2017 Teresa K. 127


The p-value for test is:

Zα Zcal

6/21/2017 Teresa K. 128


Example
Certain brand of cigarettes is advertised by manufacturer
as having mean nicotine content of 15 mg/cigarette. A
sample of 200 cigarettes is tested by lab and found to
have average of 15.76mg of nicotine with known SD = 3.6.
Using a 0.01 level of significance, can we conclude that
actual mean nicotine content of this brand is greater than
15 mg?(use p-value to test)

Solution:
Following the steps of hypothesis testing, the first step is
stating the null and alternative hypothesis, but before
that let us see the observed difference using the normal
curve:
6/21/2017 Teresa K. 129
Is 15.76 far enough to right
of μ=15 to be in the critical
area (rejection region)?

µ = 15

6/21/2017 Teresa K. 130


Ho: π=15;
HA: π > 15

Zcal = = =0.76/ 0.255 = 2.98

Ztab(α = 0.01) = 2.33

Zcal (2.98) > Ztab(α = 0.01)(2.33) conclude at 1% level


that mean nicotine level in this brand is greater than 15.

Moreover, the p-value for the test can be computed


using the formula as:
P-value=1-Ø(2.98) = 1- 0.9986
6/21/2017
= 0.0014
Teresa K. 131
Confidence Interval vs. p-value

Confidence Interval
1. Provide information that p-value gives.
– If null value is included in a 95% confidence interval,
by definition the corresponding P-value is >0.05.
2. Indicate the amount of variability (effect of sample size)
by the width of the confidence interval.
– This information can not be obtained from p-value.

6/21/2017 Teresa K. 132


Assignment

1. Suppose you are proposing to use a randomized


controlled trial to study the effectiveness of St John’s
Wort, as an alternative to an existing drug for the
treatment of mild to moderate depression. The
percentage of patients reporting an improvement in
mood three months after existing drug treatment is 70
per cent. You would be satisfied if the percentage
reporting mood improvement after three months of St
John’s Wort was 80 per cent. How big a sample would
you require to detect this improvement if you wanted
your test to have, (a) 80 per cent power and an α of
0.05; (b) 90 per cent power and an α of 0.01?

6/21/2017 Teresa K. 133


Assignment cont’d…

2. Suppose that the population mean of systolic blood


pressure in the US is 115. We hypothesize mean
systolic blood pressure is lower than 115 among
people who consume a small amount (e.g., around 3.5
ounces) of dark chocolate every day. Assume that
systolic blood pressure, X, in this population has a
N(μ,σ2) distribution. To evaluate our hypothesis, we
randomly selected 100 people, who include a small
amount of dark chocolate in their daily diet, and
measured their blood pressure. If the sample mean is¯
x=111 and the sample variance iss=32, can we reject
the null hypothesis at 0.1 confidence level?

6/21/2017 Teresa K. 134


Assignment cont’d…

3. Consider the problem of estimating the


proportion of people who regularly smoke.
We use (X) to denote smoking status and μ to
denote the population proportion of people
who smoke. We hypothesize that the
population proportion is less than 0.2. Write
down the null and alternative hypotheses.
Suppose that we interview 150 people and
find that 27 of them smoke regularly. Evaluate
the null hypothesis.
6/21/2017 Teresa K. 135

You might also like