Reflection 4

In the lab 4 step 42, we constuct a comparison of donation amounts for which only matched the donors’ first named Mary and John. First, our goal is to know the difference between Mary’s donations and John’s donations and their statistically significance. Therefore, we first need to check the donors’ dataframe with donor’s first name called Mary and John. By doing this, we create two boolean vectors to check each donors’ first name. Second, we subset the donor dataframe based on the boolean vectors and store them as two new matrices. Third, because we only want to compare the amount of donations so that we use the dollar sign to get the one-dimentional data of amount of donations whose first name are Mary and John.

To see whether the mean amount of Mary’s and John’s are the same or not, we construct the t-test of two sample means. Our null hypothesis is the difference between two means is zero. And the alternative hypothesis is the difference between two mean is not zero. From the output, we observe that the probability of getting the same mean is only 0.013(p-value). Since the t test we are constructing is at the significance level of 0.05, which is much higher than our p-value. Based on that, we reject the null hypothesis. Therefore, we can conclude that we are 95% confident that there is difference between the mean of Mary’s donation amount and mean of John’s donation amount.

Leave a comment

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

css.php