Week 8 Confidence Intervals for Means and Proportions
Inference Data are a single sample Interested in underlying population, not specific sample Sample gives information about population Randomness of sample means uncertainty Called inference about population
Types of inference Focus on value of population parameter e.g. mean or proportion (probability) Estimation What is the value of the parameter? Hypothesis testing Is the parameter equal to a specific value (usually zero)?
Point estimate To estimate population parameter, use corresponding sample statistic e.g. Likely to be an error in estimate e.g. How big is error likely to be?
Error distribution Error is random Simulation from an ‘approx’ population could build up error distribution Shows how large error from actual sample data is likely to be
Example Silkworm survival after arsenic poisoning How long will 1 / 4 survive? What is upper quartile?
Simulation Approx population (same mean & sd as data) Target = UQ from normal = sec
Simulation (cont) Sample UQs ≠ target Simulation shows error distribution Error in estimate (292 sec) unlikely to be more than 10 sec.
Error distn for proportion Simulation is not needed DistributionMeanSt devn # success x binomial (n, )n Propn(success) p = x / n Error p - 0
Standard error of proportion Approx error distn bias = 0 standard error =
Teens and interracial dating Point estimate: Bias = 0 Standard error = 1997 USA Today/Gallup Poll of teenagers across country: 57% of the 497 teens who go out on dates say they’ve been out with someone of another race or ethnic group. = 0.57
Error distn (interracial dating) = 0, = General normal Error distn Error in estimate, p = 0.57, unlikely to be more than 0.05 almost certainly less than 0.07
Interval estimates Survey 150 randomly selected students and 41% think marijuana should be legalized. If we report between 33% and 49% of all students at the college think that marijuana should be legalized, how confident can we be that we are correct? Confidence interval: an interval of estimates that is ‘likely’ to capture the population value.
95% confidence interval Legalise? p = 0.41, n = rule of thumb Prob(error < 2 x ) is approx 95% We are 95% confident that is between 0.41 – and and % Conf Interval
Interpreting 95% C.I. Confidence interval is function of sample data Random It may not include population parameter ( here) In repeated samples, about 95% of CIs calculated as described will include We therefore say we are 95% confident that our single CI will include
Teens and interracial dating Point estimate: Standard error = 95% C.I. is to to USA Today/Gallup Poll of teenagers across country: 57% of the 497 teens who go out on dates say they’ve been out with someone of another race or ethnic group. = 0.57 We would prefer more decimals!
Teens and interracial dating 95% C.I. is to We do not know whether is between and However 95% of CIs calculated in this way will work We are therefore 95% confident that is in (0.526, 0.614)
St error & width of 95% C.I. Smallest s.e. and C.I. width when: n is large p is close to 0 or 1 Biggest s.e. and C.I. width when: n is small p is close to 0.5
Margin of error Public opinion polls usually estimate several popn proportions. Each has its own “± 2 s.e.” describing accuracy n = 350 propn± 2 x s.e. Will vote for A0.45± Will vote for X0.04± Happy with govt0.66± Wants tax cut0.87±
Margin of error (cont) n = 350 Maximum possible is propn± 2 x s.e. Will vote for A0.45± Will vote for X0.04± Happy with govt0.66± Wants tax cut0.87± “Margin of error” for poll
Requirements for C.I. Sample should be randomly selected from population “Large” sample size — at least 10 success and 10 failure (though some say only 5 needed) If finite population, at least 10 times sample size
Case Study : Nicotine Patches vs Zyban Study: New England Journal of Medicine 3/4/99) 893 participants randomly allocated to four treatment groups: placebo, nicotine patch only, Zyban only, and Zyban plus nicotine patch. Participants blinded: all used a patch (nicotine or placebo) all took a pill (Zyban or placebo). Treatments used for nine weeks.
Nicotine Patches vs Zyban (cont) Conclusions: Zyban is effective (no overlap of Zyban and not Zyban CIs) Nicotine patch is not particularly effective (overlap of patch and no patch CIs)
Error distribution for mean Again, a simulation is unnecessary to find the error distribution (approx) DistributionMeanSt devn Sample mean Approx normal Error Approx normal
Standard error of mean Approx error distn bias = 0 standard error =
Poll: Class of 175 students. In a typical day, about how much time to you spend watching television? Mean hours watching TV n Mean MedianStDev Point estimate: Bias = 0 Standard error, = 2.09 hours
Standard devn & standard error Sample standard deviation is approx stay similar if n increases Standard error of mean is usually less than decreases as n increases Don’t get mixed up between the two!
Error distn (hours watching TV) = 0, = General normal Error distn Error in estimate, = 2.09 hours, unlikely to be more than 0.25 hrs almost certainly less than 0.4 hrs
General form for 95% C.I. se se se Error distn If error distn is normal zero bias & we can find s.e. Prob( error is in ± 2 s.e.) is approx % confidence interval: estimate ± 2 s.e. 95% confidence interval: estimate ± 1.96 s.e. (if really sure error distn is normal)
95% confidence interval Mean hrs watching TV? rule of thumb Prob(error < 2 x 0.124) is approx 95% We are 95% confident that is between 2.09 – and and 2.34 hours 95% C. I. = 2.09 hrs, n = 175
Requirements for C.I. Sample should be randomly selected from population “Large” sample size — n > 30 is often recommended If finite population, at least 10 times sample size
Problem with small n Known Unknown Variable width Less likely to include Confidence level less than 95% works fine
C.I. for mean, small n Solution is to replace 1.96 (or 2) by a bigger number. Look up t-tables with (n - 1) ‘degrees of freedom’ Sample size, nd.f., n – 1t n
Example: Mean Forearm Length Data:From random sample of n = 9 men 25.5, 24.0, 26.5, 25.5, 28.0, 27.0, 23.0, 25.0, % C.I.: 25.5 2.31(.507) => 25.5 1.17 => to cm df = 8 t 8 = 2.31
What Students Sleep More? Q: How many hours of sleep did you get last night, to the nearest half hour? Notes: CI for Stat 10 is wider (smaller sample size) Two intervals do not overlap Class n Mean StDev SE Mean Stat 10 (stat literacy) Stat 13 (stat methods)
Interpreting 95% C.I. Confidence interval is function of sample data Random It may not include population parameter ( here) In repeated samples, about 95% of CIs calculated as described will include We therefore say we are 95% confident that our single CI will include