# What is the appropriate hypothesis test for the following scenario and the appropriate p value?

There is a restaurant that aims to introduce a new item, and the target price is USD 7.5. They've taken a sample of 40 randomly chosen customers and asked them to write down how much they were willing to pay for the item after a tasting. The average price came out to be USD 8.36 and the SD of the sampling distribution (standard error) is 2.836885.

1. It wants to test whether or not there is statistical evidence that the average amount customers are willing to pay is greater than $7.50. Conduct the appropriate hypothesis test and identify the range the p value falls in. 2. It also wants to test whether or not there is statistical evidence that the proportion of target customers who are willing to buy the sandwich by paying$7.50 or more is greater than 70%.**

The answer is 0.0300 to 0.0499

My approach to part 1 was to find the sampling distribution mean which comes out to be 0.448551.

Then I tried to find the Z value (Considering that the null hypotheses is H0<=7.5 and the alternate hypothesis is Ha>7.5).

Z=(8.36-7.50)/(2.836885/sqrt(40)) which comes to be 1.92 and the corresponding p value is 0.97257 or rather on complementing the area the answer comes out to be 0.02743.

**Where am I going wrong. Can anyone help clarify this problem for me? I've spent a whole evening and can't figure out the answer.

I haven't tried part 2, so any hints to that would be really appreciated.**

• How did you get $0.448551?$ Also, please add the self-study tag.
– Dave
Jul 27, 2020 at 15:31
• The answer given does not make any sense to me. Are you sure you have copied everything correctly? Jul 27, 2020 at 15:36
• I was given the data set (9.50 4.75 7.50 5.75 10.25 8.00 8.50 8.25 7.75 6.25 7.00 10.25 8.25 4.50 10.75 10.00 9.50 5.75 15.50 10.25 8.75 7.25 11.25 4.50 12.00 9.75 3.00 10.50 6.00 3.75 5.75 5.00 11.75 11.50 5.75 9.00 9.75 12.25 5.75 13.00) These are values that the 40 customers say that they would pay for the item. The p value is supposed to fall within the mentioned range. I found the Mean of the data set to be 8.36 with stdev 2.83. Jul 27, 2020 at 15:57
• @mdewey I too suspect something is amiss. Please let me know what you think. I don't think however they are thinking of a range for the p value, they just gave a range because the p value will probably be an approximate figure which will slightly differ between students. So they are probably giving the range to ensure that slightly differing answers are not deemed incorrect. Jul 27, 2020 at 16:00
• @Dave Added the tag. I got 0.448551 by the formula sd/sqrt(n) to get the sd of the sampling distribution. Jul 27, 2020 at 16:00

Putting your data into R, I agree with your values for the sample mean and standard deviation.

x = c(9.50, 4.75, 7.50, 5.75, 10.25, 8.00, 8.50, 8.25, 7.75, 6.25,
7.00, 10.25, 8.25, 4.50, 10.75, 10.00, 9.50, 5.75, 15.50, 10.25,
8.75, 7.25, 11.25, 4.50, 12.00, 9.75, 3.00, 10.50, 6.00, 3.75,
5.75, 5.00, 11.75, 11.50, 5.75, 9.00, 9.75, 12.25, 5.75, 13.00)
summary(x);  sd(x)
Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
3.000   5.750   8.375   8.363  10.250  15.500
[1] 2.836885


The sample mean $$\8.36 > \7.50.$$ You would use a one-sample t test (not z test) to see whether $$\8.36$$ is 'statistically' larger than $$\7.50$$ so that the null hypothesis $$H_0: \mu \le 7.50$$ can be rejected in favor of the alternative $$H_a: \mu > 7.50.$$ You would use a t test because the population standard deviation is not known and is estimated by the sample standard deviation $$S = 2.84.$$

Here are results of a t test in R:

t.test(x, mu=7.50, alt="gr")

One Sample t-test

data:  x
t = 1.9229, df = 39, p-value = 0.03091
alternative hypothesis: true mean is greater than 7.5
95 percent confidence interval:
7.606748      Inf
sample estimates:
mean of x
8.3625


The P-value $$0.031$$ is smaller the $$0.05 = 5\%,$$ so we can reject $$H_0$$ at the 5% level of significance.

Does this mean that the owner of the restaurant should price this item at more than $$\7.50?$$ Maybe not: the average amount the customers in the survey are willing to pay is $$\8.35$$ and the 95% lower bound is $$\7.61.$$ Maybe the item will sell better if the 'average' opinion is that it's a bit underpriced.

The second part of the question asks if the proportion of customers willing to pay more than $$\7.50$$ exceeds 70%.

In the sample of $$n = 40$$ asked, $$25$$ (or $$\hat p = 0.625 = 62.5\%)$$ of them gave prices above $$\7.50.$$

sum(x >= 7.50)
[1] 25
mean(x >= 7.50)
[1] 0.625

stripchart(x, meth="stack", pch=20)
abline(v=7.50, col="green2", lty="dotted")


So it seems that the correct proportion is nearer to $$p = 0.625$$ than to $$p = 0.7.$$ We could formally test $$H_0: p \le 0.7$$ against $$H_a: p > 0.7,$$ but the outcome seems obvious. The data don't support the idea that more that $$62.5\%$$ would be willing to pay more than $$\7.50.$$ Of course, a (futile) test of proportions, cannot reject $$H_0.$$ Results from R:

prop.test(25, 40, .7, alt="gr")

1-sample proportions test with continuity correction

data:  25 out of 40, null probability 0.7
X-squared = 0.74405, df = 1, p-value = 0.8058
alternative hypothesis: true p is greater than 0.7
95 percent confidence interval:
0.4825422 1.0000000
sample estimates:
p
0.625


I suppose, you could 'turn it around' and test $$H_0: p \ge .7$$ against $$H_a: p < 7,$$ which does not lead to rejection. But if that was intended, then the wording of the question "[T]est whether or not there is statistical evidence that the proportion of target customers who are willing to buy the sandwich by paying $7.50 or more is greater than 70%." seems awkward, not-quite-English, or wrong. prop.test(25, 40, 0.7, alt="less")$p.val
[1] 0.1941837


Based on the data, a reasonable, and perhaps useful, statement about the percentage who would pay more than $$\S7.50$$ is the two-sided 95% CI for $$p:$$ $$(0.458, 0.768).$$

prop.test(25, 40)$conf.int [1] 0.4580964 0.7682594 attr(,"conf.level") [1] 0.95  Note: A test of $$H_0: p \le 0.6$$ against $$H_a: p > 0.6$$ would make more sense, but it does not reject. prop.test(25, 40, .6, alt="gr")$p.val
[1] 0.4358993


Also, the null hypothesis $$H_0: p \ge 0.8$$ against $$H_a: p < 0.8$$ does reject.

prop.test(25, 40, .8, alt="less")$p.val [1] 0.005094466  • The answer for p value for the second part of the question was that it was between 0.5000 to 1.000. Again I think this was to ensure that minor differences in the class's answers don't matter. I used the Z test here too, and incidentally got the correct answer. I wanted to know is there any other criteria which to use in order to determine whether we should be using a t test or a z test? Or is the rule of thumb, as you mentioned, is that if we are determining the values of the population from the sample itself, then we should be using a t test? Jul 28, 2020 at 5:38 • Agreed, and Yes on t vs. z. (Some say it's OK to use z when$n\$ is sufficiently large, and they are approximately correct.) Jul 28, 2020 at 5:47