lecture 33: chapter 12, section 2 two categorical variables more about chi-square

20
©2011 Brooks/Cole, Cengage Learning Elementary Statistics: Looking at the Big Picture 1 Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square Hypotheses about Variables or Parameters Computing Chi-square Statistic Details of Chi-square Test Confounding Variables

Upload: thanh

Post on 08-Feb-2016

45 views

Category:

Documents


0 download

DESCRIPTION

Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square. Hypotheses about Variables or Parameters Computing Chi-square Statistic Details of Chi-square Test Confounding Variables. Looking Back: Review. 4 Stages of Statistics - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture 1

Lecture 33: Chapter 12, Section 2Two Categorical VariablesMore About Chi-SquareHypotheses about Variables or ParametersComputing Chi-square StatisticDetails of Chi-square TestConfounding Variables

Page 2: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.2

Looking Back: Review 4 Stages of Statistics

Data Production (discussed in Lectures 1-4) Displaying and Summarizing (Lectures 5-12) Probability (discussed in Lectures 13-20) Statistical Inference

1 categorical (discussed in Lectures (21-23) 1 quantitative (discussed in Lectures (24-27) cat and quan: paired, 2-sample, several-sample

(Lectures 28-31) 2 categorical 2 quantitative

Page 3: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.3

and for 2 Cat. Variables (Review) In terms of variables

: two categorical variables are not related : two categorical variables are related

In terms of parameters : population proportions in response of interest are

equal for various explanatory groups : population proportions in response of interest are not

equal for various explanatory groupWord “not” appears in Ho about variables, Ha about parameters.

Page 4: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.4

Chi-Square Statistic Compute table of counts expected if true:

each is Expected =

Same as counts for which proportions in response categories are equal for various explanatory groups

Compute chi-square test statistic

Column total Row total Table total

Page 5: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.5

“Observed” and “Expected”

Expressions “observed” and “expected” commonly used for chi-square hypothesis tests.

More generally, “observed” is our sample statistic, “expected” is what happens on average in the population when is true, and there is no difference from claimed value, or no relationship.

Page 6: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.6

Example: 2 Categorical Variables: Data Background: We’re interested in the relationship between

gender and lenswear.

Question: What do data show about sample relationship? Response: Females wear contacts more (43% vs. 26%);

males wear glasses more (23% vs. 11%);proportions with none are close (46% vs. 52%).

Practice: 12.28a p.617

Page 7: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.8

Example: Table of Expected Counts Background: We’re interested in the relationship

between gender and lenswear.

Question: What counts are expected if gender and lenswear are not related?

Response: Calculate each expected count as Column total Row total Table total

Practice: 12.42b p.623

Page 8: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.10

Example: “Eyeballing” Obs. and Exp. Tables Background: We’re interested in the relationship

between gender & lenswear.

Question: Do observed and expected counts seem very different?

Response: Yes, especially in first two columns.

Practice: 12.12f p.609

Page 9: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.12

Example: Components for Comparison Background: Observed and expected tables:

Question: What are the components of chi-square? Response: Calculate each

Practice: 12.13g p.610

Page 10: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.14

Example: Components for Comparison Background: Components of chi-square are

Questions: Which contribute most and least to the chi-square statistic? What is chi-square? Is it large?

Responses: 5.4, 5.8 largest: most impact from males wearing glasses, not contacts 0.3, 0.5 smallest: least impact from females vs. males not wearing any

lenses chi-square is 3.1 + 3.3 + 0.3 + 5.4 + 5.8 + 0.5 = 18.4 We need more info to judge if 18.4 is “large”.

Practice: 12.13h p.610

Page 11: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.16

Chi-Square Distribution (Review)

follows predictable pattern known as chi-square distribution with df = (r-1) (c-1) r = number of rows (possible explanatory values) c = number of columns (possible response values)Properties of chi-square: Non-negative (based on squares) Mean=df [=1 for smallest (22) table] Spread depends on df Skewed right

Page 12: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.17

Example: Chi-Square Degrees of Freedom Background: Table for gender and lenswear:

Question: How many degrees of freedom apply? Response: row variable (male or female) has r =2,

column variable (contacts, glasses, none) has c =3. df = (2-1)(3-1) = 2.

A Closer Look: Degrees of freedom tell us how many unknowns can vary freely before the rest are “locked in.” Once we know 2 row values in a 2x3 table, we can fill in the remaining 4 counts by subtraction.

Practice: 12.42a p.623

Page 13: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.19

Chi-Square Density CurveFor chi-square with 2 df, If is more than 6, P-value is less than 0.05.

Page 14: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.20

Example: Assessing Chi-Square Background: In testing for relationship between

gender and lenswear in 23 table, found .

Question: Is there evidence of a relationship in general between gender and lenswear (not just in the sample)?

Response: For df = (2-1)(3-1) = 2, chi-square is considered “large” if greater than 6. Is 18.4 large?

Is the P-value small? Yes!Is there statistically significant evidence of a relationship between gender and lenswear? Yes!

Yes!

Practice: 12.42e-f p.623

Page 15: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.22

Example: Checking Assumptions Background: We produced table of expected

counts below right:

Question: Are samples large enough to guarantee the individual distributions to be approximately normal, so the sum of standardized components follows a distribution?

Response: All expected counts are more than 5 yes

Practice: 12.41c p.623

Page 16: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.24

Example: Chi-Square with Software Background: Some subjects injected under arm with Botox,

others with placebo. After a month, reported if sweating had decreased.

Question: What do we conclude? Response: Sample sizes large enough? Proportions with

reduced sweating 121/161=75%, 40/161= 25%.P-value = 0.000diff significant?

Seem different?Yes. Yes.

Yes.Conclude Botox reduces sweating?

Yes.

Practice: 12.41a p.623

Page 17: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.26

Guidelines for Use of Chi-Square (Review) Need random samples taken independently from

two or more populations. Confounding variables should be separated out. Sample sizes must be large enough to offset non-

normality of distributions. Need populations at least 10 times sample sizes.

Page 18: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.27

Example: Confounding Variables Background: Students of all years:

Underclassmen:

Upperclassmen:

Question: Are major (dec or not) and living situation related? Response: Only via year as confounding variable;

otherwise not.Practice: 12.49 p.626

Page 19: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L33.29

Activity Complete table of total students of each gender on

roster, and count those attending and not attending for each gender group. Carry out a chi-square test to see if gender and attendance are related in general.

XXYY

XX+YY

Page 20: Lecture 33: Chapter 12, Section 2 Two Categorical Variables More About Chi-Square

©2011 Brooks/Cole, Cengage Learning

Elementary Statistics: Looking at the Big Picture L19.30

Lecture Summary(Inference for CatCat; More Chi-Square) Hypotheses about variables or parameters Computing chi-square statistic

Observed and expected counts Chi-square test

Calculations Degrees of freedom Chi-square density curve Checking assumptions Testing with software

Confounding variables