##### SCA-12 ##### ##### One-Sample Proportions Tests ##### ### This gives a few examples of the analysis process for testing ### for a population proportion # Note: This is not the procedure used by the book. It uses something # akin to our "proportions test." That procedure is approsimate. This # is exact. ### Preamble # Import extra functionality source("http://rfs.kvasaheim.com/stat200.R") ### Example I: The Proportion of Juniors at Knox # # I would like to estimate the number of Juniors at # Knox. To do this, I randomly sample 100 students # around campus. # # In that sample, the number of Juniors was 31. # binom.test(x=31, n=100) binom.plot(x=31, n=100) # Conclusion: We are 95% confident that the proportion of Juniors # at Knox College is between 22.1 and 41.0%, with a point estimate # of 31%. ### Example II: Expensive Gas Stations # # I would like to estimate the proportion of gas stations # in Galesburg that have gas prices greater than $2.50 per # gallon. # # To do this, I randomly select 25 from the phone book, call # them, and record if their current price for regular gas # exceeds $2.50 per gallon. # # In my sample, 11 had gas more expensive than $2.50. # binom.test(x=11, n=25) binom.plot(x=11, n=25) # Conclusion: I am 95% confident that the proportion of gas # stations with gasoline more expensive than $2.50 is # between 24.4% and 65.1%, with a point estimate of 44%. ### Example III: Soccer # # I would like to estimate the proportion of shots on goal that # result in a score for the best soccer team on the planet: The # Portland Timbers. # # To estimate this, I randomly select 10 games and measuure the # total number of shots on goal and the total number of points # scored. # # In those 10 games, there were 19 shots on goal and 8 points # scored. # binom.test(x=8, n=19) # Conclusion: A 95% confidence interval for the proportion of shots # on goal that result in a score is between 20.3% and 66.5%, with a # point estimate of 42.1%. ### Example IV: The Central Limit Theorem # # I would like to estimate the proportion of my statistics students # who know that the Central Limit Theorem makes no conclusions about # the distribution of the data, only about the distribution of the # sample means (or sample totals). # # To do this, I place the following statement in the True/False # part of the final examination: # # The Central Limit Theorem states that as the sample size increases, # the distribution of the sample approaches the Normal distribution # (assuming the variance is finite). # # In a sample of 30 students, 5 correctly circled F. # binom.test(x=5, n=30) # Conclusion: I am 95% confident that the proportion of my students who # understand the Central Limit Theorem is between 5.6% and 34.7%, with # a point estimate of 16.7%. ### Example V: Fifteen Hours # # I would like to estimate the proportion of my statistics students # who actually spend 15 hours or more) on statistics. To check, I # randomly sampled 30 of them and asked if they spent 15 hours or # more working on statistics last week. # # Of those 30, none said yes. # binom.test(x=0, n=30) # Conclusion: I am 95% confident that between 0% and 11.6% of my # students spend 15 hours or more on statistics each week, with # a point estimate of 0%.