Applied Statistics Using SPSS

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.
Chapter 18: The Chi-Square Statistic
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)
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.
ChiSq Tests: 1 Chi-Square Tests of Association and Homogeneity.
Categorical Data Analysis: Stratified Analyses, Matching, and Agreement Statistics Biostatistics March 2007 Carla Talarico.
Inferential Statistics: SPSS
Analysis of Categorical Data
1 Applied Statistics Using SAS and SPSS Topic: Chi-square tests By Prof Kelly Fan, Cal. State Univ., East Bay.
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.
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 Tests: Chi Square   Lesson 16. Parametric vs. Nonparametric Tests n Parametric hypothesis test about population parameter (  or  2.
HYPOTHESIS TESTING BETWEEN TWO OR MORE CATEGORICAL VARIABLES The Chi-Square Distribution and Test for Independence.
Fundamental Statistics in Applied Linguistics Research Spring 2010 Weekend MA Program on Applied English Dr. Da-Fu Huang.
Statistical Analysis using SPSS Dr.Shaikh Shaffi Ahamed Asst. Professor Dept. of Family & Community Medicine.
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.
1 G Lect 7a G Lecture 7a Comparing proportions from independent samples Analysis of matched samples Small samples and 2  2 Tables Strength.
Types of Categorical Data Qualitative/Categorical Data Nominal CategoriesOrdinal Categories.
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 4 Selected Nonparemetric Techniques: PARAMETRIC VS. NONPARAMETRIC.
Megan Templin, MPH, M.S. H. James Norton, PhD Dickson Advanced Analytics Research Division Carolinas Healthcare System.
CHAPT 18 Resampling and Nonparametric Approaches to Data &
Introduction to Marketing Research
The Chi-square Statistic
March 28 Analyses of binary outcomes 2 x 2 tables
Non-Parametric Statistics
Chi-Square (Association between categorical variables)
BINARY LOGISTIC REGRESSION
Chi-square Basics.
Chapter 9: Non-parametric Tests
Lecture8 Test forcomparison of proportion
Statistical Analysis Professor Lynne Stokes
Slides to accompany Weathington, Cunningham & Pittenger (2010), Chapter 16: Research with Categorical Data.
Comparing Three or More Means
8. Association between Categorical Variables
Hypothesis Testing Review
Categorical Data Aims Loglinear models Categorical data
Qualitative data – tests of association
Data Analysis for Two-Way Tables
Chapter 11 Goodness-of-Fit and Contingency Tables
SA3202 Statistical Methods for Social Sciences
Elementary Statistics
The Chi-Square Distribution and Test for Independence
Examples and SAS introduction: -Violations of the rare disease assumption -Use of Fisher’s exact test January 14, 2004.
Different Scales, Different Measures of Association
Saturday, August 06, 2016 Farrokh Alemi, PhD.
Hypothesis testing. Chi-square test
If we can reduce our desire,
Statistical Analysis using SPSS
Chapter 10 Analyzing the Association Between Categorical Variables
Contingency Tables (cross tabs)
Overview and Chi-Square
Contingency Tables.
Analyzing the Association Between Categorical Variables
Hypothesis Testing Part 2: Categorical variables
Analysis of Categorical Data
Parametric versus Nonparametric (Chi-square)
Categorical Data Analysis
Applied Statistics Using SPSS
Chapter 18: The Chi-Square Statistic
InferentIal StatIstIcs
 .
Presentation transcript:

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

Outline ALL variables must be categorical Goal one: verify a distribution of Y One-sample Chi-square test (SPSS lesson 40) Goal two: test the independence between two categorical variables Chi-square test for two-way contingency table (SPSS lesson 41) McNemar’s test for paired data (SPSS lesson 44) Measure the dependence (Phil and Kappa coefficients) (SPSS lesson 41, 44) Goal three: test the independence between two categorical variables after controlling the third factor Mantel-Haenszel Chi-square test (SPSS in class)

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?

Raw data vs. Grouped data Grouped data are shown in next slide. ID Name Depression level after birth in comparison with before birth 1 *** Same 2 Less depressed 3 More depressed

Example: Postpartum Depression Study Depression after birth in comparison with before birth Observed frequencies Hypothesized proportions Expected frequencies Less depressed (-1) 14 1/3 20 Neither less nor more depressed (0) 33 More depressed (1) 13 From a random sample of 60 women

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

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

SPSS Output Weight your data by count first (data>>weight cases) Analyze >> Nonparametric Tests >> Legacy Dialogs >> Chi Square, count as test variable

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.

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

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

SPSS Output

Conclusion It is equally like to experience change or no change in depression before and after child birth. Question: For those who do experience change, is it equally like to be less or more depressed?

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

Contingency Tables (Crosstabs) 1991 General Social Survey Frequency Party Identification Democrat Independent Republican Race White 341 105 405 Black 103 15 11

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

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 : Data>> weight cases>> Weight cases by, select count variable P. 333: Analyze >> descriptive statistics >> crosstabs, cell

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

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

SPSS Output SPSS output: in “crosstabs” window, click “exact”, then tick “exact”:

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 from the other sample (eg. Twins)

Example: Rating for Prime Minister Second Survey First Survey Approve Disapprove 794 150 86 570

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

McNemar Test (for 2x2 Tables only) SPSS: Lesson 44 Ho: marginal homogeneity Ha: no marginal homogeneity Exact p-value Approximate p-value (When n12+n21>10)

Output In SPSS: Analyze >> Descriptive statistics >> crosstabs, in “statistics” tick “Kappa” and “McNemar” McNemar's Test Statistic (S) 17.3559 DF 1 Asymptotic Pr > S <.0001 Exact Pr >= S 3.716E-05 Simple Kappa Coefficient Kappa 0.6996 ASE 0.0180 95% Lower Conf Limit 0.6644 95% Upper Conf Limit 0.7348 Sample Size = 1600 Level of agreement

SPSS Output SPSS(p. 361): Analyze >> Nonparametric tests >> Legacy dialogs >> 2 related samples; in “two-samples tests” tick “McNemar” and click “exact”, then tick “exact” again

Stratified 2 by 2 Tables (Meta-Analysis) Goal: to investigate the risk factor (lack of sleep) to the outcome (failing a test) Test Results, Boys Sleep Fail Pass Low 20 100 High 15 150 Test Results, Girls Sleep Fail Pass Low 30 100 High 25 200

Cochran Mantel-Haenszel Test After Importing your dataset, and providing names to variables, click on: ANALYZE >> DESCRIPTIVE STATISTICS >> CROSSTABS For ROWS, Select the Independent Variable For COLUMNS, Select the Dependent Variable For LAYERS, Select the Strata Variable Under STATISTICS, Click on COCHRAN’S AND MANTEL-HAENSZEL STATISTICS NOTE: You will want to code the data so that the outcome present (Yes) category has the lower value (e.g. 1) and the outcome absent (No) category has the higher value (e.g. 2). Do the same for risk factor: 1 for exposure; 2 for no exposure. Use Value Labels to keep output straight.

SPSS Output

SAS Output Common Odds Ratio and Relative Risks Statistic Method Value Cochran-Mantel-Haenszel Statistics (Based on Table Scores) Statistic Alternative Hypothesis DF Value Prob 1 Nonzero Correlation 12.4770 0.0004 2 Row Mean Scores Differ 3 General Association Breslow-Day Test for Homogeneity of the Odds Ratios Chi-Square 0.1501 DF 1 Pr > ChiSq 0.6985 Common Odds Ratio and Relative Risks Statistic Method Value 95% Confidence Limits Odds Ratio Mantel-Haenszel 2.2289 1.4185 3.5024   Logit 2.2318 1.4205 3.5064 Relative Risk (Column 1) 1.9775 1.3474 2.9021 1.9822 1.3508 2.9087 Relative Risk (Column 2) 0.8891 0.8283 0.9544 0.8936 0.8334 0.9582