## A. Colin Cameron, Dept. of Economics, Univ. of Calif. - Davis

This September 1999 help sheet gives information on how to
• construct confidence intervals for the population mean
• perform hypothesis tests on the population mean

The most commonly used confidence intervals and hypothesis tests for the population mean use the t-distribution. These are the ones we present, and the ones that the latest versions of Excel produce in descriptive statistics.

The underlying theory to justify this assumes normally distributed data, i.e. that the individual observations are independent and identically distributed observations from a normal distribution with mean mu and unknown variance sigma.

What if the data are not normal, though are still independent and identically distributed observations with mean mu and unknown variance sigma?

• If there are more than 30 observations we can continue to use the same confidence interval. The justification is the central limit theorem. (Strictly speaking the central limit theorem gives a z-distribution (standard normal) rather than t-distribution.But the two are so close when degrees of freedom are greater than 30, that for simplicity we continue to use the t-distribution.
• If there are less than 30 observations we cannot do this. We should use other methods, e.g. tests on the median, which are not available in Excel. Or ensure that the data appear to be close to normal to assume normality.
In summary in economics the standard approach is for:
• Normal sample that is large or small: use t-distribution for statistical inference on mu.
• Nonnormal sample that is large (n>=30): use t-distribution for statistical inference on mu.
• Nonnormal sample that is small (n<30): use other methods.

EXAMPLE DATA

Start with EXCEL: Descriptive Statistics with the Confidence level for the mean option chosen and set to 95%.
This yields as output

CONFIDENCE INTERVALS FOR THE POPULATION MEAN

A 95% confidence interval for the population mean is the sample mean plus or minus the "confidence level" reported by Excel.
Here this yields 119.90 +/- 2.59  =  (117.31, 122.49).

This means that the data are consistent 95% of the time with a data generating process with population mean mu in the range 117.31 to 122.49.

To obtain confidence intervals at other levels of confidence, e.g. 90%, in Tools / Data Analysis / Descriptive Statistics change the confidence level for the mean from its default of 95% to e.g. 90%.

Note that since the sample is small here (n=10) this test requires the assumption that the data are normally distributed (see GENERAL COMMENTS at the top of this handout). This assumption is impossible to test with only ten observations, but could be justified if (and I say if) experience with other larger samples of gasoline price data suggests that this is a resonable assumption.

DETAILS ON CONFIDENCE INTERVALS FOR THE POPULATION MEAN

A symmetric confidence interval in general is of the form:
parameter of interest   +/-   critical value * standard error.

For this particular problem, a 95% confidence interval for the population mean, for x normal(mu,sigma) this is
mu  +/-  t(.025;n-1) * s/sqrt(n)
which can be calculated manually in Excel using:

• The critical value is that of a t-distribution with (n-1) degrees of freedom and area .95 in the center and .05 in the combined tails.

• In Excel this can be calculated by the command TINV(0.05,188) which yields a value 2.262158887.
(Note that TINV reports results for two tails of the t distribution, not just one tail).
Common textbook notation is to denote this t(.025;n-1) as there is area of .025 in the upper tail.
• The standard error is s / sqrt(n), the standard deviation divided by the square root of the number of observations.

• This is given in the second line of the descriptive statistics output as 1.145038.
This can also be calculated as the fifth line of the descriptive statistics output (3.620927) divided by the square root of 10.
• Combining we note that the critical value (2.262158887) times the standard error 1.145038 yields 2.590257888.
This final result is that given automatically at the end of the descriptive statistics output.

HYPOTHESIS TESTS FOR THE POPULATION MEAN

Hypothesis Tests for the Population Mean

Excel does not have an automatic command and output for hypothesis testing on the population mean.
Instead one needs to manually perform the hypothesis test using output from descriptive statistics.

We distinguish between one-sided and two-sided tests.
Let  mu0  denote the hypothesized valu of mu.
Two-sided test:  H0: mu = mu0  against  Ha: mu not equal to mu0
One-sided test:  H0: mu <= mu0  against  Ha: mu > mu0
or:  H0: mu >= mu0  against  H0: mu < mu0

We first find the value of a test statistic.
We then use either the p-value approach or the critical value approach to reject or not reject the null hypothesis that mu = mu0.

Test Statistic

A test statistic is often of the form:
(estimated value - hypothesized value) / standard error
where the standard error gives the precision of the estimate.

For tests of H0: mu = mu0 we use the t-test statistic:
t = (ybar - mu0) / (s/sqrt(n)).

For the example here, to test H0: mu = 118 using the above data,
t = (119.9 - 118) / 1.145038 = 1.659.

The t-statistic is t-distributed with (n-1) degrees of freedom under the null hypothesis that mu = mu0 and assuming that the individual observations are independent and identically distributed observations from a normal distribution with mean mu.

Note that since the sample is small here (n=10) this test requires the assumption that the data are normally distributed (see GENERAL COMMENTS at the top of this handout). This assumption is impossible to test with only ten observations, but could be justified if (and I say if) experience with other larger samples of gasoline price data suggests that this is a resonable assumption.

p-value approach

The p-value is the probability of just rejecting the null hypothesis.

In general we reject the null hypothesis at level alpha if the p-value < alpha
and do not reject the null hypothesis at level alpha if the p-value >= alpha.

Let  T  be a t-distributed random variable and t be the calculated value of the test statistic.

• For test against Ha: mu not equal to mu0:  p-value = Pr(T <= -t or T >=  t).
• For test against Ha: mu > mu0:  p-value = Pr(T >=  t).
• For test against Ha: mu > mu0:  p-value = Pr(T <=  t) = 1 - Pr(T >  -t).
For the above example the t-statistic is t = 1.659 and its distribution is the t-distribution with  n-1 = 9 degrees of freedom.
The TDIST function gives the area in the tails of the t-distribution.

The p-value for hypothesis tests on the population mean is then obtained using the Excel commands:

• p-value for a 2-sided test:

• pvalue = TDIST(1.659,9,2)  which yields a p-value of  0.131.
• p-value for a 1-sided test against Ha: mu > mu0:

• p-value = TDIST(1.659,9,1) which yields a p-value of 0.066.
• p-value for a 1-sided test against Ha: mu < mu0:

• p-value = 1 - TDIST(1.659,9,1) which yields a p-value of 1 - 0.066 = 0.934.
In all cases the p-value is greater than 0.05 so in all cases we do not reject H0 at significance level 5%.

More generally we will have a different test statistic value than 1.659 and a different number of degrees of freedom than 9.

Critical values

Critical values are used to define a critical region.

If the calculated value of the test statistic falls in critical region then the null hypothesis is rejected. Otherwise it is not rejected.

Let  c  be the critical value of the test statistic and consider tests at level alpha (often alpha = .05).

• For test against Ha: mu not equal to mu0:  critical value is c such that Pr(T <= -c or T >=  c) = alpha.
• For test against Ha: mu > mu0:  critical value is c such that Pr(T  >=  c) = alpha.
• For test against Ha: mu < mu0:  critical value is c such that Pr(T <=  c) = alpha.
The rejection region is then
• For test against Ha: mu not equal to mu0:  t is such that  t <= -c or t >=  c.
• For test against Ha: mu > mu0:  t is such that t  >=  c.
• For test against Ha: mu < mu0:  t is such that  t <=  c.
The TINV function gives the critical value at which we get a certain area in the tails of the t-distribution. Most often this area is .05 (or 5%).

The critical for hypothesis tests on the population mean is then obtained using the Excel commands:

• critical value for a 2-sided test:

• critical value = TINV(.025,9)  which yields a critical value of 2.685.
• critical value for a 1-sided test

• critical value = TINV(.05,9)  which yields a critical value of 2.262.
Then
• For test against Ha: mu not equal to mu0:  t = 1.659  is not such that  t <= -2.685 or t >=  2.685.
• For test against Ha: mu > mu0:  t = 1.659 is not such that t  >=  2.262.
• For test against Ha: mu < mu0:  t = 1.659 is not such that t  <=  -2.262
In all three cases we therefore do not reject H0.

The hypothesis tests here use the t-distribution.

The underlying theory assumes normally distributed data, i.e. that the individual observations are independent and identically distributed observations from a normal distribution with mean mu and unknown variance sigma.

What if the data are not normal, though are still independent and identically distributed observations with mean mu and unknown variance sigma?
If there are more than 30 observations we can continue to use the same confidence interval. The justification is the central limit theorem.
If there are less than 30 observations we can continue to use the same confidence interval. The justification is the central limit theorem.

For further information on how to use Excel go to
http://www.econ.ucdavis.edu/faculty/cameron