In: Statistics and Probability
To test whether my friend’s fish Googly had psychic powers, I wrote R code to display two windows. I entered either “Left” or “Right” depending on which way Googly was facing. Then the random number generator in R selected either the left or the right window, with probability 0.5 for each, in which to display a star. Let p be the probability Googly guesses correctly on a given trial (assume this is constant.) In 80 trials, Googly correctly guessed the window with the star 41 times. (a) (3 points) Using mathematical notation, write down null and alternative hypotheses for a one-sided test. (b) (3 points) If the test statistic is the number of correct guesses (41) in 80 trials, write down R code to find the P-value of a one-sided test. (c) (2 points) Even without R, we can see that Googly’s success rate was close to its expected value under the null, so the one-tailed P-value will be close to 0.5. State your conclusion about the fish’s psychic powers. (d) (2 points) Continued from part (b). If you only known that the R code dbinom(40, 80, 0.5) gives the number 0.0889, how would you find the exact P-value of the test? (Hint: use the property of a symmetric probability distribution.)
Let be the probability Googly guesses correctly on a given trial . Here . Where is the number of correct guesses out of 80.
a) We have to test,
This is a left tailed binomial test.
b) The P-value of a test is . Where is the test statistic.
Here . . The probability,
The R command for finding the above probability is
> pbinom(40,80,0.5)
[1] 0.5444639
c) At significant level , since , we accept the null hypothesis. The conclusion is that fish has psychic powers.
d) Actually, the distribution is symmetric about . So we have using the property of symmetry
Which is the same as we calculated in part (b).