Top Banner
Hypothesis Testing -Chi-Square Test SHAMEER P.H dept. of futures studies 2010-'12
35
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Hypothesis Testing-Chi-Square Test

SHAMEER P.H

Page 2: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

REWIND YOUR MIND

Hypothesis- mere assumption to be proved or

disproved normal question that intends to resolve tentative formulated for empirical testing tentative answer to research question point to start a research

Page 3: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Research Questions and Hypotheses

• Research question:• Non-directional:

• No stated expectation about outcome• Example:

• Do men and women differ in terms of conversational memory?

• Hypothesis:• Statement of expected relationship

• Directionality of relationship• Example:

• Women will have greater conversational memory than men

Page 4: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

The Null Hypothesis

• Null Hypothesis - the absence of a relationship• E..g., There is no difference between men’s and women’s

with regards to conversational memories• Compare observed results to Null Hypothesis• How different are the results from the null hypothesis?

• We do not propose a null hypothesis as research hypothesis - need very large sample size / power• Used as point of contrast for testing

Page 5: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Hypotheses testing• When we test observed results against null:• We can make two decisions:

• 1. Accept the null• No significant relationship• Observed results similar to the Null Hypothesis

• 2. Reject the null• Significant relationship• Observed results different from the Null Hypothesis

• Whichever decision, we risk making an error

Page 6: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Type I and Type II Error• 1. Type I Error• Reality: No relationship• Decision: Reject the null

• Believe your research hypothesis have received support when in fact you should have disconfirmed it

• Analogy: Find an innocent man guilty of a crime• 2. Type II Error• Reality: Relationship• Decision: Accept the null

• Believe your research hypothesis has not received support when in fact you should have rejected the null.

• Analogy: Find a guilty man innocent of a crime

Page 7: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Potential outcomes of testingDecision

Accept Null Reject Null

R No E RelationshipALITY Relationship

Type II Error Correctdecision

Type I Error Correctdecision

Page 8: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Start by setting level of risk of making a Type I Error• How dangerous is it to make a Type I Error:• What risk is acceptable?:

• 5%? • 1%?• .1%?

• Smaller percentages are more conservative in guarding against a Type I Error

• Level of acceptable risk is called “Significance level” :• Usually the cutoff - <.05

Page 9: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Steps in Hypothesis Testing1) State research hypothesis2) State null hypothesis3) Decide the appropriate test criterion( eg. t test, χ2 test, F test

etc.)4) Set significance level (e.g., .05 level)5) Observe results6) Statistics calculate probability of results if null hypothesis

were true7) If probability of observed results is less than significance

level, then reject the null

Page 10: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Guarding against Errors

• Significance level regulates Type I Error• Conservative standards reduce Type I Error:• .01 instead of .05, especially with large sample

• Reducing the probability of Type I Error:• Increases the probability of Type II Error

• Sample size regulates Type II Error• The larger the sample, the lower the probability of Type II Error

occurring in conservative testing

Page 11: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Methods used to test hypothesis

T testZ testF testχ2 test……..

Page 12: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Testing hypothesis for two nominal variablesVariables Null hypothesis ProcedureGender

Passing is not Chi-squarerelated to gender

Pass/Fail

Page 13: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Testing hypothesis for one nominal and one ratio variableVariables Null hypothesis ProcedureGender

Score is not T-testrelated to gender

Test score

Page 14: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Testing hypothesis for one nominal and one ratio variableVariable Null hypothesis ProcedureYear in school

Score is notrelated to year in ANOVAschool

Test score

• Can be used when nominal variable has more than two categories and can include more than one independent variable

Page 15: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Testing hypothesis for two ratio variablesVariable Null hypothesis ProcedureHours spentstudying Score is not

related to hours Correlation

spent studyingTest score

Page 16: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Testing hypothesis for more than two ratio variablesVariable Null hypothesis ProcedureHours spentstudying Score is positively

related to hoursClasses spent studying and Multiple missed negatively related regression

to classes missedTest score

Page 17: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Chi square (χ2 ) test

Page 18: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Used to:

• Test for goodness of fit• Test for independence of attributes• Testing homogeneity• Testing given population variance

Page 19: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Chi-Square Test of Independence

Page 20: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Introduction (1)

•We often have occasions to make comparisons between two characteristics of something to see if they are linked or related to each other.

• One way to do this is to work out what we would expect to find if there was no relationship between them (the usual null hypothesis) and what we actually observe.

Page 21: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Introduction (2)

• The test we use to measure the differences between what is observed and what is expected according to an assumed hypothesis is called the chi-square test.

Page 22: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

For Example

• Some null hypotheses may be:

• ‘there is no relationship between the subject of first period and the number of students absent in our class’.

• ‘there is no relationship between the height of the land and the vegetation cover’.

• ‘there is no connection between the size of farm and the type of farm’

Page 23: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Important• The chi square test can only be used on data that has the following

characteristics:

The data must be in the form of frequencies

The frequency data must have a precise numerical value and must

be organised into categories or groups.

The total number of observations must be greater than 20.

The expected frequency in any one cell of the table must be greater than

5.

Page 24: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Contingency table

• Frequency table in which a sample from a population is classified according to two attributes, which are divided in to two or more classes

DRUNKARDS NON DRUNKARDSGENDER

MALES675 987

FEMALES540 997

Page 25: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Degrees of Freedom

no of independent observations Number of cells – no. of constraints

Page 26: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Formula

χ 2 = ∑ (O – E)2

E

χ2 = The value of chi squareO = The observed valueE = The expected value∑ (O – E)2 = all the values of (O – E) squared then added together

Page 27: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Critical region:

Page 28: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Page 29: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Construct a table with the information you have observed or obtained.

Observed Frequencies (O)

Money

Health Love Row Total

men 82 446 355 883

women 46 574 273 893

Column total

128 1020 628 1776

Page 30: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

• Work out the expected frequency.

Expected frequency = row total x column total

Grand total

money health love Row Total

men 63.63 507.128 312.23 883

women 64.36 512.87 315.76 893

Column Total

128 1020 628 1776

Page 31: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

• For each of the cells calculate.

money

health love Row Total

Men 5.30 7.37 5.85

women 5023 7.29 5.8

Column Total

χ2Calc. =

36.873

(O – E)2

E

Page 32: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

• χ2Calc. = sum of all ( O-E)2/ E values in the

cells. • Here χ 2

Calc. =36.873

Find χ 2critical From the table with degree of

freedom 2 and level of significance 0.05χ 2

Critical =5.99

Page 33: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Χ2 table

Page 34: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Conclusion

• Compare χ2Calc. and Χ2

critical obtained from the table

• If χ2Calc. Is larger than χ2

Critical. then reject null hypothesis and accept the alternative• Here since χ 2

Calc. is much greater than χ 2Critical, we can

easily reject null hypothesisthat is ; there lies a relation between the gender and choice of selection.

Page 35: Hypothesis testing

dept

. of f

utur

es s

tudi

es 2

010-

'12

Reference

• RESEARCH METHODOLGIES - L R Potti