document.write( "Question 1196642: HERE IS THE TABLE: https://imagizer.imageshack.com/img923/3314/zi0hjD.jpg \r
\n" );
document.write( "\n" );
document.write( " A sample of 1793 homes in a neighborhood of a large city during a recent year produced the data in the table for the number of bedrooms and house price. Is the price of the house independent of whether it has 3 or more bedrooms? \n" );
document.write( "
Algebra.Com's Answer #829587 by math_tutor2020(3817)![]() ![]() ![]() You can put this solution on YOUR website! \n" ); document.write( "We'll be doing a ChiSquare Test of Independence.\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Null Hypothesis: The two variables \"price\" and \"bedroom count\" are independent. There's no connection between them. Changing one variable does not cause the other to change.\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Alternative Hypothesis: The two variables \"price\" and \"bedroom count\" are dependent. There's a connection somehow. Changing one variable causes a change in the other.\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Since the level of significance isn't stated, I'll assume the standard default of alpha = 0.05\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Given Data
\n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Compute the row and column totals by adding the values. \n" ); document.write( "Eg: 344+499 = 843 total houses are priced less than $300K
\n" ); document.write( " \n" ); document.write( "\n" ); document.write( "The given data table represents the set of observed values. With ChiSquare problems, the letter O represents \"observed values\". \n" ); document.write( "This is unfortunate since this letter looks a lot like the number zero.\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "The letter E represents expected values. To compute each expected value, we multiply the row and column totals, and then divide by the grand total N = 1793\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "For example, we expect the value 313.597881 in row1,column1 since: \n" ); document.write( "E = (rowTotal*columnTotal)/N \n" ); document.write( "E = (843*667)/1793 \n" ); document.write( "E = 313.59788064696 \n" ); document.write( "E = 313.597881 \n" ); document.write( "For more information and further examples, check out this page \n" ); document.write( "https://online.stat.psu.edu/stat200/book/export/html/230\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "We'll follow that idea for the remaining other cells to get this set of expected values
\n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Once again: \n" ); document.write( "O = observed value \n" ); document.write( "E = expected value \n" ); document.write( "We'll compute the value \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Here's an example calculation for the item in row1,column1. \n" ); document.write( "O = 344 \n" ); document.write( "E = 313.597881 \n" ); document.write( " \n" ); document.write( "Similar calculations will apply to the remaining five other cells\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "This is what that table of values looks like
\n" ); document.write( "2.94737+1.745911+0.124644+0.073834+4.094523+2.425441 = 11.411723\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Therefore, \n" ); document.write( "ChiSquare = 11.411723 \n" ); document.write( "This is the test statistic in which we'll compare to the critical value.\r \n" ); document.write( " \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Now you'll refer to a ChiSquare table which is found in the appendix section of your stats textbook.\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Check out this page for more info \n" ); document.write( "https://www.statology.org/how-to-read-chi-square-distribution-table/ \n" ); document.write( "That page explains how to read a ChiSquare table. \r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "In this case we have \n" ); document.write( "r = 3 rows \n" ); document.write( "c = 2 columns \n" ); document.write( "df = degrees of freedom for a ChiSquare independence test \n" ); document.write( "df = (r-1)*(c-1) \n" ); document.write( "df = (3-1)*(2-1) \n" ); document.write( "df = 2\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Locate the df = 2 row \n" ); document.write( "Then locate the column with header 0.05 to represent the alpha value \n" ); document.write( "The value 5.991 is found here \n" ); document.write( "What this means is that P(ChiSquare > 5.991) = 0.05 approximately when df = 2. \n" ); document.write( "About 5% of the area is to the right of the critical value 5.991 when df = 2.\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "To recap we found that: \n" ); document.write( "ChiSquare Test Statistic = 11.411723 \n" ); document.write( "ChiSquare Critical Value = 5.991\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Keep in mind that ChiSquare tests are always right-tailed. This fact is mentioned in the first link I posted.\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "So this fact means that the rejection region is to the right of the critical value 5.991 \n" ); document.write( "The test statistic (11.411723) is greater than the critical value (5.991); therefore we are in the rejection region and we reject the null.\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "We reject the idea the variables are independent, so we conclude the price is dependent on the number of bedrooms. This makes sense. A bigger house should cost more. Of course there are other factors to consider such as location and the condition of the house, among other things. \r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Here are a few handy calculators to check your work: \n" ); document.write( "https://www.mathsisfun.com/data/chi-square-calculator.html \n" ); document.write( "https://www.statology.org/chi-square-test-of-independence-calculator/ \n" ); document.write( "https://www.gigacalculator.com/calculators/chi-square-calculator.php\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "-------------------------\r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Note: if the p-value is less than alpha = 0.05, then reject the null. Otherwise, you would fail to reject it (i.e. \"accept\" the null). In this case, the p-value is roughly 0.003326 which helps confirm why we reject the null. \n" ); document.write( "Here's what the command looks like to compute the ChiSquare p-value on a TI83 \n" ); document.write( " ![]() \n" ); document.write( "To get to the command, press the key labeled \"2nd\" then press the VARS key. Scroll down to item 7. \n" ); document.write( "If you don't have a TI83 or TI84 type calculator, then you can use one of the previous links mentioned earlier. Many more can be found by searching out \"chi square calculator\". \r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "The command CHIDIST is used to compute ChiSquare p-values in spreadsheet programs like Excel. \r \n" ); document.write( " \n" ); document.write( "\n" ); document.write( "Edit: Here's what it would look like using a spreadsheet. You don't need a Google account to access this Google Sheets document. \n" ); document.write( "https://docs.google.com/spreadsheets/d/1CFeiCWPokyyataD6hwabsFZnCSMSxfTw08qwJvGq_R8/edit?usp=sharing \n" ); document.write( "You can click on any cell to see what formulas were used. \n" ); document.write( " \n" ); document.write( " |