Lab 8 reflection 10/31/21 ๐ŸŽƒ

#Chi-squared test of whether there is a true difference between male and female literacy rates
[1] chisq.test(table_gender_literacy)
#Chi-squared test of whether there is a true relationship between household value and donantion amounts
[2] chisq.test(table_donation_value)

#results
Warning message in chisq.test(table_gender_literacy):
โ€œChi-squared approximation may be incorrectโ€
[24]

	Pearson's Chi-squared test with Yates' continuity correction

data:  table_gender_literacy
X-squared = 0.42407, df = 1, p-value = 0.5149
[24]

	Pearson's Chi-squared test with Yates' continuity correction

data:  table_donation_value
X-squared = 0.8, df = 1, p-value = 0.3711

This is a chi-squared test we used in Lab 8 to calculate whether there was a significant difference between 1) female and male-identifying literacy rates and 2) household value and donated amount. The first 2 lines of code call the chisq.test() function and input the tables we created. The first table, table_gender_literacy contains the amount of male and literate people, female and literate people, male and illiterate people, and female illiterate people. The test then takes those values from each of the sets of data and and calculates the p-value. From this p-value we can conclude whether there is a statistical difference between the two variables — in this case identified sex and donation amount, and household value and donation amount. The null hypothesis says that there are no relationships between the variables, and the alternative hypothesis says that there are relationships and that knowing the value of one variable would help you predict the value of another variable. For our tests, the null hypotheses were that literacy rates do not have any effect on donation amounts, and that household value does not either. Because the p-value for the table_gender_literacy was 0.5149 and 0.3711 for table_donation_value, we accept the null hypothesis. These p-values mean that there is a ~51% chance that the relationships between gender and donation amount occured by chance, and a ~37% chance that the relationships between household value and donation amount occured by chance. Thus, we accept the null hypothesis for both of these tests and conclude that there are no statistical differences between the values in either.

Leave a comment

Your email address will not be published. Required fields are marked *

css.php