160 likes | 275 Views
Leftover Slides from Week Five. Steps in Hypothesis Testing. Specify the research hypothesis and corresponding null hypothesis Compute the value of a test statistic about the relationship between the two hypotheses
E N D
Steps in Hypothesis Testing • Specify the research hypothesis and corresponding null hypothesis • Compute the value of a test statistic about the relationship between the two hypotheses • Calculate the Degrees of Freedom (DF) and look up the statistic in the appropriate distribution to see if it falls into the critical region (for example, is a value of the t statistic large enough to fall into the area of the distribution corresponding to the 5% of cases in the upper and lower tails?) • Based on the information above, decide whether to reject the null hypothesis
Specify the Research Hypothesis and the Null Hypothesis • First, please download the SPSS file socialsurvey.sav. We will actually analyze the data in a few minutes but for now let’s stay at the hypothetical level • Let’s consider the relationship between political philosophy (whether one thinks of oneself as liberal or conservative (variable #23) and attitudes toward the death penalty in murder cases (variable #24) • First, let’s propose a research hypothesis, which speculates as to the existence of an association between the two variables • H1: There is a significant association between political philosophy and attitudes toward the death penalty in murder cases • Next, let’s construct the null hypothesis with respect to these two variables • H0: There is no relationship between political philosophy and attitudes toward the death penalty in murder cases • The null hypothesis is the hypothesis we’ll be testing. We can either reject it or fail to reject it, but we can’t confirm it. In practice, we are usually hoping to be able to reject it!
Research Hypothesis vs. Null Hypothesis • Our null hypothesis states that attitudes toward capital murder do not differ based on political philosophy. Another way to state this is that the two variables are independent of one another • However, after collecting our data and analyzing the contingency table with a measure of association such as chi square, we may look up our obtained value of chi square in a table containing the expected distribution of sample values (there is one in Table B, p. 475 in Kendrick or you can find them online). We decide before we look it up that we are going to require an “unlikelihood” of obtaining such a strong association of 5% or less by chance before we will be impressed. We find that, given our sample size and DF (in the case of chi-square (rows-1)(columns-1)), the value of chi-square we obtained from our sample data is likely to occur only one time in a thousand (.001) by chance
Research Hypothesis vs. Null Hypothesis, cont’d • What this tells us is that it is extremely unlikely that we would have drawn a result showing such a strong association between political philosophy and death penalty attitudes if in fact there was no such association in the population as a whole. And that the two variables show evidence of statistical dependence • Therefore, it would be reasonable to reject the null hypothesis of no association. In practice (e.g. write-ups in scholarly journals), researchers write of having “confirmed” the research hypothesis, but what they have actually done is reject the null hypothesis
Failing to Reject the Null Hypothesis, Error Types • Now suppose we ran our chi-square test and we obtained a result which when we compared it against the chi-square distribution fell below our predetermined cutoff point. Let’s suppose that we learned that a value of chi-square like the one we obtained would be obtained in the population about 20% (.20) of the time by chance • We would therefore be obliged to conclude that we had “failed to reject the null hypothesis” (not that we could accept it, though…)
Practicing with the Chi-Square Table Let’s practice with the Chi-square table. Suppose we set our critical region for rejection of the null hypothesis at .05., which is the minimum standard in the social sciences generally Assuming a degrees of freedom of 20, what value of chi-square would we have to get in our results to reject the null hypothesis? Critical Region = .05 DF=20
Chi-Square Test with SPSS • Let’s obtain the contingency table for the relationship between one’s political self-identification and attitude toward the death penalty • In SPSS, go to Analyze/Descriptives/Crosstabs • Put “favor or oppose the death penalty” as the Row variable and “think of self as liberal or conservative” as the Column variable. (It makes more sense to treat political self-identification as the independent variable) • Click on Cells and under Percentages select Row, Column, and Total. Under Counts click both Observed and Expected. Click Continue • Click on Statistics and select chi-square and lambda, then click Continue and then OK
Contingency Table with Chi-Square in SPSS Note that the proportion favoring the death penalty increases as you move from left to right (more liberal to more conservative) (follow the colored dots), while the opposite trend occurs as you look along the row for those opposing (Although note that there is a consistent trend for more people to favor the death penalty than oppose it)
Value, Significance of Chi-Square The obtained value of the statistic chi-square is 47.76, with 6 DF (for chi-square this is rows-1 times columns-1: how many cells in a table are free to vary, once the row and column marginal totals are known). Entering the table of the distribution of chi-square we find that for a DF of 6 we need a value of chi-square of 12.592 or better to reject the null hypothesis of no association in the population at a confidence level of .05. Our value exceeds that and in fact is significant beyond a confidence level of .001 (see output). So it is reasonable for us to assume that the obtained relationship we observed holds for the population in general. If we were to write this up for publication we might state it as “results supported the research hypothesis that political philosophy influences attitudes towards the death penalty (χ2 = 47.760, DF=6, p <.001). (p stands for the probability of obtaining a value of chi-square that large)
Calculation and Interpretation of Chi-square • Chi-square, unlike for example lambda, does not range between zero and 1 and cannot be interpreted as an index of the proportional reduction of error. • It is a measure of the statistical independence of two variables • The larger the value of chi-square for a constant value of DF, the stronger the dependence of the two variables (the stronger their association) • The measure is based on the departure of the observed frequencies in a contingency table from the expected frequencies • In the formula for chi-square, O represents the observed frequencies (called counts in the SPSS table) and E represents the expected frequencies (called expected counts)
Comparison of Observed and Expected Frequencies If we look within the “favor” row and we compare the observed (count) to the expected count we notice that generally the observed count is lower than expected for the liberal end and higher than expected for the conservative end.
How are Expected Frequencies Obtained? • The expected frequencies are what we would expect to see for a cell of the table if there were no association between the two variables, that is, if political philosophy had no influence on support for the death penalty • The greater the difference between the observed and expected frequencies, the greater the statistical dependence of the variables
Calculation of Expected Frequencies To get the expected frequency for a cell (how many people should be in it given the null hypothesis) we multiply its column marginal total by its row marginal proportion. For example, the expected value for the “extremely liberal/favor death penalty” cell is 29 X .775 = 22.5 (purple dot times blue dot). Note that the expected count for “liberal/favor” cell is also .775 of the total # of liberals. The expected count across the “favor” row will be .775 of the column total for that level of the political variable, and across the “oppose” row, .225. The expected percentages will be identical across a row (e.g., across “favor” or across “oppose”) and will be the same as the row marginal percentage
Calculation of Chi-square • 1. For each cell in the contingency table, subtract the expected from the observed frequency, and square the result. Divide by the expected frequency. • For example, for thecell “favor/extremely liberal,” subtract 22.5 from 16, square the result, and divide by 22.5, for a value for that cell of 1.877 • Repeat this process for all of the cells (not including the total cells). There will be (r)(c) cells, where r = row and c = column • Chi square is the sum of the products for all of the cells.
Some Characteristics of Chi-square • Chi square is a positively skewed distribution which becomes less skewed as the DF increases • Values of chi-square are highly influenced by sample size. It is pretty easy to get a significant chi-square with a large sample • Use in conjunction with measures of association such as lambda or tau to get PRE (estimate of proportional reduction of error). It is important to have an adequate number of cases (5 or more) in each cell or that cell becomes influential in the calculation disproportionately to its actual influence • Collapse categories and recode to increase cell size, and/or increase N • Yates’ continuity correction for 2X2 tables with cell n between 5 and 10 • SPSS output: Likelihood ratio (another test of significance of association between row and column variables based on maximum likelihood estimation Linear by linear association (version of chi-square for ordinal data which assumes data has a near-interval character) Asymptotic significance – tails of the underlying distribution used to do the significance test come as close as you please to the horizontal axis but never meet it, like a normal distribution. Reasonable to assume when N is large. SPSS offers some “exact” tests for use with small N, for example, Fisher’s exact test