Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
UNDERSTANDING INFERENTIAL STATISTICS VIA THE TOSSING OF PIGS DAMIEN PITMAN Please use the table below to tabulate results, but use separate paper to write up solutions to all other questions/problems below. Use complete sentences when appropriate. This project will count as two homework sets. Introduction In this project we will be tossing pigs, as is done in the game “Toss the Pigs”. There are two little pigs in this game, which we affectionately refer to as pig 1 and pig 2. Each pig can land in the following positions: A = on a side so that the rear leg on top is positioned in, toward the front B = on a side so that the rear leg on top is positioned out, toward the rear R = on its back (razorback) H = on all four hooves (hoofer) S = on its snout and both front hooves (snouter) J = on its snout, one front hoof, and an ear (leaning jowler) The scores associated to different outcomes are summarized in the table. It is helpful to think of A and B as nonscoring and all other positions as scoring, even though (A, A) and (B, B) do actually score one point. Then we use the scoring position to name the outcome. For example (A, R), (R, A), (B, R), and (R, B) are all called razorbacks, and (R, R) is a double razorback. Notice that the mixed scoring combinations score a sum of the scores, whereas a double combination scores double the sum. A B A 1 0 B 0 1 R 5 5 H 5 5 S 10 10 J 15 15 R 5 5 20 10 15 20 H 5 5 10 20 15 20 S 10 10 15 15 40 25 J 15 15 20 20 25 60 Descriptive Statistics 1. Toss both pigs n = 100 times, and enter the frequency of each outcome in the table. 2. Calculate the observed relative frequencies for each of the six positions for each pig. 3. Calculate p01 and p02 , where p0i is the observed relative frequency that pig i lands in a scoring position. 4. Calculate p0A and p0B , where these are the proportions of all 200 rolls that were in positions A and B respectively. 1 A A B R H S J rf B R H S J rel. fr. Confidence Intervals for Probabilities/Proportions Let pi be the probability that pig i lands in a scoring position; and let pA and pB be the probabilities associated to either pig landing in position A or B respectively. There is no theoretical reason to know these probabilities, so we think of them as unknowns. It may or may not be the case that p1 = p2 or that pA = pB . We begin with pi , but drop the subscripts and develop our theory one pig at a time. Thus p is the probability of scoring with a pig and p0 is the observed relative frequency of scoring with that pig. Now we use subscripts to indicate the trial. Let Ii be the indicator variable for the event that the Ppig scores on roll i, and let X count the number of times the pig scores in n tosses, i.e., X = ni=1 Ii . Finally, let P 0 = X/n. Then notice that we have p = E[Ii ] = E[P 0 ]. 1. Explain how p0 relates to P 0 , i.e., explain why p0 is a point estimate for p. 2. What does the law of large numbers have to say about p and p0 ? 3. Show the algebra that demonstrates the equivalence of the events below for an arbitrary > 0. {p0 ∈ (p − , p + )} = {p ∈ (p0 − , p0 + )} 4. What is the exact p distribution of X, and what are the mean and standard deviation of X? for the standard deviation of X. 5. Explain why np0 (1 − p0 ) is a point estimate p 0 6. What theorem ensures that X ≈ N (np, np (1 − p0 )?p 7. Show that this is equivalent to saying that P 0 ≈ N (p, p0 (1 − p0 )/n). 8. Let us fix a positive probability α, and let zα/2 be the z-score such that Φ(zα/2 ) = 1 − p α/2. Then let = zα/2 p0 (1 − p0 )/n and use the assumption above to show that the events above that were shown to be equivalent are also approximately the same event as P 0 −p √ p0 (1−p0 )/n < zα/2 . The point of this demonstration is to show that p α ≈ P P 0 − p > zα/2 · p0 (1 − p0 )/n . We will write CL for 1 − α pand refer to this probability as the confidence level. Also, we will write EBP for zα/2 · p0 (1 − p0 )/n and call this the error bound for the proportion. Finally, the interval is called the 1 − α confidence interval for p, and we can also write it as p = p0 ± EBP (≈ 1 − α) 9. Find zα/2 for α = .1 and use this z-score to find the confidence interval for p1 and p2 . You may either use the inverse normal function or else a table to find this value. 10. Sketch a graph of this situation for α = .1. Shade the tails and label with the appropriate probability and interval endpoints. 11. Now, find 1-PropZInt under STAT Tests in your calculator, and fill in the values. See if you get the same interval. 12. A similar method can be used to find a confidence interval for the difference between two probabilities/proportions. Here, this difference is p1 − p2 . The calculator calls this test 2PropZInt. Use your calculator to find a confidence interval for the difference between the pigs’ probabilities of scoring. 13. Find 90% confidence intervals for pA and pB . 14. Find a 90% confidence interval for pA − pB . Confidence Interval for the Mean We continue our investigation of the pigs by letting Y represent the points awarded on a single roll of both pigs. We are interested to know the expected points per roll. 1. Find the range of Y and all outcomes associated to each value of Y . For example {Y = 20} = {(R, R), (H, H), (R, J), (J, R), (H, J), (J, H)}. Then use the table to the right to describe the relative frequency distribution for Y . 2. Based on the frequencies from your 100 rolls construct confidence intervals for µ = E[Y ] with CL = .9 and CL = .95. 3. What is the point estimate for µ? 4. What is the error bound for µ for each confidence level, and what happened when the confidence level increased? 5. What is the sample standard deviation of Y ? y rf (y) scratch work 0 1 5 10 15 20 40 60 Hypothesis Testing Overview The confidence intervals we found above give us a way to measure how much faith we have in our point estimates. But, as we know from class, our point estimates will almost certainly differ from the true proportion or mean and our intervals may not even contain the true mean. In this section, we take a reported true proportion (or mean), and ask if our statistics (point estimates) agree with the reported parameters? The method to quantify an answer to this question is called a hypothesis test. A hypothesis test quantifies how significant our difference from the parameter is. We will always have a null hypothesis H0 and an alternative hypothesis Ha . These should be contradictory hypotheses. The null hypothesis is what is assumed to be true and will not be rejected unless there is sufficient evidence to do so. We decide on how much evidence we need. This means we set a probability α so that if we discover our data has a probability, called a p-value less than α, then we reject H0 . In many circumstances, α = .05 is assumed. If p ≥ α, then we fail to reject the null hypothesis. Hypothesis Test for a Single Proportion It is reported that the pigs land in scoring positions 34.9% of the time. Are the scoring probabilities, p01 and p02 , you found consistent with this reported percentage? Or do you believe one or the other of your pigs, or your own skill at rolling deviates significantly from the reported percentage. The steps that follow will walk you through answering these question statistically. 1. State the null and alternative hypotheses. 2. Assume the reported percentage is the parameter for the population of pigs. Then use this parameter to describe the approximate sampling distribution of P 0 . Then use the mean and standard deviation of this approximate distribution to calculate the z-scores of your point estimates p01 and p02 . 3. Find the two-tailed p-values for your statistics. That is, for each of p1 and p2 , find the probability associated to the event that a z-score more extreme (greater in absolute value) will be observed from a standard normal random variable. 4. Write up your decision at the α = .05 level. If p < α, decide that your data is too extreme to accept the reported parameter for your experiment. If p ≥ α, decide that there is not enough evidence to reject the reported parameter. Use complete sentences to summarize your findings for each of p1 and p2 . 5. Find the one-tailed p-values for your statistics. That is, for each of p1 and p2 , find the probability associated to the event that a z-score more extreme (greater in absolute value and with the same sign) will be observed from a standard normal random variable. 6. Write up your decision at the α = .05 level. If p < α, decide that your data is too extreme to accept the reported parameter for your experiment. If p ≥ α, decide that there is not enough evidence to reject the reported parameter. Use complete sentences to summarize your findings for each of p1 and p2 . 7. Now, find 1-PropZTest under STAT Tests in your calculator, and fill in the values. In the calculator, p0 is the parameter p. Also, “prop” stands for proportion; and you are meant to select 6= p0 for a two-tailed test, p > p0 for a right-tailed test, and p < p0 for a left-tailed test. The direction of a one-tailed test corresponds to the direction your point estimate suggests. See if you get the same p-values from this method as above. Hypothesis Test for the Difference Between Two Proportions Do the different point estimates for pA and pB constitute a significant difference? 1. State the null and alternative hypotheses. 2. Use 2-PropZTest under STAT Tests in your calculator to find the p-values associated to a two-tailed and one-tailed test for the significance of the difference between pA and pB . Enter the A values into the “1” fields in the calculator. Write up your conclusions. Hypothesis Test for Goodness of Fit Consider the six possible outcomes from a single pig. The frequency distribution below is what is reported on Wikipedia. A χ2 distribution with 6 − 1 = 5 degrees of freedom can be used to measure the deviance of your observed frequencies from the expected frequencies given here. 1. State the null and alternative hypotheses. P −Ek )2 . This is similar to a z-score 2. Calculate the test statistic χ2 = 6k=1 (Ok E k A .349 or t-score. B .302 3. Look up the percentile .95 in Table A.4 on page 469 of your text. The R .224 associated value for 5 degrees of freedom is x = 11.07. Therefore, if your T .088 test statistic is greater than x = 11.07, then we reject the notion that you S .030 rolled according to the reported distribution. This is because only 5% of rolls J .006 from such a distribution would result in deviations as large as was observed. What is your decision?