Hypothesis testing

41
Hypothesis testing Dr Norizan

Transcript of Hypothesis testing

Hypothesis testing

Dr Norizan

Dr Norizan

Meaning: to infer something about a population parameter

based on a sample statistic

Two types of statistical inference: confidence interval: estimates the value of a

population parameter with an interval of plausible values.

hypothesis test: assesses the evidence provided by the data against a particular hypothesis about the population parameter(s)

Dr Norizan

Test a given theory or belief about a

population parameter

Find out if a claim about a population

parameter is true

Make a decision about a population

parameter based on the value of a sample

statistic

Dr Norizan

Example:

A company claims that the weight of a fruit bar it

produces is 200g

How can we test that this claim is true?

We cannot check all the fruit bars the company

produces

So we take 100 fruit bars at random and find the

mean weight

Then we compare the two values

We need to compare the population

parameter (mean weight = 200g) against the

sample statistic (mean weight of sample)

Dr Norizan

Dr Norizan

General procedure:

Choose a specific hypothesis to be tested

:This is called the null hypothesis

example: H0: µ = 200

Dr Norizan

In the event that we reject the null hypothesis, We have an alternative hypothesis to establish

Example: Ha: µ ≠ 200

alternatively Ha: µ 200 or Ha: µ 200

The alternative hypothesis states what we suspect to be true about the population parameter

We use a test statistic to do this

The test statistic is t

In this case, we carry out a one sample t test

We must also be sure (95%) that our decision

is correct

Dr Norizan

Dr Norizan

General procedure:

Choose a test statistic to evaluate the null

hypothesis (e.g. t statistic)

Choose a random sample, and make

measurements (e.g. mean)

Use the measurements to calculate the t statistic

and determine the likelihood of the hypothesis

Dr Norizan

General procedure:

Determine the probability of obtaining a test

value as extreme as the observed value

The null hypothesis is rejected if the observed

significance level small enough

Dr Norizan

It is the probability, if the null hypothesis

were true, that the sample outcome would

be as or more extreme as the one actually

observed

It can be calculated from a sampling

distribution

The smaller the p value, the stronger the

evidence against the null hypothesis

Dr Norizan

A significance level α is a cut-off for how

small the p value must be in order for the

sample data to be considered decisive

Common values are .05 and .01

Dr Norizan

1. State the null hypothesis

2. State the alternative hypothesis

3. Determine the test statistic

4. Determine the significance level

5. Identify sample distribution

6. Identify critical region

7. Make decision

Dr Norizan

• If the p value is less than α,

– then the sample result is said to be

statistically significant at the α level

Dr Norizan

One should not regard pre-specified

significance levels like α=.05 as magical cut-

off values distinguishing significance from

insignificance

Rather, p values represent a continuum of

varying degrees of the evidence’s strength

against the null hypothesis

Dr Norizan

How much time did you spend to study

PLG500 in a week?

Write the null hypothesis

Record the number of hours per week you

take to study for PLG500

Enter your data into an SPSS file

Conduct a one sample t test (what is the

actual mean?)

Dr Norizan

Student Hours studying PLG500

Dr Norizan

Dr Norizan

Dr Norizan

5

n = 36

mean = 3.77

p =.000

.025

.025 .025

p = .000 is smaller than p = .05

Therefore we reject H0

Dr Norizan

3

n = 36

mean = 3.77

p =.009

.025 .025

p = .009 is smaller than p = .05

Therefore we reject H0

Dr Norizan

3.5

n = 36

mean = 3.77

p =.404

.025 .025

p = .404 is larger than p = .05

Therefore we fail to reject H0

Dr Norizan

Conclusions made do not have 100% certainty

Conclusions made are associated with

particular levels of significance

This tells us how confident we are that the

conclusions made are very close to the real

situation

Dr Norizan

One must consider the practical significance of the result

Example: a new teaching method improves performance of a group of students by 5 marks

p value for the t test = 0.03

Statistically, this is significant

However, does an increase of 5 marks mean anything?

Dr Norizan

Sample size plays an important role in tests

of significance.

A large sample can detect even a very small

difference or effect

A small sample may fail to detect even a large

difference or effect

Dr Norizan

Assumptions is important to define the

sampling distribution of a test statistic

Correct significance levels can only be

calculated when the distribution is defined

Tests of assumptions should be incorporated

as part of the hypothesis testing procedure

Dr Norizan

Dr Norizan

To determine whether the mean IQ of

adopted children differs from the mean for

the general population of children (known to

be 100)

Null Hypothesis, Ho : =100

Set =.05 (the commonly chosen value)

Data collected from a random sample of

n=25 adopted children, mean = 108,

=15

If the probability (p) is less than .05 () Ho

will be rejected at the .05 level of

significance.

If p>.05, Ho is not rejected

Dr Norizan

• The area under the normal curve = 100%

• 100% = 100% ÷ 100 =1

• For α = .05, we want to have 95%

confidence that our decision is correct

– this represents 95% of the area under the

normal curve

95% = 95% ÷ 100 = .95

1 – α = .95

Dr Norizan

α = .05

The area shaded

red is .05

Dr Norizan

α = .05

p = .02

p = .02

The area

shaded red

is .02

Dr Norizan

• If the p value is less than α,

– The sample is statistically significant

at α significance level

Dr Norizan

• Example: p = .02, α = .05

– The sample mean is statistically significant

at significance level of .05

α = .05

p = .02

1. Analyze

2. Compare means

3. One sample t test

4. Move selected variable to the test

variable box

5. Select test value (= population mean)

6. Options – 95% confidence interval -

continue

7. OK

Dr Norizan

Dr Norizan

One-Sample Statistics

103 56.57 25.941 2.556Exam Perf ormance (%)

N Mean Std. Deviation

Std. Error

Mean

Dr Norizan

One-Sample Statistics

103 56.57 25.941 2.556Exam Perf ormance (%)

N Mean Std. Deviation

Std. Error

Mean

One-Sample Test

-1.341 102 .183 -3.427 -8.50 1.64Exam Perf ormance (%)

t df Sig. (2-tailed)

Mean

Dif f erence Lower Upper

95% Conf idence

Interv al of the

Dif f erence

Test Value = 60

Dr Norizan

• t = - 1.34, d.f. = 102, p = .183

• p > .05,

• Therefore we fail to reject the null

hypothesis

• Thus the sample mean is not significantly

different from the population mean

Make decision

Dr Norizan

One-Sample Test

-8.383 102 .000 -21.427 -26.50 -16.36Exam Perf ormance (%)

t df Sig. (2-tailed)

Mean

Dif f erence Lower Upper

95% Conf idence

Interv al of the

Dif f erence

Test Value = 78

One-Sample Statistics

103 56.57 25.941 2.556Exam Perf ormance (%)

N Mean Std. Deviation

Std. Error

Mean

Dr Norizan

• t = - 8.38, d.f. = 102, p = .00

• p < .05,

• Therefore we reject the null hypothesis

• Thus the sample mean is significantly

different from the population mean

Make decision