260 likes | 460 Views
Qualitative data – tests of association. The Chi-Square Distribution and Test for Independence Hypothesis testing between two or more categorical variables. Sporiš Goran, PhD. http://kif.hr/predmet/mki http://www.science4performance.com/. Chi-Square Distribution.
E N D
Qualitative data – tests of association The Chi-Square Distribution and Test for Independence Hypothesis testing between two or more categorical variables Sporiš Goran, PhD. http://kif.hr/predmet/mki http://www.science4performance.com/
Chi-Square Distribution • The chi-square distribution results when independent variables with standard normal distributions are squared and summed.
Chi-square Degrees of freedom • df = (r-1) (c-1) • Where r = # of rows, c = # of columns • Thus, in any 2x2 contingency table, the degrees of freedom = 1. • As the degrees of freedom increase, the distribution shifts to the right and the critical values of chi-square become larger.
Using the Chi-Square Test • Often used with contingency tables (i.e., crosstabulations) • E.g., gender x student • The chi-square test of independence tests whether the columns are contingent on the rows in the table. • In this case, the null hypothesis is that there is no relationship between row and column frequencies. • H0: The 2 variables are independent.
Requirements for Chi-Square test • Must be a random sample from population • Data must be in raw frequencies • Variables must be independent • Categories for each I.V. must be mutually exclusive and exhaustive
Example Crosstab: Gender x Student Observed Expected
Special Cases • Fisher’s Exact Test • When you have a 2 x 2 table with expected frequencies less than 5. • Strength of Association • Some use Cramer’s V (for any two nominal variables) or Phi (for 2 x 2 tables) to give a value of association between the variables.
Two chi square tests • Goodness of fit • One variable • Determines how well the sample proportions match a pre-specified distribution • Independence • Two variables • Determines whether there is a relationship between two variables
Steps in hypothesis testing • State the hypotheses • null • research • Select an alpha level and determine the critical value • Compute the test statistic • Make a decision
Test for goodness of fit Forms of the null hypothesis • No preference • There is no difference in proportions among the categories • Participants do not prefer one category over another • Example: Pepsi: 50%, Coke 50% • No difference from a comparison population • There is no difference between the sample distribution and a known (population) distribution • Example: ND: 20% Bl, 75% Br, 5% R US: 20% Bl, 75% Br, 5% R
Test for goodness of fit • Null hypothesis • Specifies a distribution of proportions • Research hypothesis • Specifies that the distribution will be different than that indicated in the null hypothesis
Calculating the test statistic • Observed frequencies • the number of individuals from the sample who are classified in a particular category • fo • Expected frequencies • the number of individuals from the sample who are expected to be classified in a particular category • fe
Calculating the test statistic Coin flip: What percentage of people will predict heads? tails?
Calculating the test statistic • Expected frequency = fe = pn • n = 50 (sample size) • fe = .5 x 50 = 25
n = 50 Question: The last five flips were tails. What do you predict for the next flip? Calculating the test statistic
Calculating the test statistic x2 = ∑(fo - fe)2 fe Steps find the difference between fo and fe for each category square the difference divide the squared difference by fe sum the values from all categories
Chi square distribution Critical range 0 x2 Low chi square Hi chi square
Test for goodness of fit • The greater the number of categories, the greater the likelihood of a large observed chi square value • Degrees of freedom (df) • The number of values that are free to vary • df = C – 1 • C = the number of categories
Chi square distribution 5% 0 3.84 x2 Critical value (df = 1, = .05) = 3.84
Goodness of fit • Make a decision • Critical value = 3.84 with df = 1 and = .05. • Observed chi square = 8.0 • 8.0 > 3.84 • Observed chi square is greater than critical value • We reject the null hypothesis • Conclude that category frequencies are different • People were more likely to predict heads than tails