# Confusing question on z-score for sample mean

#### hollyinscotland

##### New Member
Hey folks,

I was hoping someone would understand this better than I do. I am trying to solve the following problem:

We are testing the hypothesis that the average gas consumption per day in Billings, Montana is greater than 7 gallons per day; we want 95% confidence.
We sample 30 drivers. The average is 8.4, and the sample standard deviation is 4.29. Our null hypothesis is H0:μ≤7

1) What is the Z-value for our sample mean of 8.4?

2) What is the p-value for our sample mean of 8.4?

3) Do we reject the null hypothesis?

Now, my first reaction is to use the z-score formula for converting sample mean: z = (x – μ) / (σ / √n), but I don't seem to have all the data required for this, since there is just one mean given. I can't figure out what I am missing! I don't expect a calculation for me (obviously!), but could someone lead me to the right way of calculating this? Many thanks in advance!

#### hollyinscotland

##### New Member
Thanks for your answer, but I am not sure how this adds up to the calculation of the website. The website says:

S.D.=4.29/30−−√=.78

Z=(8.4−7)/.78=1.8

From the Z-table: 1.8 corresponds to .9641; p= 1 - .9641 = .036

We reject the null hypothesis since 1.8 > 1.64 (and .036 is less than 95%).

In plain English, we are 95% sure that we will not get a sample mean of 8.4 when the true population mean is 7.

What I still don't get is why they use those numbers for SD an what Z formula are they following?

Thanks!

#### obh

##### Well-Known Member
I was on the train ...
Generally, when you don't know the standard deviation you should use the t-test based on the sample standard deviation.
Yes, your calculation is correct if we ignore the fact you should use the t-test.
So your calculation is based on the assumption that the population's S.D=4.29