Confidence intervals for Proportions

Chapter 18 Objectives:

1. Standard Error 2. 3. One-proportion z-interval 4. Margin of Error 5. Critical Value Introduction

– Involves methods of using information from a sample to draw conclusions regarding the population.

– In formal statistical inference, we use to express the strength of our conclusions. Two Most Common Types of Formal Statistical Inference 1. Confidence Intervals – Estimate the value of a population parameter. 2. Tests of Significance – Assess the evidence for a claim about a population. Conference Intervals and Tests of Significance

• Both types of inference are based on the distributions of a sample statistic. CONFIDENCE INTERVAL The sample proportion pˆ

We now study categorical data and draw inference on the proportion, or percentage, of the population with a specific characteristic.

If we call a given categorical characteristic in the population “success,” then the sample proportion of successes, p ˆ ,is: count of successes in the sample pˆ  count of observations in the sample

 We choose 50 people in an undergrad class, and find that 10 of them are Hispanic: = (10)/(50) = 0.2 (proportion of Hispanics in sample)

 You treat a group of 120 Herpes patients given a new drug; 30 get better: = (30)/(120) = 0.25 (proportion of patients improving in sample) Sampling distribution of pˆ

The sampling distribution of p ˆ is never exactly normal. But as the sample size increases, the sampling distribution of becomes approximately normal. Standard Error

• Both of the sampling distributions we’ve looked at are Normal. – For proportions pq SD pˆ   n

– For means  SD y   n Standard Error

• When we don’t know p or σ, (which we normally don’t, because they are population parameters) we’re stuck, right? • Nope. We will use sample to estimate these population parameters. • Whenever we estimate the standard deviation of a sampling distribution, we call it a standard error. Standard Error

• For a sample proportion, the standard error is pqˆˆ SE pˆ   n • For the sample mean, the standard error is s SE y   n A Confidence Interval

• Recall that the sampling distribution model of p ˆ is centered at p, with standard deviation p q . n • Since we don’t know p, we can’t find the true standard deviation of the sampling distribution model, so we need to find the standard error: pˆqˆ SE(pˆ)  n A Confidence Interval • By the 68-95-99.7% Rule, we know – about 68% of all samples will have ’s within 1 SE of p – about 95% of all samples will have p ˆ ’s within 2 SEs of p – about 99.7% of all samples will have ’s within 3 SEs of p

• We can look at this from ’s point of view… A Confidence Interval

• Consider the 95% level: – There’s a 95% chance that p is no more than 2 SEs away from pˆ . – So, if we reach out 2 SEs, we are 95% sure that p will be in that interval. In other words, if we reach out 2 SEs in either direction of , we can be 95% confident that this interval contains the true proportion. • This is called a 95% confidence interval. A Confidence Interval Confidence Interval

• Definition – Confidence Interval is a range of values used to estimate the true value of a population parameter. What Does “95% Confidence” Really Mean?

• The figure to the right shows that some of our confidence intervals (from 20 random samples) capture the true proportion (the green horizontal line), while others do not: What Does “95% Confidence” Really Mean? • Our confidence is in the process of constructing the interval, not in any one interval itself. • Thus, we expect 95% of all 95% confidence intervals to contain the true parameter that they are estimating. A Level C Confidence Interval has Two Parts: 1. An interval calculated from the data, usually of the form estimate ± margin of error – Example: estimate – margin of error – how accurate we believe our estimate is, based on the variability of the estimate. For a 95% confidence interval the margin of error would be 2 SE ( pˆ ) . 2. A Confidence Level C, which gives the probability that the interval will capture the true parameter value in repeated samples. – Example: 95% confidence interval – normally use confidence level of 90% or higher Margin of Error: Certainty vs. Precision • We can claim, with 95% confidence, that the interval pˆ  2SE(pˆ) contains the true population proportion. – The extent of the interval on either side of p ˆ is called the margin of error (ME). • In general, confidence intervals have the form estimate ± ME. • The more confident we want to be, the larger our ME needs to be, making the interval wider. Margin of Error: Certainty vs. Precision Margin of Error: Certainty vs. Precision • To be more confident, we wind up being less precise. – We need more values in our confidence interval to be more certain. • Because of this, every confidence interval is a balance between certainty and precision. • The tension between certainty and precision is always there. – Fortunately, in most cases we can be both sufficiently certain and sufficiently precise to make useful statements. Margin of Error: Certainty vs. Precision

• The choice of confidence level is somewhat arbitrary, but keep in mind this tension between certainty and precision when selecting your confidence level. • The most commonly chosen confidence levels are 90%, 95%, and 99% (but any percentage can be used). Critical Values

• The ‘2’ in p ˆˆ  2 SE ( p ) (our 95% confidence interval) came from the 68-95-99.7% Rule. • Using a table or technology, we find that a more exact value for our 95% confidence interval is 1.96 instead of 2. – We call 1.96 the critical value and denote it z*. • For any confidence level, we can find the corresponding critical value (the number of SEs that corresponds to our confidence interval level). Example:

Confidence Level

Upper Critical Lower Critical Value Value Critical Values

• Example: For a 90% confidence interval, the critical value is 1.645: z*

• The critical value z* is the number (z-score) on the borderline separating sample statistics that are likely to occur from those that are unlikely to occur, for a given confidence level. z* is the same for any for a given confidence level Problem:

• Find the critical value z* for a confidence level of 88%? • invNorm(.94)=1.555 Your Turn:

• Find the critical value z* for a confidence level of 73%? • invNorm(.865)=1.103 Objective

• Construct confidence intervals, and recognize the significance they have on statistical inference. Assumptions and Conditions • Here are the assumptions and the corresponding conditions you must check before creating a confidence interval for a proportion: • Independence Assumption: We first need to Think about whether the Independence Assumption is plausible. It’s not one you can check by looking at the data. Instead, we check two conditions to decide whether independence is reasonable. Assumptions and Conditions – Randomization Condition: Were the data sampled at random or generated from a properly randomized ? Proper randomization can help ensure independence. – 10% Condition: Is the sample size no more than 10% of the population? . Sample Size Assumption: The sample needs to be large enough for us to be able to use the CLT. – Success/Failure Condition: We must expect at least 10 “successes” and at least 10 “failures.” One-Proportion z-Interval • When the conditions are met, we are ready to find the confidence interval for the population proportion, p. • The confidence interval is pˆ  z  SEpˆ where pˆqˆ SE(pˆ)  n • The critical value, z*, depends on the particular confidence level, C, that you specify. Procedure: Confidence Interval for a Population Proportion 1. Identify the population of interest and the parameter you want to draw conclusions about (population proportion p). 2. Choose the appropriate inference procedure. Verify the conditions for using the selected procedure. – Conditions population proportion; • Random condition • 10% condition • Success/Failure condition 3. If the conditions are met, carry out the inference procedure. – Confidence interval (CI) • CI = estimate ± margin of error – In general • CI = estimate ± z* • SE – For population proportion p • Estimate = pˆ pqˆˆ SE() pˆ  • n • z*: calculated based on the confidence level • CI for p : pˆˆ z* SE ( p ) 4. Interpret your results in the context of the problem.

• Summary – Confidence interval for population proportion p pˆˆ z* SE() p

Standard error of the Unbiased estimate sampling distribution of of population Upper critical value sample proportions proportion p for confidence level Example - Medication side effects Arthritis is a painful, chronic inflammation of the joints. An experiment on the side effects of pain relievers examined arthritis patients to find the proportion of patients who suffer side effects. It was found that 23 out of 440 arthritis patients suffered side effects. What are some side effects of ibuprofen? Serious side effects (seek medical attention immediately): Find a 90% Confidence Interval. Allergic reaction (difficulty breathing, swelling, or hives), Muscle cramps, numbness, or tingling, Ulcers (open sores) in the mouth, Rapid weight gain (fluid retention), Seizures, Black, bloody, or tarry stools, Blood in your urine or vomit, Decreased hearing or ringing in the ears, Jaundice (yellowing of the skin or eyes), or Abdominal cramping, indigestion, or heartburn, Less serious side effects (discuss with your doctor): Dizziness or headache, Nausea, gaseousness, diarrhea, or constipation, Depression, Fatigue or weakness, Dry mouth, or Irregular menstrual periods Solution

• Check Conditions – Randomization Condition; assume the 440 arthritis patients were randomly selected. – 10% Condition; it is reasonable to assume there are more than 4,400 total arthritis patients. – Success/Failure Condition: np ˆ = (440)(23/440) = 23 and nq ˆ = (440)(317/440) = 317, both are greater than 10. • All required conditions are met. Let’s calculate a 90% confidence interval for the population proportion of arthritis patients who suffer some “adverse symptoms.”

23 What is the sample proportion pˆ ? pˆ   0.052 440 What is the sampling distribution for the proportion of arthritis patients with adverse symptoms for samples of 440? N ( pˆ , p ˆ (1 p ˆ ) n )Upper tail probability P 0.25 0.2 0.15 0.1 0.05 0.03 0.02 0.01 For a 90% confidence level, z* = 1.645. z* 0.67 0.841 1.036 1.282 1.645 1.960 2.054 2.326 50% 60% 70% 80% 90% 95% 96% 98% Using the one sample method, we Confidence level C calculate a margin of error me: 90%CIforp : pˆ  me me z* pˆˆ (1 p ) n or0.052 0.023

me 1.645 0.052(1 0.052) / 440  With 90% confidence level, between 2.9% and 7.5% of me 1.645 0.014 0.023 arthritis patients taking this pain medication experience some adverse symptoms. Your Turn:

• In a random sample of 50 Philadelphia families with children of age, 35 had children enrolled in preschool. Find a 95% confidence interval for the true proportion of Philadelphia families with children enrolled in preschool. Solution

• Check Conditions – Random condition: given, sample was random. – 10% condition: it is reasonable that the number preschool age children in Philadelphia is greater than 500. 35 pˆ .7 – Success/Failure condition: 50 npˆˆ50(.7)  35  10 & nq  50(.3)  15  10 so the sample is large enough. Solution • 95% CI (one-proportion z-interval) 95% CI for p : pˆˆ z* SE ( p ) 35 * pqˆˆ .7 .3 pˆ .7 z  1.96 SE( pˆ )   .0648 50 n 50 pˆˆ z* SE( p )  .7  1.96 .0648  .7  .127

The 95% CI is: .7 .127 or  .573,.827

• Conclusion: We are 95% confident that between 57.3% and 82.7% of preschool age children in Philadelphia are currently enrolled in preschool. Confidence Intervals on the TI-83/84

• Press STAT key, choose TESTS, and then choose A: 1-PropZInterval… • Adjust the settings; – x: the number selected (not p ˆ ) – n: the sample size – C-level: confidence level • Then choose “Calculate” Solve the Previous Problem Using the TI-84 • In a random sample of 50 Philadelphia families with children of preschool age, 35 had children enrolled in preschool. Find a 95% confidence interval for the true proportion of Philadelphia families with children enrolled in preschool. • Solution: .57298,.82702 pˆ  .7 n  50 How Confidence Intervals Behave

• The user chooses the confidence level, and the margin of error follows from this choice. – The higher the confidence level, the greater the margin of error and hence, the larger the confidence interval. – The lower the confidence level, the lesser the margin of error and hence, the smaller the confidence interval. • We would like high confidence and a small margin of error. – High confidence says that our method almost always gives correct answers. – A small margin of error says that we know the parameter more precisely. Margin of Error me z* pˆˆ (1 p ) n • The margin of error gets smaller when; 1. Z* gets smaller. Trade-off between confidence level and margin of error. To obtain a smaller margin of error from the same data, you must be willing to accept a lower confidence level. 2. SE( pˆ ) : p ˆ (1 p ˆ ) n gets smaller. SE() pˆ measures the variation in the population. It is easier to pin down p when is small (less variation). 3. n gets larger. Increasing the sample size n reduces the margin of error for a fixed confidence level (large sample size means less variation). • Because n appears under the radical, we must increase the sample size by a factor of four to cut the margin of error in half. Choosing the Sample Size • We can arrange to have both high confidence and a small margin of error by taking a large enough sample. • To determine the sample size n that will yield a confidence interval for a population proportion with a specified margin of error me. • me z* pˆˆ (1 p ) n (margin of error wanted) ppˆˆ1  • Solve for n: n  2 me * z Example:

• At the end of every school year, the state administers a reading test to a SRS drawn from a population of 100,000 third graders. Over the last five years, students who took the test correctly answered 75% of the test questions. What sample size should you use to achieve a margin of error equal to 4%, with a confidence level of 95%? Solution me  .04 pˆ  .75 CL95%  z*  1.960

pqˆˆ me z* n

(.75)(.25) .04  1.96 n .1875 n 2 450.19 .04  1.96

Sample size should be 451 third graders. Choosing Your Sample Size • To determine the sample size, choose a Margin of Error (me) and a Confidence Interval Level. • The formula requires p ˆ which we don’t have yet because we have not taken the sample. A good estimate for , which will yield the largest value for pˆ qˆ (and therefore for n) is 0.50. pqˆˆ me z* n pqˆˆ • Solve the formula for n. n  2 me * z Example:

• At the end of every school year, the state administers a reading test to a SRS drawn from a population of 100,000 third graders. What sample size should you use to achieve a margin of error equal to 4%, with a confidence level of 95%? Solution: me  .04 CL95%  z*  1.960

pqˆˆ me z* use pˆ  .5 (most conservative value) n .5 .5 .04  1.96 n .25 n 2 600.25 .04  1.96

Sample size should be 601 third graders. Your Turn:

• Suppose the U.S. President wants an estimate of the proportion of the population who support his current policy toward revisions in the Social Security System. The president wants the estimate to be within .04 of the true proportion. Assume a 90 percent level confidence. How large a sample is required? Solution pqˆˆ me z* n (.5)(.5) .04  1.645 n .25 n 2 422.8 .04  1.645

Sample size should be 423. Sample Size

• In practice, taking samples costs time and money. The required sample size may be impossibly expensive. • Notice once again that it is the size of the sample that determines the margin of error. The size of the population (as long as the population is much larger than the sample) does not influence the sample size we need. The Perfect Confidence Interval What Can Go Wrong? Don’t Misstate What the Interval Means: • Don’t suggest that the parameter varies. • Don’t claim that other samples will agree with yours. • Don’t be certain about the parameter. • Don’t forget: It’s about the parameter (not the statistic). • Don’t claim to know too much. • Do take responsibility (for the uncertainty). • Do treat the whole interval equally. What Can Go Wrong?

Margin of Error Too Large to Be Useful: • We can’t be exact, but how precise do we need to be? • One way to make the margin of error smaller is to reduce your level of confidence. (That may not be a useful solution.) • You need to think about your margin of error when you design your study. – To get a narrower interval without giving up confidence, you need to have less variability. – You can do this with a larger sample… What Can Go Wrong?

Choosing Your Sample Size: • In general, the sample size needed to produce a confidence interval with a given margin of error at a given confidence level is: 2 z  pˆqˆ n  ME2 where z* is the critical value for your confidence level. • To be safe, round up the sample size you obtain. What Can Go Wrong?

Violations of Assumptions: • Watch out for biased samples—keep in mind what you learned in Chapter 12. – There is no correct method for inference from data haphazardly collected with bias of unknown size. Fancy formulas cannot rescue badly produced data. • Think about independence. What have we learned?

• Finally we have learned to use a sample to say something about the world at large. • This process (statistical inference) is based on our understanding of sampling models, and will be our focus for the rest of the book. • In this chapter we learned how to construct a confidence interval for a population proportion. – Best estimate of the true population proportion is the one we observed in the sample. What have we learned?

– Best estimate of the true population proportion is the one we observed in the sample. – Create our interval with a margin of error. – Provides us with a level of confidence. – Higher level of confidence, wider our interval. – Larger sample size, narrower our interval. – Calculate sample size for desired degree of precision and level of confidence. – Check assumptions and condition. • An experiment finds that 27% of 53 subjects report improvement after using a new medicine. • Create a 95% confidence interval for the actual cure rate. • Make it narrower – 90% confidence. What are the advantages and disadvantages? • What sample size would we need in a follow-up study if we want a margin of error of 5% with 98% confidence?