Chi-square
The Chi-square test is used to compare the differences between categorical data.
My Note from Datacamp subscription -
เหมือนกับว่าเรามีค่า observatory data มาแล้ว และมันจะคำนวนหาค่า expected data มาให้ โดยค่าที่เป็น expected data จะเป็นค่าที่ ค่า variable
This statistic that we've just formulated is called the chi-squared statistic. It captures the distance between a contingency table and the table you would expect if the variables were independent of one another. We found that the statistic for the relationship between party and natspac was one-point-three-three. If we calculate the statistic for the relationship with natarms, we get a much greater distance: eighteen-point-nine-seven. With this statistic in hand, you can return to the hypothesis test to answer the question of if either of these observed statistics: one-point-three-three or eighteen-point-nine-seven is so great as to lead you to reject the null hypothesis that these spending priorities are independent of political party.
Dataframe with each roll contains head/tail, the expected outcome should be 0.5/0.5 (head/tail) if not bias, if the flipping the coin is bias the change to get either head/tail will not be equally 0.5.
Useful link: https://www.mathsisfun.com/data/chi-square-test.html
Comments
Post a Comment