c 2 test for independence

20
2 test for independence •Used with categorical, bivariate data from ONE sample •Used to see if the two categorical variables are associated (dependent) or not associated (independent)

description

c 2 test for independence. Used with categorical, bivariate data from ONE sample Used to see if the two categorical variables are associated (dependent) or not associated ( independent ). Assumptions & formula remain the same!. Hypotheses – written in words. - PowerPoint PPT Presentation

Transcript of c 2 test for independence

Page 1: c 2  test for independence

2 test for independence

•Used with categorical, bivariate data from ONE sample

•Used to see if the two categorical variables are associated (dependent) or not associated (independent)

Page 2: c 2  test for independence

Assumptions & Assumptions & formula remain the formula remain the

same!same!

Page 3: c 2  test for independence

Hypotheses – written in Hypotheses – written in wordswords

H0: two variables are independentHa: two variables are dependent

Be sure to write in context!

Page 4: c 2  test for independence

Example 5: A beef distributor wishes to determine whether there is a relationship between geographic region and cut of meat preferred. If there is no relationship, we will say that beef preference is independent of geographic region. Suppose that, in a random sample of 500 customers, 300 are from the North and 200 from the South. Also, 150 prefer cut A, 275 prefer cut B, and 75 prefer cut C.

Page 5: c 2  test for independence

If beef preference is independent of geographic region, how would we expect this table to be filled in?

North South Total

Cut A 150

Cut B 275

Cut C 75

Total 300 200 500

90 60

165

110

45 30

Page 6: c 2  test for independence

Expected Counts Expected Counts

•Assuming H0 is true,

totaltable

alcolumn tot totalrow counts expected

Page 7: c 2  test for independence

Degrees of freedomDegrees of freedom

)1c)(1(r df

Or cover up one row & one column & count the number of cells remaining!

Page 8: c 2  test for independence

Now suppose that in the actual sample of 500 consumers the observed numbers were as follows:

 Is there sufficient evidence to suggest that geographic regions and beef preference are not independent? (Is there a difference between the expected and observed counts?)

North South

Cut A 100 50

Cut B 168 107

Cut C 32 43

Page 9: c 2  test for independence

Assumptions:

•Have a random sample of people

•All expected counts are greater than 5.

H0: geographic region and beef preference are

independent Ha: geographic region and beef

preference are dependent

P-value = .0021 df = 2 = .05

Since p-value < , I reject H0. There is sufficient evidence to suggest that geographic region and beef preference are dependent.

30.12...

60

6050

90

90100 222

Expected Counts:

N S

A 90 60

B 165 110

C 45 30

Page 10: c 2  test for independence

Example 6 : Suppose that residents of a particular city can watch national news on affiliates of 4 different networks: ABC, CBS, PBS and NBC. A researcher wants to know whether there is any relationship between political philosophies (liberal, moderate or conservative) and the network they watch for news. A random sample of 300 viewers was selected, and the results are given below:

SURVEY RESULTS

ABC CBS NBC PBS

Liberal 20 20 25 15

Moderate 45 35 50 20

Conservative

15 40 10 5

Page 11: c 2  test for independence

Each observation consists of .

We would like to test whether there is .

1. State null and alternate hypothesis

Page 12: c 2  test for independence

ASSUMPTIONS:

Page 13: c 2  test for independence

EXPECTED COUNTSABC CBS NBC PBS

LiberalModerateConservative

2. Calculate statistics:Expected counts:

Degrees of freedom:

Use the graphing calculator to calculate P-value.

Page 14: c 2  test for independence

3. State conclusion.

Page 15: c 2  test for independence

22 test for homogeneity test for homogeneity

•Used with a single single categoricalcategorical variable from two (or more) independent two (or more) independent samplessamples

•Used to see if the two populations are the same (homogeneous)

Page 16: c 2  test for independence

Assumptions & formula remain the same!

Expected counts & df are found the same way as test for independence.

OnlyOnly change is the hypotheses!

Page 17: c 2  test for independence

Hypotheses – written in Hypotheses – written in wordswords

H0: the two (or more) distributions are the sameHa: the distributions are different

Be sure to write in context!

Page 18: c 2  test for independence

Separate random samples of 124 consumers and 101 dentists were asked to respond to the following statement: “I favor the use of advertising by dentists to attract new patients.” Possible responses were strongly agree, agree, neutral, disagree, and strongly disagree. The authors were interested in determining whether the two groups – consumers and dentists – differed in their attitudes towards advertising.

SURVEY RESPONSESStrongly Agree

Agree Neutral DisagreeStrongly Disagree

Dentists 34 49 9 4 5Consumers 9 18 23 28 46

Page 19: c 2  test for independence

Assumptions:

•Have 2 random samples.

•All expected counts are greater than 5.

H0: the true proportions are the same for both groups.

Ha: the true proportions differ in at least one category

P-value = .000 df = 4 = .05

Since p-value < , I reject H0. There is sufficient evidence to conclude that the true proportion for the 2 groups differ.

5.84...

1.30

1.3049

3.19

3.1934 222

Expected CountsStrongly Agree

Agree Neutral DisagreeStrongly Disagree

Dentists 19.3 30.1 14.4 14.4 22.9Consumers 23.7 36.9 17.6 17.6 28.1

Page 20: c 2  test for independence

From pollingreport.com: CNN/Opinion Research Corporation Poll. June 16, 2010. N=500 adults nationwide. MoE ± 4.

  "How do you feel about increased drilling for oil and natural gas offshore in U.S. waters? Do you strongly favor, mildly favor, mildly oppose or strongly oppose increased offshore drilling?"

StronglyFavor

MildlyFavor

MildlyOppose

Strongly Oppose

June, 2010

130 115 85 170

July, 2008

225 115 60 100