Sei sulla pagina 1di 122

HYPOTHESIS

TESTING

What is Hypothesis
A Hypothesis is the statement or an
assumption about relationships
between variables which can be
proven false.
or
A Hypothesis is a tentative
explanation for certain behaviors,
phenomenon or events that have
occurred or will occur.

HYPOTHESIS TESTS
Null hypothesis HO:
There is no difference

Alternative hypothesis (HA):


There is a difference
If the null hypothesis is false, it is likely
that our alternative hypothesis is true.

TYPES OF HYPOTHESIS
Each of the following statements is
an example of a null hypothesis
and alternative hypothesis.

A difference is considered
significant if the probability of
getting that difference by random
chance is very small.
P value:
The probability of making an error by
chance
Historically we use p < 0.05

Criteria for Hypothesis Construction


It should be empirically testable, whether it
is right or wrong.
It should be specific and precise.
The statements in the hypothesis should
not be contradictory.
It should specify variables between which
the relationship is to be established.
It should describe one issue only.

Steps in Hypothesis Testing

Establish Critical or Rejection region

FORMULATE A DECISION RULE


TO ACCEPT NULL HYPOTHESIS
Accept H0 if the test statistic
value falls within the area of
acceptance.
Reject otherwise.

Select the Suitable Test of


Significance or Test Statistic
Whether the test involves one
sample, two samples, or many
samples?
Whether two or more samples
used are independent or related?
Is the measurement scale nominal,
ordinal, interval, or ratio?

ERRORS IN HYPOTHESIS
TESTING

The choice of a probability distribution of


a sample statistics is guided but the
sample size n and the value of
population standard deviation .

Student
t - Test

Students t-test

Student was W. S.
Gossett. He published his
test anonymously as
Student because he was
working for the brewers
Guinness and had to keep
the fact they were using
statistics a secret.
The test is used to compare
samples from two different
batches.
It is usually used with small
(<30) samples that are
normally distributed.

TWO TYPES OF T-TEST


Matched Pairs and Independent Pairs
If there is some link between the
data then use the matched pairs
test (eg a before and after).
If there is no link between the data
then use the independent pairs
test.

T-TEST INDEPENDENT SAMPLES


If there is no before and after relationship
between the samples then the independent
samples test is used.

T - TEST FOR TWO


INDEPENDENT
SAMPLES

T-TEST INDEPENDENT SAMPLES


The reason for hypothesis
testing is to gain
knowledge about an
unknown population.
Independent samples t-test
is applied when we have
two independent samples
and want to make a
comparison between two
groups of individuals. The
parameters are unknown.
How is this different than a
Z-test and One Sample ttest?

T-TEST INDEPENDENT SAMPLES


We are interested in the difference
between two independent groups. As
such, we are comparing two populations
by evaluating the mean difference.
In order to evaluate the mean difference
between two populations, we sample
from each population and compare the
sample means on a given variable.
Must have two independent groups
(i.e.samples) and one dependent
variable that is continuous to compare
them on.

Examples:
Do males and females significantly
differ on their level of math anxiety?
IV: Gender (2 groups: males and females)
DV: Level of math anxiety
Do older people exercise significantly
less frequently than younger people?
IV: Age (2 groups: older people and
younger people)
DV: Frequency of getting exercise

Examples:
Do 6th graders have significantly more
unexcused absences than 4th graders
in LNC?
IV: Grade (2 groups: 6th grade and 4th
grade)
DV: Unexcused absences
Note that Independent t-test can be
applied to answer each research
question when the independent
variable is dichotomous with only two
groups and the dependent variable is
continuous.

Assumptions
The two groups are independent of
one another.
The dependent variable is normally
distributed.
The two groups have approximately
equal variance on the dependent
variable.

Step 1: State the hypotheses


Ho: The null hypothesis states that the two samples come
from the same population. In other words, There is no
statistically significant difference between the two
groups on the dependent variable.
Symbols:
Non-directional:
Directional:

Ho: 1 = 2

H 0:
1

or

H 0:
1

If the null hypothesis is tenable, the two group means


differ only by sampling fluctuation how much the
statistics value varies from sample to sample or
chance.

Step 1: State the hypotheses


H1: The alternative hypothesis states that the two samples
come from different populations. In other words, There
is a statistically significant difference between the two
groups on the dependent variable.
Symbols:
Non-directional:
Directional:

H1 : 1 2

H 1:
1

or

H 1:
1

If the null hypothesis is tenable, the two group means


differ only by sampling fluctuation how much the
statistics value varies from sample to sample or
chance.

Step 2: Set a Criterion for Rejecting Ho

Compute degrees of freedom


Set alpha level
Identify critical value(s)
T Distribution Table

Computing Degrees of Freedom


Calculate degrees of freedom (df) to
determine rejection region.
df = n1 + n2 - 2
sample size for sample1+ sample size for
sample2 2
df describe the number of scores in a
sample that are free to vary.
We subtract 2 because in this case we
have 2 samples.

Identify Critical Value(s)


Directional or non-directional?
Look at the T Distribution Table
To determine your Critical Value
you need to know:

df if df are not in the table, use the


next lowest number to be
conservative
directionality of the test
alpha level

Step 3: Collect data and Calculate t


statistic

x x
1

1
s n
s n 1

2
n n
n n

variance

Whereby:
n : Sample size

x : Sample mean

s2 = variance

df

subscript1 = sample 1 or group 1

subscript2 = sample 2 or group 2

Step 4: Compare test statistic to criterion

df = 18 = .05 , two-tailed test in this example


critical values are 2.101 in this example
30

Step 5: Make Decision

Fail to reject the null hypothesis and conclude that there is no statistically
significant difference between the two groups on the dependent variable,
t = , p > .
OR
Reject the null hypothesis and conclude that there is a statistically
significant difference between the two groups on the dependent variable,
t = , p < .
If directional, indicate which group is higher or lower (greater,
or less
31
than, etc.).

T-TEST INDEPENDENT SAMPLES


Example:
Some brown dog hairs were found on the clothing
of a victim at a crime scene involving a dog.
The five of the hairs were measured: 46, 57, 54,
51, 38 m.
A suspect is the owner of a dog with similar
brown hairs. A sample of the hairs has been taken
and their widths measured: 31, 35, 50, 35, 36 m.
Is it possible that the hairs found on the victim
were left by the suspects dog? Test at the %5
level.
[From D. Lucy Introduction to Statistics for Forensic Scientists Chichester: Wiley,
2005 p. 44.]

T-TEST INDEPENDENT SAMPLES


1. Calculate the mean and standard deviation for the
data sets.

T-TEST INDEPENDENT SAMPLES


1. Calculate the mean and standard deviation for the
data sets.

Total
Mean
Standard deviation

Dog A

Dog B

46

31

57

35

54

50

51

35

38

36

246

187

T-TEST INDEPENDENT SAMPLES


1. Calculate the mean and standard deviation for the
data sets.
Dog A

Dog B

46

31

57

35

54

50

51

35

38

36

Total

246

187

Mean

49.2

37.4

Standard deviation

T-TEST INDEPENDENT SAMPLES


1. Calculate the mean and standard deviation for the
data sets.
Dog A

Dog B

46

31

57

35

54

50

51

35

38

36

Total

246

187

Mean

49.2

37.4

7.463

7.301

Standard deviation

T-TEST INDEPENDENT SAMPLES


1. Calculate the mean and standard deviation for the
data sets.
.
2. Calculate the magnitude of the difference between
the two means
49.2 37.4 = 11.8

Total
Mean
Standard
deviation

Dog A

Dog B

46

31

57

35

54

50

51

35

38

36

246
49.2
7.463

187
37.4
7.301

T-TEST INDEPENDENT SAMPLES


1. Calculate the mean and standard deviation for the
data sets.
.
2. Calculate the magnitude of the difference between
the two means
49.2 37.4 = 11.8
3. Calculate the standard error in the difference
= 4.669 4.67

Total
Mean
Standard
deviation

Dog A

Dog B

46

31

57

35

54

50

51

35

38

36

246
49.2
7.463

187
37.4
7.301

T-TEST INDEPENDENT SAMPLES


1. Calculate the mean and standard deviation for the
data sets.
.
2. Calculate the magnitude of the difference between
the two means
49.2 37.4 = 11.8
3. Calculate the standard error in the difference
= 4.669 4.67
4. Calculate the value of t = 2.527

11.8
= 2.527
t=
4.67

Total
Mean
Standard
deviation

Dog A

Dog B

46

31

57

35

54

50

51

35

38

36

246
49.2
7.463

187
37.4
7.301

T-TEST INDEPENDENT SAMPLES


1. Calculate the mean and standard deviation for the
data sets.
.
2. Calculate the magnitude of the difference between
the two means
49.2 37.4 = 11.8
3. Calculate the standard error in the difference
= 4.669 4.67
4. Calculate the value of t = 2.527
5. Calculate the degrees of freedom
n

=5+5 -2=8
Dog A

Dog B

46

31

57

35

54

50

51

35

38

36

Total

246

187

Mean

49.2

37.4

Standard

7.463

7.301

df = n1 + n2 - 2

deviation

T-TEST INDEPENDENT SAMPLES


1. Calculate the mean and standard deviation for the
data sets.
.
2. Calculate the magnitude of the difference between
the two means
49.2 37.4 = 11.8
3. Calculate the standard error in the difference
= 4.669 4.67
4. Calculate the value of t = 2.527
5. Calculate the degrees of freedom

=5+5 -2=8

6. Find the critical value for the particular significance


you are working to from the T Distribution table.

At the 0.05 level

tcrit = 2.306

T-TEST INDEPENDENT SAMPLES


1. Calculate the mean and standard deviation for the
data sets.
.
2. Calculate the magnitude of the difference between
the two means
49.2 37.4 = 11.8
3. Calculate the standard error in the difference
= 4.669 4.67
4. Calculate the value of t = 2.527
5. Calculate the degrees of freedom

=5+5 -2=8

6. Find the critical value for the particular significance


you are working to from the T Distribution table.
If t < critical value then there is no significant difference
between the two sets of data.
If t > critical value then there is a significant difference
between the two sets of data

At the 0.05 level

tcrit = 2.306

So, at 0.05 level there is a significant


difference between the two data sets.
So it could not come from the same dog.

T-TEST INDEPENDENT SAMPLES


Group A
Group B
(leading
(control)
questions)
.

2
3
4
4
2
4
3
MeansA = ?
SDA = ?

3
5
0
3
4
0
MeansB = ?
SDB = ?

Diff of means= ?
SE of diff = ?
DoF = ?
t=?

T-TEST INDEPENDENT SAMPLES


_
XA - xA

Group A

Group B
.

xB - xB

3
_

xA=

Diff of means =
df = n A + n B

xB=

SDA=

xA - xB
2=

SDB=

SE of diff = SDA - SD B =
t=?

T-TEST INDEPENDENT SAMPLES


Group A
Group B
(leading
(control)
questions)
.

2
3
4
4
2
4
3
Mean = 3.143
SD= 0.8997

3
5
0
3
4
0
Mean = 2.50
SD = 2.07

Diff of means= 0.64


SE of diff = 0.861
DoF = 11
t = 0.7433

T-TEST INDEPENDENT SAMPLES


.

t < tcritical at 5% level, 2-tail

df = 11
t = 0.7433

There is no significant difference between the data test

Single-Sample
Z Test

A one-sample Z-test for proportions is a test


that helps us compare a population proportion
with a sample proportion.

A one-sample Z-test for proportions is a test


that helps us compare a population proportion
with a sample proportion.

30%
Sample Mean
()

30%
Population Mean

A one-sample Z-test for proportions is a test


that helps us compare a population proportion
with a sample proportion.

30%
Sample Mean
()

This is the
symbol
for a
sample
mean

30%
Population Mean

A one-sample Z-test for proportions is a test that


helps us compare a population proportion with a
sample proportion.

30%
Sample Mean
()

30%
Population Mean

And this is the


symbol for a
population mean
(called a mew)

A one-sample Z-test for proportions is a test


that helps us compare a population proportion
with a sample proportion.

30%
Sample Mean
()

Here is our question:

30%
Population Mean

A one-sample Z-test for proportions is a test


that helps us compare a population proportion
with a sample proportion.

30%
Sample Mean
()

30%
Population Mean

Here is our question: Are the population and


the sample proportions (which supposedly
have the same general characteristics as the
population) statistically significantly the same
or different?

Consider the following example:

Consider the following example:


A survey claims that 9 out of 10 doctors
recommend aspirin for their patients with
headaches. To test this claim, a random sample
of 100 doctors is obtained. Of these 100
doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05

Consider the following example:


A survey claims that 9 out of 10 doctors
recommend aspirin for their patients with
headaches. To test this claim, a random sample
of 100 doctors is obtained. Of these 100
doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05
Which is the sample?

Consider the following example:


A survey claims that 9 out of 10 doctors
recommend aspirin for their patients with
headaches. To test this claim, a random sample
of 100 doctors is obtained. Of these 100
doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05
Which is the sample?
What is the population?

Consider the following example:


A survey claims that 9 out of 10 doctors
recommend aspirin for their patients with
headaches. To test this claim, a random sample
of 100 doctors is obtained. Of these 100
doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05
Which is the sample?
What is the population?
The sample proportion is .82 doctors
recommending aspirin.

Consider the following example:


A survey claims that 9 out of 10 doctors
recommend aspirin for their patients with
headaches. To test this claim, a random sample
of 100 doctors is obtained. Of these 100
doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05
Which is the sample?
What is the population?
The sample proportion is .82 of doctors
recommending aspirin.
The population proportion .90 (the claim that 9
out of 10 doctors recommend aspirin).

We begin by stating the null hypothesis:

We begin by stating the null hypothesis:


The proportion of a sample of 100 medical doctors
who recommend aspirin for their patients with
headaches IS NOT statistically significantly different
from the claim that 9 out of 10 doctors recommend
aspirin for their patients with headaches.

We begin by stating the null hypothesis:


The proportion of a sample of 100 medical doctors
who recommend aspirin for their patients with
headaches IS NOT statistically significantly different
from the claim that 9 out of 10 doctors recommend
aspirin for their patients with headaches.

The alternative hypothesis would be:

We begin by stating the null hypothesis:


The proportion of a sample of 100 medical doctors
who recommend aspirin for their patients with
headaches IS NOT statistically significantly different
from the claim that 9 out of 10 doctors recommend
aspirin for their patients with headaches.

The alternative hypothesis would be:


The proportion of a sample of 100 medical doctors
who recommend aspirin for their patients with
headaches IS statistically significantly different from
the claim that 9 out of 10 doctors recommend aspirin
for their patients with headaches.

State the decision rule:

State the decision rule: We will calculate what


is called the z statistic which will make it
possible to determine the likelihood that the
sample proportion (.82) is a rare or common
occurrence with reference to the population
proportion (.90).

State the decision rule: We will calculate what


is called the z statistic which will make it
possible to determine the likelihood that the
sample proportion (.82) is a rare or common
occurrence with reference to the population
proportion (.90).
If the z-statistic falls outside of the 95%
common occurrences and into the 5% rare
occurrences then we will conclude that it is a
rare event and that the sample is different from
the population and therefore reject the null
hypothesis.

Before we calculate this z-statistic, we must


locate the z critical values.

Before we calculate this z-statistic, we must


locate the z critical values.
What are the z critical values? These are the
values that demarcate what is the rare and the
common occurrence.

Lets look at the normal distribution:

It has some important properties that make it


possible for us to locate the z statistic and
compare it to the z critical.

Here is the mean and the median of a normal


distribution.

50% of the values are above and below the


orange line.

50% -

50% +

68% of the values fall between +1 and -1


standard deviations from the mean.

34% -

34% +

68% of the values fall between +1 and -1


standard deviations from the mean.

34% -

-1

34% +

mean

68%

+1

68% of the values fall between +1 and -1


standard deviations from the mean.

34% -

-2 -1

34% +

mean

95%

+1 +2

Since our decision rule is .05 alpha, this


means that if the z value falls outside of the
95% common occurrences we will consider it a
rare occurrence.

34% -

-2 -1

34% +

mean

95%

+1 +2

Since are decision rule is .05 alpha we will see


if the z statistic is rare using this visual

rare

rare

-2 -1

mean

+1 +2

2.5%

95%

2.5%

Or common

Common

-2 -1

mean

95%

+1 +2

Before we can calculate the z statistic to see


if it is rare or common we first must determine
the z critical values that are associated with
-2 and +2.

Common

-2 -1

mean

95%

+1 +2

We look these up in the Z table and find that


they are -1.96 and +1.96

Common

Z
values

-2 -1

mean

-1.96

+1 +2
+1.96

95%

So if the z statistic we calculate is less than


-1.96 (e.g., -1.99) or greater than +1.96 (e.g.,
+2.30) then we will consider this to be a rare
event and reject the null hypothesis and state
that there is a statistically significant
difference between .9 (population) and .82 (the
sample).

So if the z statistic we calculate is less than


-1.96 (e.g., -1.99) or greater than +1.96 (e.g.,
+2.30) then we will consider this to be a rare
event and reject the null hypothesis and state
that there is a statistically significant
difference between .9 (population) and .82 (the
sample).
Lets calculate the z statistic and see where if
falls!

So if the z statistic we calculate is less than


-1.96 (e.g., -1.99) or greater than +1.96 (e.g.,
+2.30) then we will consider this to be a rare
event and reject the null hypothesis and state
that there is a statistically significant
difference between .9 (population) and .82 (the
sample).
Lets calculate the z statistic and see where if
falls!
We do this by using the following equation:

So if the z statistic we calculate is less than -1.96


(e.g., -1.99) or greater than +1.96 (e.g., +2.30) then we
will consider this to be a rare event and reject the null
hypothesis and state that there is a statistically
significant difference between .9 (population) and .82
(the sample).
Lets calculate the z statistic and see where if falls!
We do this by using the following equation:

So if the z statistic we calculate is less than -1.96 (e.g.,


-1.99) or greater than +1.96 (e.g., +2.30) then we will
consider this to be a rare event and reject the null
hypothesis and state that there is a statistically significant
difference between .9 (population) and .82 (the sample).
Lets calculate the z statistic and see where if falls!
We do this by using the following equation:

Zstatistic is what we are trying to find to see if it is outside or


inside the z critical values (-1.96 and +1.96).

Heres the problem again:

A survey claims that 9 out of 10 doctors recommend


aspirin for their patients with headaches. To test this
claim, a random sample of 100 doctors is obtained. Of
these 100 doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05

A survey claims that 9 out of 10 doctors recommend


aspirin for their patients with headaches. To test this
claim, a random sample of 100 doctors is obtained. Of
these 100 doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05

Note this
little hat ()
over the p
means that
this proportion
is an estimate
of a population

(.90)

(100)

A survey claims that 9 out of 10 doctors recommend


aspirin for their patients with headaches. To test this
claim, a random sample of 100 doctors is obtained. Of
these 100 doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05

(100)

A survey claims that 9 out of 10 doctors recommend


aspirin for their patients with headaches. To test this
claim, a random sample of 100 doctors is obtained. Of
these 100 doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05

(100)

Lets plug in the numbers

Sample Proportion

A survey claims that 9 out of 10 doctors recommend


aspirin for their patients with headaches. To test this
claim, a random sample of 100 doctors is obtained. Of
these 100 doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05

Sample Proportion

A survey claims that 9 out of 10 doctors recommend


aspirin for their patients with headaches. To test this
claim, a random sample of 100 doctors is obtained. Of
these 100 doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05

Sample Proportion

Population Proportion

A survey claims that 9 out of 10 doctors recommend


aspirin for their patients with headaches. To test this
claim, a random sample of 100 doctors is obtained. Of
these 100 doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05

Population Proportion

A survey claims that 9 out of 10 doctors recommend


aspirin for their patients with headaches. To test this
claim, a random sample of 100 doctors is obtained. Of
these 100 doctors, 82 indicate that they recommend
aspirin. Is this claim accurate? Use alpha = 0.05

Population Proportion

The difference

The difference

Now for the denominator which is the estimated


standard error. This value will help us know how
many
standard error units .82 and .90 are apart from one
another (we already know they are .08 raw units
apart)

Now for the denominator which is the estimated


standard error. This value will help us know how many
standard error units .82 and .90 are apart from one
another (we already know they are .08 raw units apart)

Note - If the standard error is small then the z


statistic will be larger. The larger the z
statistics the more likely that it will exceed the
-1.96 or +1.96 boundaries, compelling us to
reject the null hypothesis. If it is smaller than
we will not.

Lets continue our calculations and find out:

A survey claims that 9 out of 10 doctors recommend


aspirin for their patients with headaches. To test this claim,
a random sample of 100 doctors is obtained. Of these 100
doctors, 82 indicate that they recommend aspirin. Is this
claim accurate? Use alpha = 0.05

Lets continue our calculations and find out:

Lets continue our calculations and find out:

Lets continue our calculations and find out:

Sample Size:

A survey claims that 9 out of 10 doctors recommend


aspirin for their patients with headaches. To test this claim,
a random sample of 100 doctors is obtained. Of these 100
doctors, 82 indicate that they recommend aspirin. Is this
claim accurate? Use alpha = 0.05

Sample Size:

Lets continue our calculations:

Lets continue our calculations:

Lets continue our calculations:

Lets continue our calculations:

Now we have our z statistic.

Lets go back to our distribution:

Common

rare

-2 -1

mean

-1.96

rare

+1 +2
+1.96

95%

Lets go back to our distribution: So, is this result


rare or common?

Common

rare

-2.67

-2 -1
-1.96

mean

95%

rare

+1 +2
+1.96

Lets go back to our distribution: So, is this result


rare or common?

Common

rare

-2.67

-2 -1
-1.96

This is the
Z-Statistic
we calculated

mean

rare

+1 +2
+1.96

95%

Lets go back to our distribution: So, is this result


rare or common?

Common

rare

-2.67

-2 -1
-1.96
This is the
Z Critical

mean

rare

+1 +2
+1.96

95%

Looks like it is a rare event therefore we will


reject the null hypothesis in favor of the
alternative hypothesis:

Looks like it is a rare event therefore we will


reject the null hypothesis in favor of the
alternative hypothesis:
The proportion of a sample of 100 medical
doctors who recommend aspirin for their
patients with headaches IS statistically
significantly different from the claim that 9 out
of 10 doctors recommend aspirin for their
patients with headaches.

Summary of Certain Values for Sample Statistics Z

Potrebbero piacerti anche