In: Statistics and Probability
In Assignment 1A, you participated in a “memory game” activity. In this problem, you will answer this question of interest: “Is there an association between the time of day when the activity was performed and how many items were remembered?” Use the memorygame.csv data set posted on Canvas to answer this question of interest. (Note: the number of items remembered will be categorized into two groups. The data set will contain two columns: column 1 is the time of day the activity was performed (“time”) and column 2 is whether or not at least 60% of the items were remembered (“pctremember”.)
To answer this question of interest, answer the following questions. (R tutorial 1 may be helpful in answering some of these questions.)
1. Using R, construct and include a properly labeled side-by-side bar chart. Based on the side-by-side bar chart, does there appear to be an association between time of day and number of items remembered? Explain. (3 points) 2. Perform an appropriate hypothesis test in R to answer the question of interest:
a. State the null and alternative hypotheses in notation and words. (3 points)
b. What is the name of the hypothesis test will you use to test the above null hypothesis? Why are you using this test? (2 points)
c. Report the test-statistic (with degrees of freedom if it has degrees of freedom) and the p-value. Do not include the R output. (1 point)
d Based on the p-value, answer the question of interest in the context of the problem. (3 points) e. Does the conclusion from the hypothesis test support what you see in the side-by-side bar chart? Explain. (2 points)
time | pctremember |
morning | yes |
morning | no |
morning | no |
morning | no |
evening | yes |
evening | yes |
evening | no |
evening | no |
evening | yes |
evening | no |
morning | no |
evening | no |
evening | yes |
morning | no |
evening | no |
morning | no |
morning | yes |
evening | yes |
morning | no |
evening | yes |
evening | no |
evening | yes |
evening | no |
morning | yes |
evening | yes |
morning | no |
morning | no |
evening | no |
morning | yes |
evening | no |
evening | no |
evening | yes |
evening | yes |
morning | no |
morning | no |
evening | no |
morning | no |
morning | no |
morning | yes |
morning | yes |
evening | yes |
evening | yes |
morning | no |
evening | yes |
morning | yes |
evening | no |
evening | yes |
morning | yes |
evening | yes |
morning | yes |
evening | yes |
evening | no |
evening | no |
evening | yes |
morning | yes |
morning | no |
morning | yes |
evening | no |
morning | yes |
evening | no |
evening | no |
morning | no |
morning | no |
morning | no |
morning | yes |
morning | yes |
morning | yes |
evening | yes |
evening | no |
evening | no |
morning | no |
evening | no |
evening | yes |
morning | no |
evening | no |
evening | yes |
morning | no |
evening | no |
evening | no |
morning | no |
evening | no |
Using R,
Creating a side by side bar chart:
Output:
Running a chi square test,
a. To test H0: There is no association between the time of day when the activity was performed and no. of items were remembered.
Vs
Ha: There is a significant association between the time of day when the activity was performed and no. of items were remembered.
i.e. to test, H0: Oi = Ei Vs H1: Oi Ei
where Oi and Ei are the observed and expected (No assosiation) frequencies respectively.
b. A chi square test of independence would be an appropriate test here, since we have to test whether the two nominal variables are independent.
c. Test Statistic = 0.048 , df = 1 and p - value = 0.8262
d.Since the p value of the test 0.8262 > 0.05, we may conclude that there is sufficient evidence to support the null hypothesis.We may accept the null hypothesis at 5% level of significance.
We may conclude that there is no association between the time of day when the activity was performed and no. of items were remembered.Our decision is also supported by the side by side bar chart where we do not find any significant difference in the bars.