DOC PREVIEW
UNC-Chapel Hill STOR 151 - Chi-square Tests

This preview shows page 1-2-3-4-5-6 out of 17 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Chi-square tests(Chapter 10 of the text)1A motivating exampleA survey of attitudes to premarital sex among different religiousgroups asked 1579 people the question “When is premarital sexwrong?” They were asked to respond “Always or almost always”,or “Sometimes”, or “Never”. They were also asked whether theywere Protestant, Catholic or Jewish. (Those who were none ofthese are not included.) The results were as follows:Always or Sometimes Never Totalalmost alwaysProtestant 472 227 384 1083Catholic 99 120 226 445Jewish 3 14 34 51Total 574 361 644 1579A natural question to ask is whether this proves that people ofdifferent religions have different views about premarital sex.2As in any hypothesis testing problem, we start by formulating anull hypothesis that says there is no difference. Then, if thathypothesis is rejected with a sufficiently small P-value, we willconclude that there really is a difference.In this case, the simplest way to think about this is to look atthe overall proportions of people giving each response (“always”,“sometimes” or “never”). From the column totals in the previ-ous table, we derive the answers as5741579=0.3635,3611579=0.2286and6441579=0.4079.3Next, we calculate the “expected number” of responses we wouldsee in each cell of the table if the null hypothesis was correct. Forexample, among the 1083 Protestants, if they were distributedin the proportions .3635, .2286, .4079, then the actual num-bers would be 393.7, 247.6, 441.8. It doesn’t matter that theseare not whole numbers, because at this stage, it is a theoreti-cal calculation that leads to the following full table of expectedvalues:Always or Sometimes Never Totalalmost alwaysProtestant 393.7 247.6 441.8 1083Catholic 161.8 101.7 181.5 445Jewish 18.5 11.7 20.8 51Total 574 361 644 15794We now work outχ2=X(Observed − Expected)2Expected=(472 − 393.7)2393.7+(227 − 247.6)2247.6+(384 − 441.8)2441.8+(99 − 161.8)2161.8+(120 − 101.7)2101.7+(226 − 181.5)2181.5+(3 − 18.5)218.5+(14 − 11.7)211.7+(34 − 20.8)220.8= 15.572 + 1.714 + 7.562 + 24.375 + 3.293+10.910 + 12.986 + 0.452 + 8.377= 85.241.The symbol χ2(pronounced “chi-squared”) is used for the resultof this sum, because when H0is true, it has a distribution knownas the χ2distribution.5In order to use the χ2distribution, we need to compute thedegrees of freedom. The rule here is: for a table with r rowsand c columns,df = (r − 1)(c − 1).So in this case, r = c = 3 and df = 2 × 2 = 4.The next step is to look in a table of the χ2distribution — inour text, Table C or page A4 of Appendix A. In this case, lookingto the row with df = 4 we see values 5.39, 7.78, 9.49, 11.14,13.28, 14.86, 18.47 corresponding to right-tail probabilities 0.25,0.1, 0.05, 0.025, 0.01, 0.005, 0.001. The value 85.241 lies wellbeyond the range of this table — in other words, the P valueis much smaller than 0.001, indicating a very highly significanteffect. In other words, there is a definite association betweenreligious affiliation and how people respond to a questionnaireabout premarital sex — it wasn’t just a chance association.6Right-tail Probabilitydf 0.250 0.100 0.050 0.025 0.010 0.005 0.0011 1.32 2.71 3.84 5.02 6.63 7.88 10.832 2.77 4.61 5.99 7.38 9.21 10.60 13.823 4.11 6.25 7.81 9.35 11.34 12.84 16.274 5.39 7.78 9.49 11.14 13.28 14.86 18.475 6.63 9.24 11.07 12.83 15.09 16.75 20.526 7.84 10.64 12.59 14.45 16.81 18.55 22.467 9.04 12.02 14.07 16.01 18.48 20.28 24.328 10.22 13.36 15.51 17.53 20.09 21.95 26.129 11.39 14.68 16.92 19.02 21.67 23.59 27.8810 12.55 15.99 18.31 20.48 23.21 25.19 29.5911 13.70 17.28 19.68 21.92 24.72 26.76 31.2612 14.85 18.55 21.03 23.34 26.22 28.30 32.9113 15.98 19.81 22.36 24.74 27.69 29.82 34.5314 17.12 21.06 23.68 26.12 29.14 31.32 36.1215 18.25 22.31 25.00 27.49 30.58 32.80 37.7016 19.37 23.54 26.30 28.85 32.00 34.27 39.2517 20.49 24.77 27.59 30.19 33.41 35.72 40.7918 21.60 25.99 28.87 31.53 34.81 37.16 42.3119 22.72 27.20 30.14 32.85 36.19 38.58 43.8220 23.83 28.41 31.41 34.17 37.57 40.00 45.3125 29.34 34.38 37.65 40.65 44.31 46.93 52.6230 34.80 40.26 43.77 46.98 50.89 53.67 59.7040 45.62 51.81 55.76 59.34 63.69 66.77 73.4050 56.33 63.17 67.50 71.42 76.15 79.49 86.6660 66.98 74.40 79.08 83.30 88.38 91.95 99.6170 77.58 85.53 90.53 95.02 100.43 104.21 112.3280 88.13 96.58 101.88 106.63 112.33 116.32 124.8490 98.65 107.57 113.15 118.14 124.12 128.30 137.21100 109.14 118.50 124.34 129.56 135.81 140.17 149.457Footnote. Once again, we could make the exact calculation inExcel, using the CHIDIST function. It turns out the P value is1.35 × 10−17. As usual when such small probabilities arise from astatistical calculation, the actual number is pretty meaningless,but it emphasizes the point that such a result could not possiblyhave arisen by chance. Of course, other explanations — such asa non-random sampling procedure — remain fully plausible.8General principles behind the χ2testThis was a test of independence : under the null hypothesis, ifsomeone told us the response of a particular individual to one ofthe two questions being asked, their religious affiliation or theirviews about premarital sex, that would not help us predict theiranswer to the other question.In this example, both variables were unconstrained — neitherresponse (religious affiliation or attitude to premarital sex) wasdetermined in advance. But it is also possible that we couldselect the sample, e.g. by approaching churches and synagoguesto that we get a predetermined number of respondents (possibly,though not necessarily, equal) from each of the three religiousdenominations. In that case, the null hypothesis is best inter-preted as a statement about the conditional probabilities of thedxifferent responses about sex, given the interviewee’s religion.This is still called a test of independence and the same testingprocedure is used.9Steps in the test:1. Determine the expected values when the null hypothesis ofindependence is correct.2. Calculate χ2=P(Observed−Expected)2Expected3. Calculate df = (r − 1)(c − 1) where r and c are the numberof rows and columns in the table.4. Use Table C to determine the P value for the χ2value closestto the value calculated in step 2. Note that in this situation,we always use the one-sided (right-)tail probability.5. Interpret the result — the smaller the value of P, the moresignificant the result.However for this result to be valid, one of the requirements isthat the expected


View Full Document

UNC-Chapel Hill STOR 151 - Chi-square Tests

Download Chi-square Tests
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Chi-square Tests and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Chi-square Tests 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?