#set document(title: "10.3 Test for Independence", author: "Rachel Webb") #set page(width: 8.5in, height: auto, margin: 1in) #import "@preview/cetz:0.5.2" #set text(font: ("STIX Two Text", "Libertinus Serif", "New Computer Modern"), size: 10.5pt, lang: "en") #show math.equation: set text(font: ("STIX Two Math", "New Computer Modern Math")) #set par(justify: true, leading: 0.62em, spacing: 0.9em) #set enum(spacing: 1.1em) // room between list items so tall inline fractions don't collide #set list(spacing: 1.1em) #set table(stroke: 0.5pt + rgb("#c7ccd3")) #let BLUE = rgb("#183B6F") // brand navy — section bars + example/solution labels (white on navy 11.09:1) #let ORANGE = rgb("#A94509") // brand primary-700 — AA-safe deep orange for TEXT (5.93:1 on white; raw brand #F37021 is 2.94:1 and must never carry text) #let RED = rgb("#DC2626") // brand error-600 #let GREEN = rgb("#059669") // brand success-600 (decoration only; small green text uses green-text #007942) #show heading.where(level: 1): it => block(width: 100%, above: 0pt, below: 16pt, fill: gradient.linear(BLUE, rgb("#2C5AA0")), inset: (x: 14pt, y: 12pt), radius: 3pt, text(fill: white, weight: "bold", size: 19pt, it.body)) #show heading.where(level: 2): it => block(width: 100%, above: 18pt, below: 10pt, fill: BLUE, inset: (x: 10pt, y: 6pt), radius: 2pt, text(fill: white, weight: "bold", size: 12pt, it.body)) #show heading.where(level: 3): it => text(fill: ORANGE, weight: "bold", size: 12.5pt, it.body) #show heading.where(level: 4): it => text(fill: BLUE, weight: "bold", size: 10.5pt, it.body) #let examplebox(label, title, body) = block(width: 100%, breakable: true, fill: rgb("#EFF1F5"), stroke: 0.5pt + rgb("#CFDDF0"), radius: 4pt, inset: 10pt, above: 12pt, below: 12pt)[ #block(below: 6pt)[#box(fill: BLUE, inset: (x: 6pt, y: 2pt), radius: 2pt, text(fill: white, weight: "bold", size: 8.5pt, label)) #h(0.4em) #strong[#title]] #body] // rail = decorative left rule (raw brand token); labelcolor = AA-safe label text shade #let notebox(label, rail, labelcolor, tint, body) = block(width: 100%, breakable: true, fill: tint, stroke: (left: 3pt + rail), inset: (left: 10pt, rest: 8pt), radius: (right: 4pt), above: 11pt, below: 11pt)[ #text(fill: labelcolor, weight: "bold", size: 7.5pt, tracking: 0.5pt)[#upper(label)] #linebreak() #body] #let solutionbox(body) = block(above: 4pt, below: 8pt)[ #text(fill: BLUE, weight: "bold", size: 8.5pt)[Solution] #linebreak() #body] #let figph(msg) = block(width: 100%, height: 60pt, fill: rgb("#f6f7f9"), stroke: (paint: rgb("#c7ccd3"), dash: "dashed"), radius: 4pt, inset: 10pt)[ #align(center + horizon, text(fill: rgb("#889"), style: "italic", size: 9pt, msg))] // Standardize inlined figure sizes: measure the natural CeTZ canvas, then scale to a // consistent envelope (aspect-aware; see build_typst.py FIG_* constants). Unlike the // print preamble, dimensions are FLOORED: in an editor a user can trim a figure to a // degenerate 1-D shape (a bare line), and w/h or tw/w would then divide by zero. #let _STD_W = 3.5 #let _WIDE_W = 5.6 #let _MAX_H = 3.4 #let _ASPECT_WIDE = 2.2 #let _UPSCALE_MAX = 1.15 #let stdfig(body) = context { let m = measure(body) let w = calc.max(m.width / 1in, 0.01) let h = calc.max(m.height / 1in, 0.01) let tw = if w / h > _ASPECT_WIDE { _WIDE_W } else { _STD_W } let s = calc.min(tw / w, _MAX_H / h, _UPSCALE_MAX) align(center, box(scale(x: s * 100%, y: s * 100%, reflow: true, body))) } #show figure: set block(breakable: false) #set figure(gap: 8pt) #show figure.caption: set text(size: 8.5pt, fill: rgb("#555")) == 10.3#h(0.6em)Test for Independence Use the chi-square test for independence to test the independence of two categorical variables. Remember, qualitative data is collected on individuals that are categories or names. Then you would count how many of the individuals had particular qualities. An example is that there is a theory that there is a relationship between breastfeeding and having autism spectrum disorder (ASD). To determine if there is a relationship, researchers could collect the time-period that a mother breastfed her child and if that child was diagnosed with ASD. Then you would have a table containing this information. Now you want to know if each cell is independent of each other cell. Remember, independence says that one event does not affect another event. Here it means that having ASD is independent of being breastfed. What you really want is to see if they are dependent (not independent). In other words, does one affect the other? If you were to do a hypothesis test, this is your alternative hypothesis and the null hypothesis is that they are independent. There is a hypothesis test for this and it is called the #strong[chi-square test for independence]. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ There is only a right-tailed test for testing the independence between two variables: #math.equation(block: false, alt: "H sub 0 :")[$H_(0) :$] Variable 1 and Variable 2 are independent (unrelated). #math.equation(block: false, alt: "H sub 1 :")[$H_(1) :$] Variable 1 and Variable 2 are dependent (related). ] Finding the test statistic involves several steps. First, the data is collected, counted, and then organized into a contingency table. These values are known as the observed frequencies, and the symbol for an observed frequency is #math.equation(block: false, alt: "O")[$O$]. Total each row and column. The null hypothesis is that the two variables are independent. If two events are independent then #math.equation(block: false, alt: "P open parenthesis B close parenthesis equals P open parenthesis B vertical bar A close parenthesis")[$P ( B ) = P ( B | A )$] and we can use the multiplication rule for independent events, to calculate the probability that variable #math.equation(block: false, alt: "A")[$A$] and #math.equation(block: false, alt: "B")[$B$] as the #math.equation(block: false, alt: "P open parenthesis A and B close parenthesis equals P open parenthesis A close parenthesis times P open parenthesis B close parenthesis")[$P ( A "and" B ) = P ( A ) · P ( B )$]. Remember in a hypothesis test, you assume that #math.equation(block: false, alt: "H sub 0")[$H_(0)$] is true, the two variables are assumed to be independent. #math.equation(block: true, alt: "P open parenthesis A and B close parenthesis equals P open parenthesis A close parenthesis times P open parenthesis B close parenthesis if A and B are independent; equals the fraction Number of ways A can happen over Total number of individuals times the fraction Number of ways B can happen over Total number of individuals; equals the fraction Row Total over n times the fraction Column Total over n")[$P ( A "and" B ) = P ( A ) · P ( B ) " if " A " and " B " are independent" \ = frac(" Number of ways A can happen ", " Total number of individuals ") · frac(" Number of ways B can happen ", " Total number of individuals ") \ = frac(" Row Total ", n) · frac(" Column Total ", n)$] #figure(figph[General two-way table layout with Variable 1 columns B and Not B and Variable 2 rows A and Not A; the cells hold P(A and B), P(A and Not B), P(Not A and B), and P(Not A and Not B), with row totals for A and Not A, column totals for B and Not B, and grand total n.], alt: "General two-way table layout with Variable 1 columns B and Not B and Variable 2 rows A and Not A; the cells hold P(A and B), P(A and Not B), P(Not A and B), and P(Not A and Not B), with row totals for A and Not A, column totals for B and Not B, and grand total n.", caption: none) Now you want to find out how many individuals you expect to be in a certain cell. To find the expected frequencies, you just need to multiply the probability of that cell times the total number of individuals. Do not round the expected frequencies. #math.equation(block: true, alt: "Expected frequency (cell A and B) equals E open parenthesis A and B close parenthesis; equals n open parenthesis the fraction Row Total over n times the fraction Column Total over n close parenthesis equals the fraction Row Total times Column Total over n")[$"Expected frequency (cell A and B)" = E ( A " and " B ) \ = n ( frac(" Row Total ", n) · frac(" Column Total ", n) ) = frac(" Row Total " · " Column Total ", n)$] If the variables are independent, the expected frequencies and the observed frequencies should be the same. The test statistic here will involve looking at the difference between the expected frequency and the observed frequency for each cell. Then you want to find the “total difference” of all of these differences. The larger the total, the smaller the chances that you could find that test statistic given that the assumption of independence is true. That means that the assumption of independence is not true. How do you find the test statistic? First, compute the differences between the observed and expected frequencies. Because some of these differences will be positive and some will be negative, you need to square these differences. These squares could be large just because the frequencies are large, so you need to divide by the expected frequencies to scale them. Then finally add up all of these fractional values. This process finds the variance, and we use a chi-square distribution to find the critical value or p-value. Hence, sometimes this test is called a chi-square test. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ The #math.equation(block: false, alt: "χ squared")[$χ^(2)$]-test is a statistical test for testing the independence between two variables. It can be used when the data are obtained from a random sample, and when the expected value #math.equation(block: false, alt: "open parenthesis E close parenthesis")[$( E )$] from each cell is 5 or more. The formula for the #math.equation(block: false, alt: "χ squared")[$χ^(2)$] -test statistic is: #math.equation(block: false, alt: "χ squared equals ∑ the fraction open parenthesis O minus E close parenthesis squared over E")[$χ^(2) = ∑ frac(( O − E )^(2), E)$]. Use #math.equation(block: false, alt: "χ squared")[$χ^(2)$] -distribution with degrees of freedom #math.equation(block: false, alt: "df")[$"df"$] = (the number of rows – 1) (the number of columns – 1), that is, #math.equation(block: false, alt: "df equals open parenthesis R minus 1 close parenthesis open parenthesis C minus 1 close parenthesis")[$"df" = ( R − 1 ) ( C − 1 )$]. where #math.equation(block: false, alt: "O")[$O$] = the observed frequency (sample results) and #math.equation(block: false, alt: "E")[$E$] = the expected frequency (based on #math.equation(block: false, alt: "H sub 0")[$H_(0)$] and the sample size). ] #examplebox("Example 1")[][ Is there a relationship between autism spectrum disorder (ASD) and breastfeeding? To determine if there is, a researcher asked mothers of ASD and non-ASD children to say what time-period they breastfed their children. Does the data provide enough evidence to show that breastfeeding and ASD are independent? Test at the 1% level. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Decide this 2 × 4 test two ways] Both links open the chi-square curve with df = (2 - 1)(4 - 1) = 3. The first is =CHISQ.INV.RT(0.01,3), entered as the left-tail area 0.99, and returns the critical value 11.3449 - just above the test statistic 11.217, so we fail to reject. The second shades the area right of 11.217 and gives p = 0.0106, which is more than α = 0.01: the same decision. Change the area to 0.95 to see how differently this test reads at α = 0.05. - Critical value χ² with df = 3, left area 0.99 = 11.3449 - p-value: P(χ² \> 11.217) = 0.0106 with df = 3 ] #figure(figph[Contingency table of ASD by length of breastfeeding: for None, Less than 2 months, 2 to 6 months, and Over 6 months, the Yes row has 241, 198, 164, 215 with total 818 and the No row has 20, 25, 27, 44 with total 116; column totals are 261, 223, 191, 259 with grand total 934.], alt: "Contingency table of ASD by length of breastfeeding: for None, Less than 2 months, 2 to 6 months, and Over 6 months, the Yes row has 241, 198, 164, 215 with total 818 and the No row has 20, 25, 27, 44 with total 116; column totals are 261, 223, 191, 259 with grand total 934.", caption: none) (Schultz, Klonoff-Cohen, Wingard, Askhoomoff, Macera, Ji & Bacher, 2006.) #solutionbox[ The question is asking if breastfeeding and ASD are independent. The correct hypothesis is: #math.equation(block: false, alt: "H sub 0 :")[$H_(0) :$] Autism spectrum disorder and length of breastfeeding are independent. #math.equation(block: false, alt: "H sub 1 :")[$H_(1) :$] Autism spectrum disorder and length of breastfeeding are dependent. There are 2 rows and 4 columns of data. We must compute the Expected count for each of the #math.equation(block: false, alt: "2 times 4 equals 8")[$2 × 4 = 8$] cells. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ The expected counts for each cell are found by the formula: #math.equation(block: true, alt: "Expected Value equals the fraction Row Total times Column Total over Grand Total")[$" Expected Value " = frac(" Row Total " · " Column Total ", " Grand Total ")$] ] ] ] It will be helpful to make a table for the expected counts and another one for each of the #math.equation(block: false, alt: "the fraction open parenthesis O minus E close parenthesis squared over E")[$frac(( O − E )^(2), E)$] values to aid in computing the test statistic. #figure(figph[Three stacked tables for the ASD and breastfeeding test: the observed counts; the expected counts computed as row total times column total over 934, giving 228.585, 195.304, 167.278, 226.833 for Yes and 32.415, 27.696, 23.722, 32.167 for No; and the (O−E)²/E values 0.6743, 0.0372, 0.0642, 0.6173 and 4.7552, 0.2624, 0.4531, 4.3529, which sum to the test statistic 11.217.], alt: "Three stacked tables for the ASD and breastfeeding test: the observed counts; the expected counts computed as row total times column total over 934, giving 228.585, 195.304, 167.278, 226.833 for Yes and 32.415, 27.696, 23.722, 32.167 for No; and the (O−E)²/E values 0.6743, 0.0372, 0.0642, 0.6173 and 4.7552, 0.2624, 0.4531, 4.3529, which sum to the test statistic 11.217.", caption: none) The test statistic is the sum of all eight #math.equation(block: false, alt: "the fraction open parenthesis O minus E close parenthesis squared over E")[$frac(( O − E )^(2), E)$] values: #math.equation(block: false, alt: "χ squared equals ∑ the fraction open parenthesis O minus E close parenthesis squared over E equals 11.217")[$χ^(2) = ∑ frac(( O − E )^(2), E) = 11.217$]. The critical value for a right-tailed #math.equation(block: false, alt: "χ squared")[$χ^(2)$]-test with degrees of freedom #math.equation(block: false, alt: "df equals open parenthesis R minus 1 close parenthesis open parenthesis C minus 1 close parenthesis equals open parenthesis 2 minus 1 close parenthesis open parenthesis 4 minus 1 close parenthesis equals 3")[$"df" = ( R − 1 ) ( C − 1 ) = ( 2 − 1 ) ( 4 − 1 ) = 3$] is found using a #math.equation(block: false, alt: "χ squared")[$χ^(2)$] -distribution #math.equation(block: false, alt: "α equals 0.01")[$α = 0.01$] right-tail area. The critical value is #math.equation(block: false, alt: "χ squared")[$χ^(2)$] = CHISQ.INV.RT(0.01,3) = 11.3449. See Figure 10-5. #figure(figph[Right-skewed chi-square curve with the critical value 11.3449 marked in green on the axis and the test statistic 11.217 marked in blue just to its left, outside the small shaded rejection region in the right tail.], alt: "Right-skewed chi-square curve with the critical value 11.3449 marked in green on the axis and the test statistic 11.217 marked in blue just to its left, outside the small shaded rejection region in the right tail.", caption: [Figure 10-5: Values of #math.equation(block: false, alt: "χ squared")[$χ^(2)$] and #math.equation(block: false, alt: "χ sub α squared")[$χ_(α)^(2)$] on a #math.equation(block: false, alt: "χ squared")[$χ^(2)$]-test with #math.equation(block: false, alt: "df equals 3")[$"df" = 3$] and #math.equation(block: false, alt: "α equals 0.01")[$α = 0.01$].]) Alternatively, use the online calculator: #link("https://homepage.divms.uiowa.edu/~mbognar/applets/chisq.html")[https://homepage.divms.uiowa.edu/~mbognar/applets/chisq.html]. #figure(figph[Online chi-square distribution calculator titled Chi-Square Distribution with inputs df = 3, x = 11.34487, and P(X \> x) = .01, above a plotted right-skewed chi-square curve on an axis from 0 to 12.], alt: "Online chi-square distribution calculator titled Chi-Square Distribution with inputs df = 3, x = 11.34487, and P(X > x) = .01, above a plotted right-skewed chi-square curve on an axis from 0 to 12.", caption: none) Since the test statistic #math.equation(block: false, alt: "χ squared equals 11.217")[$χ^(2) = 11.217$] is not in the rejection area, our decision is to fail to reject #math.equation(block: false, alt: "H sub 0")[$H_(0)$]. There is not enough evidence to show a relationship between autism spectrum disorder and breastfeeding. #figure(figph[TI-84 calculator screen showing a χ²cdf command with lower bound 11.217 returning .0106085228.], alt: "TI-84 calculator screen showing a χ²cdf command with lower bound 11.217 returning .0106085228.", caption: none) If we were asked to find the p-value, you would just find the area to right of the test statistic (always a right-tailed test) using your calculator or Excel. This gives a p-value = 0.0106, which is more than #math.equation(block: false, alt: "α equals 0.01")[$α = 0.01$]; therefore, we do not reject H#sub[0]. You can also use the #math.equation(block: false, alt: "χ squared")[$χ^(2)$]-Test shortcut keys on your calculator to get a p-value, see directions below. #strong[TI-84:] Press the \[2#super[nd]\] then \[MATRX\] key. Arrow over to the EDIT menu and 1:\[A\] should be highlighted, press the \[ENTER\] key. For a #math.equation(block: false, alt: "m times n")[$m × n$] contingency table, type in the number of rows #math.equation(block: false, alt: "open parenthesis m close parenthesis")[$( m )$] and the number of columns #math.equation(block: false, alt: "open parenthesis n close parenthesis")[$( n )$] at the top of the screen so that it looks like this: MATRIX\[A\] #math.equation(block: false, alt: "m times n")[$m × n$]. For a #math.equation(block: false, alt: "2 times 4")[$2 × 4$] contingency table, the top of the screen would look like this: MATRIX\[A\] #math.equation(block: false, alt: "2 times 4")[$2 × 4$]. As you hit \[ENTER\], the table will automatically widen to the size you put in. Now enter all of the observed values in their proper positions. Then press the \[STAT\] key, arrow over to the \[TESTS\] menu, arrow down to the option \[C: #math.equation(block: false, alt: "χ squared")[$χ^(2)$] -Test\] and press the \[ENTER\] key. Leave the default as Observed:\[A\] and Expected:\[B\], arrow down to \[Calculate\] and press the \[ENTER\] key. The calculator returns the #math.equation(block: false, alt: "χ squared")[$χ^(2)$]-test statistic and the p-value. If you go back to the matrix menu \[2#super[nd]\] then \[MATRX\] key, arrow over to EDIT and choose 2:\[B\], you will see all of the expected values. #figure(figph[Five TI-84 screens for the matrix χ²-Test: the matrix EDIT menu, matrix \[A\] entered as a 2 by 4 table of observed counts ending with cell 2,4 = 44, the TESTS menu with C:χ²-Test selected, the inputs Observed:\[A\] and Expected:\[B\], and the output χ²=11.21668801, p=.0106100514, df=3.], alt: "Five TI-84 screens for the matrix χ²-Test: the matrix EDIT menu, matrix [A] entered as a 2 by 4 table of observed counts ending with cell 2,4 = 44, the TESTS menu with C:χ²-Test selected, the inputs Observed:[A] and Expected:[B], and the output χ²=11.21668801, p=.0106100514, df=3.", caption: none) #strong[TI-89:] First you need to create the matrix for the observed values: Press \[Home\] to return to the Home screen, press \[Apps\] and select Data/Matrix Editor. A menu is displayed, select 3:New. The New dialog box is displayed. Press the right arrow key to highlight 2:Matrix, and press \[ENTER\] to choose Matrix type. Press the down arrow key to highlight 1:Main, and press \[ENTER\], to choose main folder. Press the down arrow key, and then enter the letter #math.equation(block: false, alt: "o")[$o$] for the name in the Variable field. Enter 2 for Row dimension and 4 for Column dimension. Press \[ENTER\] to display the matrix editor. Enter the observed value (do not include total row or column). Important: Next time you use this test instead of option 3:New, choose 2: Open. The open dialog box is displayed. Press the right arrow key to highlight 2:Matrix, and press \[ENTER\] to choose Matrix type. Press the down arrow key to make sure you are in the Main folder and that your variable says #math.equation(block: false, alt: "o")[$o$]. Press \[Apps\], and then select Stats/List Editor. To display the Chi-square 2-Way dialog box, press 2#super[nd] then F6 \[Tests\], then select 8: Chi-2 2-way. Enter in in the Observed Mat: o; leave the other rows alone: Store Expected to: statvars\\e; Store CompMat to: statvars\\c. This will store the expected values in the matrix folder statvars with the name expmat, and the #math.equation(block: false, alt: "open parenthesis o minus e close parenthesis squared / e")[$( o − e )^(2) / e$] values in the matrix compmat. Press the \[ENTER\] key to calculate. The calculator returns the #math.equation(block: false, alt: "χ squared")[$χ^(2)$]-test statistic and the p-value. If you go back to the matrix menu, you will see some of the expected and #math.equation(block: false, alt: "open parenthesis o minus e close parenthesis squared / e")[$( o − e )^(2) / e$] values. #figure(figph[Sequence of TI-89 screens for the two-way chi-square test: creating a new 2 by 4 matrix named o in the Data/Matrix Editor, entering the observed counts, then in the Stats/List Editor choosing Tests and Chi2 2-way with Observed Mat o and stored expmat and compmat matrices, ending with results Chi-2 = 11.2167, P Value = .01061, df = 3.], alt: "Sequence of TI-89 screens for the two-way chi-square test: creating a new 2 by 4 matrix named o in the Data/Matrix Editor, entering the observed counts, then in the Stats/List Editor choosing Tests and Chi2 2-way with Observed Mat o and stored expmat and compmat matrices, ending with results Chi-2 = 11.2167, P Value = .01061, df = 3.", caption: none) To see all the expected values, select \[APPS\] and select Data/Matrix Editor. Select 2:Open, change the Type to Matrix, change the Folder to statvars, and change the Variable to expmat. #figure(figph[Four TI-89 screens opening the stored expected matrix: the Apps screen with Data/Matrix Editor selected, the 2:Open option, the Open dialog with Type Matrix, Folder statvars, and Variable expmat, and the matrix of expected values with row 1 starting 228.58, 195.3, 167.28 and row 2 starting 32.415, 27.696, 23.722.], alt: "Four TI-89 screens opening the stored expected matrix: the Apps screen with Data/Matrix Editor selected, the 2:Open option, the Open dialog with Type Matrix, Folder statvars, and Variable expmat, and the matrix of expected values with row 1 starting 228.58, 195.3, 167.28 and row 2 starting 32.415, 27.696, 23.722.", caption: none) To see all the #math.equation(block: false, alt: "open parenthesis o minus e close parenthesis squared / e")[$( o − e )^(2) / e$] values, select \[APPS\] and select Data/Matrix Editor. Select 2:Open, change the Type to Matrix, change the Folder to statvars, and change the Variable to compmat. #figure(figph[Four TI-89 screens opening the stored comp matrix: the Apps screen with Data/Matrix Editor selected, the 2:Open option, the Open dialog with Folder statvars and Variable compmat, and the matrix of (O−E)²/E values with row 1 starting .67434, .03721, .06425 and row 2 starting 4.7552, .26242, .45308.], alt: "Four TI-89 screens opening the stored comp matrix: the Apps screen with Data/Matrix Editor selected, the 2:Open option, the Open dialog with Folder statvars and Variable compmat, and the matrix of (O−E)²/E values with row 1 starting .67434, .03721, .06425 and row 2 starting 4.7552, .26242, .45308.", caption: none) If you need to delete a row or column, move the cursor to the row or column that you want to delete, then select F6 Util, then 2:Delete, then choose row or column, then enter. To add a row or column, just arrow over to the new row or column and type in the observed values. #figure(figph[Two TI-89 Data/Matrix Editor screens of the Util menu, with options including 1:Insert, 2:Delete, Sort Column, and 6:Resize Matrix; the Delete submenu offers choices including row and column.], alt: "Two TI-89 Data/Matrix Editor screens of the Util menu, with options including 1:Insert, 2:Delete, Sort Column, and 6:Resize Matrix; the Delete submenu offers choices including row and column.", caption: none) #examplebox("Example 2")[][ The sample data below show the number of companies providing dental insurance for small, medium and large companies. Test to see if there is a relationship between dental insurance coverage and company size. Use #math.equation(block: false, alt: "α equals 0.05")[$α = 0.05$]. #notebox("Note", rgb("#8a94a6"), rgb("#556666"), rgb("#f7f8fa"))[ #emph[Turn χ² = 9.9073 into the p-value] This 2 × 3 table has df = (2 - 1)(3 - 1) = 2, and the link opens the chi-square curve with the area right of the test statistic already shaded: p = 0.0071, well under α = 0.05, so reject. The contingency table itself still has to be typed into the Chi-Square panel's Test for Independence grid - a link cannot preload a matrix yet - but every independence test ends at this same one-number read. - p-value: P(χ² \> 9.9073) = 0.0071 with df = 2 ] #figure(figph[Table of dental insurance by size of the company: the Yes row has Small 21, Medium 25, Large 19, and the No row has Small 46, Medium 39, Large 10.], alt: "Table of dental insurance by size of the company: the Yes row has Small 21, Medium 25, Large 19, and the No row has Small 46, Medium 39, Large 10.", caption: none) #solutionbox[ State the hypotheses. #math.equation(block: false, alt: "H sub 0 :")[$H_(0) :$] Dental insurance coverage and company size are independent. #math.equation(block: false, alt: "H sub 1 :")[$H_(1) :$] Dental insurance coverage and company size are dependent. Compute the expected values by taking each row total times column total, divided by grand total. #figure(figph[Observed-count table of dental insurance by company size with totals: Yes 21, 25, 19 with row total 65; No 46, 39, 10 with row total 95; column totals 67, 64, 29 and grand total 160.], alt: "Observed-count table of dental insurance by company size with totals: Yes 21, 25, 19 with row total 65; No 46, 39, 10 with row total 95; column totals 67, 64, 29 and grand total 160.", caption: none) For the small companies with dental insurance: #math.equation(block: false, alt: "open parenthesis 65 times 67 close parenthesis / 160 equals 27.21875")[$( 65 · 67 ) / 160 = 27.21875$], small companies without dental insurance: #math.equation(block: false, alt: "open parenthesis 95 times 67 close parenthesis / 160 equals 39.78125")[$( 95 · 67 ) / 160 = 39.78125$], medium companies with dental insurance: #math.equation(block: false, alt: "open parenthesis 65 times 64 close parenthesis / 160 equals 26")[$( 65 · 64 ) / 160 = 26$], etc. See table below. #figure(figph[Expected-count table of dental insurance by company size: Yes 27.21875, 26, 11.78125 with row total 65; No 39.78125, 38, 17.21875 with row total 95; column totals 67, 64, 29 and grand total 160.], alt: "Expected-count table of dental insurance by company size: Yes 27.21875, 26, 11.78125 with row total 65; No 39.78125, 38, 17.21875 with row total 95; column totals 67, 64, 29 and grand total 160.", caption: none) Compute the test statistic. #figure(figph[Table of (O−E)²/E values for dental insurance by company size: the Yes row shows (21−27.21875)²/27.21875 = 1.42082, (25−26)²/26 = 0.03846, and (19−11.78125)²/11.78125 = 4.42316; the No row shows (46−39.78125)²/39.78125 = 0.97214, (39−38)²/38 = 0.02632, and (10−17.21875)²/17.21875 = 3.02637.], alt: "Table of (O−E)²/E values for dental insurance by company size: the Yes row shows (21−27.21875)²/27.21875 = 1.42082, (25−26)²/26 = 0.03846, and (19−11.78125)²/11.78125 = 4.42316; the No row shows (46−39.78125)²/39.78125 = 0.97214, (39−38)²/38 = 0.02632, and (10−17.21875)²/17.21875 = 3.02637.", caption: none) Test statistic is #math.equation(block: false, alt: "χ squared equals ∑ the fraction open parenthesis O minus E close parenthesis squared over E equals 1.42082 plus 0.03846 plus 4.42316 plus 0.97214 plus 0.02632 plus 3.02637 equals 9.9073")[$χ^(2) = ∑ frac(( O − E )^(2), E) = 1.42082 + 0.03846 + 4.42316 + 0.97214 + 0.02632 + 3.02637 = 9.9073$]. Use technology to find the p-value using the chi-square cdf with #math.equation(block: false, alt: "df equals open parenthesis R minus 1 close parenthesis open parenthesis C minus 1 close parenthesis equals open parenthesis 2 minus 1 close parenthesis open parenthesis 3 minus 1 close parenthesis equals 2")[$"df" = ( R − 1 ) ( C − 1 ) = ( 2 − 1 ) ( 3 − 1 ) = 2$]. #figure(figph[TI-84 χ²-Test output screen showing χ²=9.907263904, p=.007057729, df=2.], alt: "TI-84 χ²-Test output screen showing χ²=9.907263904, p=.007057729, df=2.", caption: none) Using the TI-Calculator, we find the p-value = 0.0071. The p-value is less than #math.equation(block: false, alt: "α")[$α$]; therefore, reject #math.equation(block: false, alt: "H sub 0")[$H_(0)$]. There is enough evidence to support the claim that there is a relationship between dental insurance coverage and company size. ] ]