1 Applied Statistics Using SAS and SPSS Topic: Chi-square tests By Prof Kelly Fan, Cal. State Univ., East Bay.

Slides:



Advertisements
Similar presentations
Contingency Table Analysis Mary Whiteside, Ph.D..
Advertisements

What is Chi-Square? Used to examine differences in the distributions of nominal data A mathematical comparison between expected frequencies and observed.
Tutorial: Chi-Square Distribution Presented by: Nikki Natividad Course: BIOL Biostatistics.
Contingency Tables Chapters Seven, Sixteen, and Eighteen Chapter Seven –Definition of Contingency Tables –Basic Statistics –SPSS program (Crosstabulation)
Chi Square Tests Chapter 17.
© 2011 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as permitted in a license.
Multinomial Experiments Goodness of Fit Tests We have just seen an example of comparing two proportions. For that analysis, we used the normal distribution.
1 Contingency Tables: Tests for independence and homogeneity (§10.5) How to test hypotheses of independence (association) and homogeneity (similarity)
Chapter 11 Contingency Table Analysis. Nonparametric Systems Another method of examining the relationship between independent (X) and dependant (Y) variables.
1 If we live with a deep sense of gratitude, our life will be greatly embellished.
Statistics II: An Overview of Statistics. Outline for Statistics II Lecture: SPSS Syntax – Some examples. Normal Distribution Curve. Sampling Distribution.
Chi-square Test of Independence
PSY 307 – Statistics for the Behavioral Sciences Chapter 19 – Chi-Square Test for Qualitative Data Chapter 21 – Deciding Which Test to Use.
1 Chapter 20 Two Categorical Variables: The Chi-Square Test.
Presentation 12 Chi-Square test.
Cross Tabulation and Chi-Square Testing. Cross-Tabulation While a frequency distribution describes one variable at a time, a cross-tabulation describes.
Chapter 10 Analyzing the Association Between Categorical Variables
How Can We Test whether Categorical Variables are Independent?
Statistics for Everyone Workshop Fall 2010 Part 5 Comparing the Proportion of Scores in Different Categories With a Chi Square Test Workshop presented.
AS 737 Categorical Data Analysis For Multivariate
Xuhua Xia Smoking and Lung Cancer This chest radiograph demonstrates a large squamous cell carcinoma of the right upper lobe. This is a larger squamous.
Estimation and Hypothesis Testing Faculty of Information Technology King Mongkut’s University of Technology North Bangkok 1.
Inferential Statistics: SPSS
Analysis of Categorical Data
1 Psych 5500/6500 Chi-Square (Part Two) Test for Association Fall, 2008.
For testing significance of patterns in qualitative data Test statistic is based on counts that represent the number of items that fall in each category.
Chi-Square Test of Independence Practice Problem – 1
Chapter 11: Applications of Chi-Square. Count or Frequency Data Many problems for which the data is categorized and the results shown by way of counts.
Statistics 11 Correlations Definitions: A correlation is measure of association between two quantitative variables with respect to a single individual.
Dr.Shaikh Shaffi Ahamed Ph.D., Dept. of Family & Community Medicine
Chapter 9: Non-parametric Tests n Parametric vs Non-parametric n Chi-Square –1 way –2 way.
1 Chi-Square Heibatollah Baghi, and Mastee Badii.
Multinomial Experiments Goodness of Fit Tests We have just seen an example of comparing two proportions. For that analysis, we used the normal distribution.
Two Way Tables and the Chi-Square Test ● Here we study relationships between two categorical variables. – The data can be displayed in a two way table.
Social Science Research Design and Statistics, 2/e Alfred P. Rovai, Jason D. Baker, and Michael K. Ponton Pearson Chi-Square Contingency Table Analysis.
Analysis of Qualitative Data Dr Azmi Mohd Tamil Dept of Community Health Universiti Kebangsaan Malaysia FK6163.
Nonparametric Statistics
Nonparametric Tests: Chi Square   Lesson 16. Parametric vs. Nonparametric Tests n Parametric hypothesis test about population parameter (  or  2.
Data Analysis for Two-Way Tables. The Basics Two-way table of counts Organizes data about 2 categorical variables Row variables run across the table Column.
Introduction to Biostatistics (ZJU 2008) Wenjiang Fu, Ph.D Associate Professor Division of Biostatistics, Department of Epidemiology Michigan State University.
CHI SQUARE TESTS.
HYPOTHESIS TESTING BETWEEN TWO OR MORE CATEGORICAL VARIABLES The Chi-Square Distribution and Test for Independence.
Chapter 13 CHI-SQUARE AND NONPARAMETRIC PROCEDURES.
1 Chapter 11: Analyzing the Association Between Categorical Variables Section 11.1: What is Independence and What is Association?
Fundamental Statistics in Applied Linguistics Research Spring 2010 Weekend MA Program on Applied English Dr. Da-Fu Huang.
Chapter Outline Goodness of Fit test Test of Independence.
Non-parametric Tests e.g., Chi-Square. When to use various statistics n Parametric n Interval or ratio data n Name parametric tests we covered Tuesday.
12/23/2015Slide 1 The chi-square test of independence is one of the most frequently used hypothesis tests in the social sciences because it can be used.
Section 12.2: Tests for Homogeneity and Independence in a Two-Way Table.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 11 Analyzing the Association Between Categorical Variables Section 11.2 Testing Categorical.
Chapter 14 Chi-Square Tests.  Hypothesis testing procedures for nominal variables (whose values are categories)  Focus on the number of people in different.
Leftover Slides from Week Five. Steps in Hypothesis Testing Specify the research hypothesis and corresponding null hypothesis Compute the value of a test.
Chapter 14 – 1 Chi-Square Chi-Square as a Statistical Test Statistical Independence Hypothesis Testing with Chi-Square The Assumptions Stating the Research.
Chi Square Tests Chapter 17. Assumptions for Parametrics >Normal distributions >DV is at least scale >Random selection Sometimes other stuff: homogeneity,
Chapter 12 Chi-Square Tests and Nonparametric Tests.
Ch 13: Chi-square tests Part 2: Nov 29, Chi-sq Test for Independence Deals with 2 nominal variables Create ‘contingency tables’ –Crosses the 2 variables.
THE CHI-SQUARE TEST BACKGROUND AND NEED OF THE TEST Data collected in the field of medicine is often qualitative. --- For example, the presence or absence.
Chapter 11: Categorical Data n Chi-square goodness of fit test allows us to examine a single distribution of a categorical variable in a population. n.
Categorical Analysis STAT120C 1. Review of Tests Learned in STAT120C Which test(s) should be used to answer the following questions? – Is husband’s BMI.
Chapter 4 Selected Nonparemetric Techniques: PARAMETRIC VS. NONPARAMETRIC.
Qualitative data – tests of association
The Chi-Square Distribution and Test for Independence
If we can reduce our desire,
Chapter 10 Analyzing the Association Between Categorical Variables
Overview and Chi-Square
Analyzing the Association Between Categorical Variables
Categorical Data Analysis
Applied Statistics Using SPSS
Applied Statistics Using SPSS
Presentation transcript:

1 Applied Statistics Using SAS and SPSS Topic: Chi-square tests By Prof Kelly Fan, Cal. State Univ., East Bay

2 Outline ALL variables must be categorical Goal one: verify a distribution of Y  One-sample Chi-square test (SPSS lesson 40; SAS handout) Goal two: test the independence between two categorical variables  Chi-square test for two-way contingency table (SPSS lesson 41; SAS section 3.G)  McNemar’s test for paired data (SPSS lesson 44; SAS section 3.L)  Measure the dependence (Phil and Kappa coefficients) (SPSS lesson 41, 44; SAS section 3.G, 3.M)

3 Example: Postpartum Depression Study Are women equally likely to show an increase, no change, or a decrease in depression as a function of childbirth? Are the proportions associated with a decrease, no change, and an increase in depression from before to after childbirth the same?

4 Example: Postpartum Depression Study Depression after birth in comparison with before birth Observed frequencies Hypothesized proportions Expected frequencies Less depressed (-1)141/320 Neither less nor more depressed (0) 331/320 More depressed (1)131/320 From a random sample of 60 women

5 One-sample Chi-Square Test Must be a random sample The sample size must be large enough so that expected frequencies are greater than or equal to 5 for 80% or more of the categories

6 One-sample Chi-Square Test Test statistic: Oi = the observed frequency of i-th category e i = the expected frequency of i-th category

7 SPSS Output 1.Weight your data by count first 2.Analyze >> Nonparametric Tests >> Legacy Dialogs >> Chi Square, count as test variable

8 Conclusion Reject Ho The proportions associated with a decrease, no change, and an increase in depression from before to after childbirth are significantly different to 1/3, 1/3, 1/3.

9 Example: Postpartum Depression Study Are the proportions associated with a change and no change from before to after childbirth the same?

10 Example: Postpartum Depression Study Depression after birth in comparison with before birth Observed frequencies Hypothesized proportions Expected frequencies Same amount of depression (0) 331/230 More or less depressed (1) 271/230 From a random sample of 60 women

11 SPSS Output

12 Two-way Contingency Tables Report frequencies on two variables Such tables are also called crosstabs.

13 Contingency Tables (Crosstabs) 1991 General Social Survey FrequencyParty Identification DemocratIndependentRepublican RaceWhite Black

14 Crosstabs Analysis (Two-way Chi- square test) Chi-square test for testing the independence between two variables: 1.For a fixed column, the distribution of frequencies over rows keeps the same regardless of the column 2.For a fixed row, the distribution of frequencies over columns keeps the same regardless of the row

15 Measure of dependence for 2x2 tables The phi coefficient measures the association between two categorical variables -1 < phi < 1 | phi | indicates the strength of the association If the two variables are both ordinal, then the sign of phi indicate the direction of association

SPSS Output P. 332 –

17 SAS Output Statistic DF Value Prob Chi-Square <.0001 Likelihood Ratio Chi-Square <.0001 Mantel-Haenszel Chi-Square <.0001 Phi Coefficient Contingency Coefficient Cramer's V Sample Size = 980

Measure of dependence for non-2x2 tables Cramers V Range from 0 to 1 V may be viewed as the association between two variables as a percentage of their maximum possible variation. V= phi for 2x2, 2x3 and 3x2 tables 18

19 Fisher’s Exact Test for Independence The Chi-squared tests are ONLY for large samples: The sample size must be large enough so that expected frequencies are greater than or equal to 5 for 80% or more of the categories

20 SAS/SPSS Output SAS output: Fisher's Exact Test Table Probability (P) 3.823E-22 Pr <= P 2.787E-20 SPSS output: in “crosstabs” window, click “exact”, then tick “exact”:

21 Matched-pair Data Comparing categorical responses for two “paired” samples When either Each sample has the same subjects (or say subjects are measured twice) Or A natural pairing exists between each subject in one sample and a subject form the other sample (eg. Twins)

22 Example: Rating for Prime Minister Second Survey First SurveyApproveDisapprove Approve Disapprove86570

23 Marginal Homogeneity The probabilities of “success” for both samples are identical Eg. The probability of approve at the first and 2 nd surveys are identical

24 McNemar Test (for 2x2 Tables only) SAS: Section 3.L; SPSS: Lesson 44 Ho: marginal homogeneity Ha: no marginal homogeneity Exact p-value Approximate p-value (When n 12 +n 21 >10)

25 SAS Output McNemar's Test Statistic (S) DF 1 Asymptotic Pr > S <.0001 Exact Pr >= S 3.716E-05 Simple Kappa Coefficient Kappa ASE % Lower Conf Limit % Upper Conf Limit Sample Size = 1600 Level of agreement

SPSS Output 26 SPSS: p. 361 and in “two-samples tests” window tick McNemar and click “exact”, then tick “exact”: