7. Hypothesis Testing: One-sample t-test
One-sample t-test: Test Statistic and p-value
One-sample t-test: Test Statistic
The test statistic of a one-sample -test for a population mean is denoted .
The calculation of the -statistic is nearly identical to the calculation of the -statistic. The only difference being:
- The -statistic is calculated using the (true) .
- The -statistic is calculated using the .
Under the null hypothesis of a one-sample -test, the -statistic follows a -distribution with degrees of freedom.
Student's t-Distribution
The shape of a -distribution is very similar to that of the Standard Normal Distribution, except that it has thicker tails and a lower peak. The exact shape is dependent on the number of degrees of freedom.
As the number of degrees of freedom increases, the difference between the sample standard deviation and the population standard deviation decreases and the -distribution will tend towards the Standard Normal Distribution.
Calculating the p-value of a one-sample t-test for a Population Mean with Statistical Software
The calculation of the -value of a -test for is dependent on the direction of the test and can be performed using either Excel or R.
To calculate the -value of a -test for in Excel, make use of one of the following commands:
To calculate the -value of a -test for in R, make use of one of the following commands:
If , reject and conclude . Otherwise, do not reject .
The engineer collects a random sample of new batteries and measures the performance of each one.
She plans on using a one-sample -test to determine if the mean range of the new battery significantly differs from km, at the level of significance.
The sample mean turns out to be km with a standard deviation of km.
Calculate the -value of the test and make a decision regarding . Round your answer to decimal places.
On the basis of this -value, should be rejected, because .
There are a number of different ways we can calculate the -value of the test. Click on one of the panels to toggle a specific solution.
A sample size of is considered large enough for the Central Limit Theorem to apply.
This means that, although the sample in question comes from a population having an unknown distribution, the test statistic
approximately has the distribution, under the assumption that is true.
Calculate the value of test statistic :
To calculate the -value of a -test, make use of the following Excel function:
T.DIST(x, deg_freedom, cumulative)
- x: The value at which you wish to evaluate the distribution function.
- deg_freedom: An integer indicating the number of degrees of freedom.
- cumulative: A logical value that determines the form of the function.
- TRUE - uses the cumulative distribution function,
- FALSE - uses the probability density function
Since we are dealing with a two-tailed -test, run the following command to calculate the -value:
This gives:
Since , should be rejected.
A sample size of is considered large enough for the Central Limit Theorem to apply.
This means that, although the sample in question comes from a population having an unknown distribution, the test statistic
approximately has the distribution, under the assumption that is true.
Calculate the value of test statistic :
To calculate the -value of a -test, make use of the following R function:
pt(q, df, lower.tail)
- q: The value at which you wish to evaluate the distribution function.
- df: An integer indicating the number of degrees of freedom.
- lower.tail: If TRUE (default), probabilities are , otherwise, .
Since we are dealing with a two-tailed -test, run the following command to calculate the -value:
This gives:
Since , should be rejected.