26
Chi-Square

Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Embed Size (px)

Citation preview

Page 1: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Chi-Square

Page 2: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

•All the tests we’ve learned so far assume that our data is normally distributed

• z-test• t-test

• We test hypotheses about parameters of these normal distributions• We call these tests “Parametric Tests”

Chi Square

Page 3: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

• What if our data is not normally distributed?• Skewed distributions• Nominal or ordinal data• Then we use “Nonparametric Tests”• Tests that do not deal with parameters

Chi Square

Page 4: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Parametric vs. Nonparametric Tests

• Parametric Tests Test hypotheses about some parameter

(e.g. about the mean)

• Nonparametric Tests Test hypotheses about entire distribution

Chi Square

Page 5: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Characteristics of the Chi-Square Distribution

The major characteristics of the chi-square distribution are:

1. It is positively skewed. 2. It is non-negative.3. It is based on degrees of

freedom.4. When the degrees of

freedom change a new distribution is created.

Page 6: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

The formula for 2 is:

OR, sometimes written

Where f0 is the observed frequency of

each category in each cell of a table.

efeff )( 0

2

2

E

EO 22 )(

Page 7: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Example(1): Chi-Square Test for Independence

In one large factory, 100 employees were judged to be highly successful and another 100 marginally successful. All workers were asked, “Which do you find more important to you personally, the money you are able to take home or the satisfaction you feel from doing the job?” In the first group, 49% found the money more important, but in the second group 53% responded that way. Test the null hypothesis that job performance and job motivation are independent using the .01 level of significance.

Page 8: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

An Example: Chi-Square Test for Independence

State the research hypothesis. Are job performance and job

motivation independent?

State the statistical hypotheses.

t.independennot are motivation job and eperformanc Job:H

t.independen are motivation job and eperformanc Job:H

A

0

Page 9: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

An Example:

Set the decision rule.

64.6

1)1)(1()12)(12()1)(1(

01.

2

crit

rcdf

Page 10: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

An Example: Chi-Square Test for Independence

Calculate the test statistic.

49200

)100)(98(

totaloverall

)lumn total total)(co(row

51200

)100)(102(

totaloverall

)lumn total total)(co(row

e

e

f

f

High Success Marginal Success Total

Money 49 (51) 53 (51)102

Satisfaction 51 (49) 47 (49)98

Total 100 100 200

Page 11: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

An Example: Chi-Square Test for Independence

Calculate the test statistic.

32.0

08.08.08.08.

49

)4947(

51

)5153(

49

)4951(

51

)5149( 22222

High Success Marginal Success Total

Money 49 (51) 53 (51)102

Satisfaction 51 (49) 47 (49)98

Total 100 100 200

e

eo

f

ff 22 )(

Page 12: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

An Example: Chi-Square Test for Independence

Decide if your result is significant. Retain H0, 0.32<6.64

Interpret your results. Job performance and job motivation

are independent.

Page 13: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Q2:Is the type of crime independent of whether the criminal is a stranger?

Stranger

Relative

12

39

379

106

727

642

Homicide Robbery Assault

Homicide :Crime of Killing, Robbery: Stealing, Assault: Attacking

Page 14: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Row Total

Column Total

Stranger

Relative

1118

787

1905

12

39

51

379

106

485

727

642

1369

Homicide Robbery Assault

Is the type of crime independent of whether the criminal is a stranger?

Page 15: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Row Total

Column Total

E = (row total) (column total)(grand total)

Stranger

Relative

Homicide Robbery Assault

Is the type of crime independent of whether the criminal is a stranger?

1118

787

1905

12

39

51

379

106

485

727

642

1369

Page 16: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Row Total

(29.93)

Column Total

E = (row total) (column total)(grand total)

E = (1118)(51)

1905= 29.93

Stranger

Relative

Homicide Robbery Assault

Is the type of crime independent of whether the criminal is a stranger?

1118

787

1905

12

39

51

379

106

485

727

642

1369

Page 17: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Row Total

(29.93)

(21.07)

(284.64)

(200.36)

(803.43)

(565.57)

Column Total

E = (row total) (column total)(grand total)

E = (1118)(51)

1905= 29.93 E =

(1118)(485)

1905= 284.64

etc.

Stranger

Relative

Homicide Robbery Assault

Is the type of crime independent of whether the criminal is a stranger?

1118

787

1905

12

39

51

379

106

485

727

642

1369

Page 18: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

12

39

379

106

727

642

Homicide Robbery Forgery

(29.93)

(21.07)

(284.64)

(200.36)

(803.43)

(565.57

[10.741]Stranger

Relative

X2 = (O - E )2

E

(O -E )2

EUpper left cell: = = 10.741

(12 -29.93)2

29.93

(E)

(O - E )2

E

Is the type of crime independent of whether the criminal is a stranger?

Page 19: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

12

39

379

106

727

642

Homicide Robbery Forgery

(29.93)

(21.07)[15.258]

(284.64)[31.281]

(200.36)[44.439]

(803.43)[7.271]

(565.57)[10.329]

[10.741]Stranger

Acquaintance

or Relative

X2 = (O - E )2

E

(O -E )2

EUpper left cell: = = 10.741

(12 -29.93)2

29.93

(E)

(O - E )2

E

Is the type of crime independent of whether the criminal is a stranger?

Page 20: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

12

39

379

106

727

642

Homicide Robbery Forgery

(29.93)

(21.07)[15.258]

(284.64)[31.281]

(200.36)[44.439]

(803.43)[7.271]

(565.57)[10.329]

[10.741]Stranger

Acquaintance

or Relative

X2 = (O - E )2

E

(E)

(O - E )2

E

Is the type of crime independent of whether the criminal is a stranger?

Test Statistic X2 = 10.741 + 31.281 + ... + 10.329 =

119.319

Page 21: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Test Statistic X2 = 119.319

with = 0.05 and (r -1) (c -1) = (2 -1) (3 -1) = 2 degrees of freedom

Critical Value X2 = 5.991

Page 22: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Critical Values of Chi2

Significance Level

df 0.10 0.05 0.25 0.01 0.005

1 2.7055 3.8415 5.0239 6.6349 7.8794

2 4.6062 5.9915 7.3778 9.2104 10.5965

3 6.2514 7.8147 9.3484 11.3449

12.8381

Page 23: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Test Statistic X2 = 119.319

with = 0.05 and (r -1) (c -1) = (2 -1) (3 -1) = 2 degrees of freedom

0

= 0.05

X2 = 5.991

RejectIndependence

Critical Value X2 = 5.991

Sample data: X2 =119.319

Fail to RejectIndependence

Page 24: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Test Statistic X2 = 119.319

with = 0.05 and (r -1) (c -1) = (2 -1) (3 -1) = 2 degrees of freedom

0

= 0.05

X2 = 5.991

RejectIndependence

Critical Value X2 = 5.991

Reject independence

Sample data: X2 =119.319

Fail to RejectIndependence

Page 25: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Test Statistic X2 = 119.319

with = 0.05 and (r -1) (c -1) = (2 -1) (3 -1) = 2 degrees of freedom

0

= 0.05

X2 = 5.991

RejectIndependence

Critical Value X2 = 5.991

Reject independence

Sample data: X2 =119.319

Fail to RejectIndependence

Claim: The type of crime and knowledge of criminal are independentHo : The type of crime and knowledge of criminal are independent H1 : The type of crime and knowledge of criminal are dependent

Page 26: Chi-Square. All the tests we’ve learned so far assume that our data is normally distributed z-test t-test We test hypotheses about parameters of these

Test Statistic X2 = 119.319

with = 0.05 and (r -1) (c -1) = (2 -1) (3 -1) = 2 degrees of freedom

It appears that the type of crime and knowledge of the criminal are related.

0

= 0.05

X2 = 5.991

RejectIndependence

Critical Value X2 = 5.991

Reject independence

Sample data: X2 =119.319

Fail to RejectIndependence