# Confidence interval in statistics

I really need help on this question. I am taking an introductory statistics class, and here is the question:

A taxi company wants to determine if customers will accept self driving cars. The company authorized a survey and subjects were to be selected at random from their current customer database (you can assume independence and a large population). Using the entire customer database, the company determined that the amount paid per trip was normally distributed with a mean of $\$50$and a standar deviation of$\$5$ and $98\%$ of customers owned a cellphone and $59\%$ of the customers used paypal. The company then selected a simple random sample of size $27$ and conducted in person interviews. Analysis of the sample revealed that the $27$ customers paid an average of $\$53$with a standard deviation of$\$12$, $47\%$ slept during their ride, and $55\%$ used paypal and 64% are males.

Please construct a $95\%$ confidence interval for the population proportion of customers who slept during their ride.

My question is: why is the question asking for population proportion when the scenario is giving information that indicates I would have to use a t-test for sample means? I am confused whether to use $2.056$ or $1.96$ as the multiplier to construct my confidence interval. I am guessing that I would have to use $1.96$ as my multiplier since the question is asking for population proportion instead of sample means. (and the fact that I would only use the degree of freedom to find my multiplier when they're asking for confidence levels not intervals)?

If any of you guys could approve or disprove my line of thinking, I would greatly appreciate it. Thanks

• There is a Statistics StackExchange, which your question should be appropriate for. – Vivek Kaushik Mar 24 '17 at 2:38
• @VivekKaushik : ALthough some kinds of statistics questions will get better answers at stats (dot) stackexchange (dot) com, this one seems more than simple enough to be handled here. – Michael Hardy Mar 24 '17 at 4:08
• @user6873843 Maybe this information will be useful to you: stackoverflow.com/help/someone-answers – NCh Mar 25 '17 at 15:02

## 2 Answers

We're not told anything about the amounts paid by those who slept or by those who did not sleep, nor how many of those who slept were male, nor how many of those who slept used PayPal. Thus it appears that this is only about estimating a population proportion based on a sample proportion.

If $p$ is the population proportion and $\widehat p$ is the sample proportion, then it is standard to use as endpoints of a $95\%$ confidence interval for $p$ the following: $$\widehat p \pm 1.96 \sqrt{\frac {\widehat p(1-\widehat p)} n}.$$ In this case this is $$0.47 \pm 1.96\sqrt\frac{(0.47)(1-0.47)}{27},$$ but something is clearly wrong here: $\dfrac{12}{27} = 0.44444\ldots$ and $\dfrac{13}{27} = 0.481481481481\ldots$ Neither of these becomes $0.47$ when rounded. I wonder if whoever posed the problem thought about this.

A rough rule of thumb says these endpoints for the confidence interval are a reasonable approximation if the numbers of those who slept and those who didn't are both at least $5$. I think some textbooks are more cautious and recommend a larger number -- maybe $10.$

• Inserted missing 1.96 in 2nd displayed formula. – BruceET Mar 24 '17 at 8:30

This is primarily an answer to the question near the end of your post.

You would use a t confidence interval for a sample mean $\mu$ if you had 'numerical' data with roughly a normal distribution. For example, you are told (among very many other things) that $n = 27$ customers paid a sample mean of $\bar X = \$53$for their ride with a sample standard deviation of$S = \$12.$ If you had been asked to find a 95% confidence interval (CI) for the population mean expenditure $\mu$ for a taxi ride, then that would be a numerical population variable. It might be reasonable to assume a normal. or nearly normal, distribution. In that case, a 95% CI for $\mu$ would be of the form $$\bar X \pm t^*\frac{S}{\sqrt{n}},$$ where $t^*$ cuts 2.5% of the area from the upper tail of Student's t distribution with degrees of freedom $n - 1 = 27 - 1 = 26.$ That value is $t^* = 2.056,$ as you say.

Then the 95% CI for $\mu$ computes to $(\$48.25, \$57.75).$ However, you should notice that earlier in the problem you are told that $\mu \approx \$50.$So the CI we found is consistent with information already given, but not necessary--and not what was asked. I think this question is intended to help you focus on which information out of a whole paragraph of stuff is essential for answering the question asked. That question was to find a 95% CI for the population proportion$p$of customers who slept during their ride. Such a CI is discussed in @MichaelHardy's answer. Sleeping or not sleeping is a 'categorical' variable, and so you need a CI for a proportion or percentage. Note: You should be aware that the style of CI used there does not always provide the 'advertised' 95% probability of coverage. From the way the question was asked, I believe the CI of the style $$\hat p \pm 1.96\sqrt{\frac{\hat p(1-\hat p)}{n}}$$ is what the author has in mind. It computes to$(0.282, 0.658)$or$(28.2\%,65.8\%)$when you plug in$\hat p = 47\%$and$n = 27.$(However, @MichaelHardy is correct in pointing out that the exact percentage 47% is not possible with a sample of$n = 27$customers.) However, an improved kind of CI shown in this answer. It is of the style $$\tilde p \pm 1.96\sqrt{\frac{\tilde p(1-\tilde p)}{\tilde n}},$$ where$\tilde n = n+ 4$and$\tilde p = (X+2)/\tilde n$with$X$sleepy passengers. This style of CI is called an 'Agresti' or 'Plus-4' confidence interval. Because we are not given the actual number$X$out of$n = 27$passengers, we cannot compute the Agresti CI for your problem. (We'd have$\tilde n = 31;$if$X = 12,$then$\tilde p = 0.452,$and if$X = 13,$then$\tilde p = 0.484.\$)