0% found this document useful (0 votes)
24 views33 pages

Huypothesis Testing Final Notes 2020 - 2021

Research methodology for nursing students

Uploaded by

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

Huypothesis Testing Final Notes 2020 - 2021

Research methodology for nursing students

Uploaded by

chelsea pasiah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 33

Introduction to Hypothesis

Testing

1
What is Hypothesis Testing

• Hypothesis testing (significance testing) is the use of statistics


to determine the probability that a given hypothesis is true.

• In hypothesis testing a statistician tests an assumption regarding a


population parameter. The methodology employed depends on the
nature of the data used and the reason for the analysis.

• Hypothesis testing is used to infer the result of a hypothesis performed


on sample data from a larger population.

• In hypothesis testing, the statistician tests a statistical sample, with the


goal of accepting or rejecting a null hypothesis. The test tells the
analyst whether or not his primary hypothesis is true.

2
Hypothesis Testing

• Formulate the null hypothesis (commonly, that the observations are


the result of pure chance) and the alternative hypothesis
(commonly, that the observations show a real effect)

• Identify a test statistic that can be used to assess the truth of the
null hypothesis.

• Compute the P-value, which is the probability that a test statistic at


least as significant as the one observed would be obtained assuming
that the null hypothesis were true. The smaller the -value, the
stronger the evidence against the null hypothesis.

• Compare the -value to an acceptable significance value (sometimes


called an alpha value).
3
Steps in hypothesis testing
Step 1: State the hypotheses and select an α level. The null
hypothesis, H0, always states that the treatment has no
effect (no change, no difference).

Step2: Locate the critical region.


The critical region consists of outcomes that are very unlikely to
occur if the null hypothesis is true.

Step 3: Compute the test statistic.


The test statistic forms a ratio comparing the obtained
difference between the sample mean and the hypothesized
population mean versus the amount of difference we would
expect without any treatment effect (the standard error).
4
Steps in hypothesis testing
Step 4:
A large value for the test statistic shows that the obtained mean
difference is more than would be expected if there is no treatment
effect.

If it is large enough to be in the critical region, we conclude that the


difference is significant or that the treatment has a significant effect.
In this case we reject the null hypothesis.

If the mean difference is relatively small, then the test statistic will
have a low value. In this case, we conclude that the evidence from
the sample is not sufficient, and the decision is fail to reject the
null
hypothesis.

5
One sample hypothesis testing

• Comparing sample mean to


population mean
• Comparing a sample proportion
to population proportion

6
Example: A random sample of n = 2 5 measurements of
chest
circumferences from a population of newborns having
= 0.7 inches provides a sample mean of x = 12.6 in. Is
it likely that the population mean has the value µ = 13.0 in.?

1. The hypothesis: H0 : µ = 13.0 versus H1 : µ ≠ 13.0

2. The assumptions: Random sample from a normal


distribution with = 0.7 inches

3. The α-level: α = 0.05


Four Outcomes from Hypothesis Testing
1. We reject the null hypothesis when the alternative
hypothesis is true. Correct decision.

2. We do not reject the null hypothesis when the null


hypothesis is true. Correct decision

3. We reject the null hypothesis when the null hypothesis is true.


Incorrect decision. This type of error is called a Type I error.

4. We do not reject the null hypothesis when the alternative


hypothesis is true. Incorrect decision. This type of error
is called a Type II error.
9
Type I Error: Rejecting a True Hypothesis
Type II Error: Accepting a False Hypothesis
10
What causes errors in Hypothesis Tests?

• Type I errors are caused by unusual,


unrepresentative samples.
• Type II errors are commonly the result of a very small
treatment effect. Although the treatment does have an
effect, it is not large enough to show up in the
research study

11
Hypothesis test for proportion
u Involves categorical variables
u Fraction or % of population in a category
u Sample proportion (p)

Test is called Z test


u
where: Z = p π
u Z is computed value
π (1
π
u π is proportion in population
(null hypothesis value)
X numberof successes
p =n = samplesize

Critical Values: 1.96 at α=0.05


2.58 at α=0.01
12
Example: In a survey of diabetics in a large city, it was found that 100 out of
400 have diabetic foot. Can we conclude that 20 percent of diabetics in the
sampled population have diabetic foot. Test at the a =0.05 significance level

Solution
0.25 – 0.20
Ho : π = 0.20 0.20 (1- 0.20) = 2.50
Z
H1 : π 0.20
40

Critical Value: 1.96 Decision:

Reject Reje We have sufficient evidence to reject the


Ho value of 20%
.025 .02 We conclude that in the population of
diabetic the proportion who have diabetic
foot does not equal 0.20
-1.96 0 +1.96 Z
13
Testing the Difference Between
Means
(Large Independent Samples)

14
Two Sample Hypothesis Testing

To write a null and alternative hypothesis for a two-sample


hypothesis test, translate the claim made about the
population parameters from a verbal statement to a
mathematical statement.

H0: μ1 < H 0: μ1 > μ2


H0: μ1 = μ2 μ2
Ha: μ1 < μ2
Ha: μ1 μ2 H a: μ 1 > μ 2

Regardless of which hypotheses used, “ 1 = “2 is always assumed to be


true.

15
Two Sample z-Test
-
A two-sample z-test can be used to test the difference between
two population means μ1 and μ2 when a large sample (at least
30) is randomly selected from each population
and the samples are independent. The test statistic is
and the standardized
test statistic is x1 - x 2

( x 1 - x2) - ( μ 1- σ 12+ σ 2
2 .
z= whe r e 1 2
μ 2) -x n n
=
2

When the samples are large, you can uses1 and s2 in place of σ 1
and σ 2 .

16
16
Example:
The PPH teacher claims that students who did mathemathics at
advanced levels in his class will score higher on the MPH 603
CA than students who did not do Mathematics in advance
levels. The mean CA score for 49 students who did A/L
Mathematics was 22.1 and the standard deviation is 4.8. The
mean CA score of 44 students who did not do A/L Mathematics
was 19.8 and the standard deviation is 5.4. At a = 0.10, can
the teacher’s claim be supported?

H0: μ1 < μ2
a = 0.10
H a: μ 1 > μ 2
(Claim)
z
-3 -2 -1 0 1

z0 = 1.28
17
H0: μ1 < μ2
Ha: μ1 > μ2 (Claim)
1.28 z0 =
-3 -2 -1 0 1 2 3

The standardized error is


Reject
= + = + ~ 1.0644.
-x 2

The standardized test statistic is


z= =
There is enough evidence at the 10% level ~ to support the
teacher’s claim that on CA scores of the two groups of
students.

18
Testing the Difference Between
Means
(Small Independent
Samples)

19
Two Sample t-Test

If samples of size less than 30 are taken from normally-


distributed populations, a t- test may be used to test the
difference between the population means μ1 and μ2.

Three conditions are necessary to use a t-test for small


independent samples.

20
Two Sample t-Test

A two-sample t-test is used to test the difference between


two population .
σ a sample is randomly selected from
means μ 1 and μ 2 when
each population. The standardized test statistic is
( x 1 - x 2) - ( μ1- μ2)
t
1 x-x
2

If the population
σ variances are equal, then information
( 1s2
n1samples
- 1 2n -) 21
from theˆ two is combined to calculate a pooled
n +
1
-
estimate of the standard deviation

21
Two Sample t-Test

The standard error for the sampling distribution of


isx 一 x
1 2
1 1 +
σ
一x = 1 2 一 1 s 12 n 一1
2

n n With ˆ= ( n1 ) + ( 2一 s)22
1

Variances equal
and d.f.= n1 + n2 – 2.

If the population variances are not equal, then the


standard error is

22
一x
= +
and d.f = smaller of n1 – 1
2
Variances not equal
or n2 – 1.

22
Example:
A random sample of 17 two bedroom houses in Buea has a mean
monthly rent of 35,800 FCFA and a standard deviation of 7,800 FCFA.
In Bamendaa random sample of 18 two bedroom
houses has a mean monthly rent of 35,100 FCFA and a standard
deviation of 7,375 FCFA. Test the claim at a = 0.01 that the mean
monthly rent in the two cities are not the same. Assume the population
variances are equal.

H0: μ1 = μ2 33
H a : μ1 μ2 (Claim)

d.f. = n1 + n2 – 2
= 17 + 18 – 2 =
23
1 1
a= 0
.005 2
2

-3 -2 -1
t
0 1 2
3

–t0 = –2.576
t0 = 2.576

23
H0: μ1 = μ2

Ha: μ1 子 μ2 (Claim) t
-3 -2 -1 0 1
–t0 = –2.576 t0 = 2.576

The standardized error is


=
一x
()( )
n1 一 1 s 12 + n2 一 1 1 1 +
2
.
n1 + n 一
=
1 2
n n
17 一 1 78002 + 18 一 1 73752
( + 18
17 ) 一2 ( 1 1+
=

) .17 18

心 7584.0355(0.3382)

心 2564.92

24
H0: μ1 = μ2

Ha: μ1 子 μ2 (Claim) -3 -2 -1 0 1 2
t
–t0 = – t0 =

The standardized test statistic is

( x 1 - x2) - ( μ1- μ2) (35800 - 35100) -0 ~


t -x =

2
0.273
= 2564.92
Fail to reject H0.

There is not enough evidence at the 1 % level to


support the claim that the mean annual incomes
differ.

25
Two Sample z-Test for Proportions

A z-test is used to test the difference between two population


proportions, p1 and p2.

Three conditions are required to conduct the test.

26
Example: A recent survey stated that male smoke less than female. In a survey
of 1245 males, 361 said they smoke at least one pack of cigarettes a day. In a
sur vey of 1065 females, 341 said they smoke at least one pack a day. At C =
0.01, ca n you support the claim that the proportion of male who smoke at
least one pac k of cigarettes a day is lower then the proportion of females who
smoke at least one pack a day?

H0: p 1 之 p 2
Ha: p1 < p2 (Claim)
z
-3 -2 -1 0 1 2 3
-z0 = -2.33

p 3 61 3 41 7 0 2
= = ~
12 45 +1065 2 3 1 0

0.304

q = 1 - p = 1 - 0.304 = 0.696
Because 1245(0.304), 1245(0.696), 1065(0.304), and 1065(0.696) are all at least
5, we can use a two-sample z-test. 27
H0: p1 > p2

Ha : p 1 < p 2
z
-3 -2 -1 0 1 2 3
-z0 = -2.33
ˆ
(0.29-0.2)-0
(- p2 )- (p1 - p 2 ) = ~ -1.56
z 1
= pq |( 1 +1 (0.304)(0.696)
1
+
)(n1 12 45
n2)|

Fail to reject H0.

There is not enough evidence at the 1% level to support the


claim that the proportion of male college students who smoke
28
is lower then the proportion of female college
students who smoke.

28

You might also like