MathStatisticsInferential StatisticsHypothesis testingStatistics tests

One sample t-test

7 minutes read

Concept of One-Sample T-Test

Imagine you have a production line, where you've previously discovered that the average weight of products is 300 grams, with a standard deviation of 30 grams. You're aware that when you take samples from this population, the sample means can vary, perhaps around 320 or 330 grams, which is normal.

During a quality assurance inspection, the inspector found that a random sample of 25 products had an average weight of 380 grams and a standard deviation of 50 grams. This finding suggests our initial estimated mean of 300 grams is likely inaccurate.

To question this hypothesis, we employ a one-sample t-test. This test aids us in verifying the accuracy of our initial assumption about the population mean. In the forthcoming sections, we'll be exploring the steps needed to perform a successful one-sample t-test.

Setting the Hypothesis

When testing a hypothesis, we have a null hypothesis, presented as (H0)(H_0), and an alternative hypothesis, noted as (H1)(H_1). The null hypothesis symbolizes our initial understanding of the mean, which we call the hypothesized population mean. Meanwhile, the alternative hypothesis signifies the challenge we aim to test.

In a one-sample t-test, the null hypothesis always takes one specific form.

H0:μ=hypothesized value(μ0)H_0: \mu=\text{hypothesized value}(\mu_0)

Returning to our earlier example with the production line,

H0:μ= 300 gramsH_0:\mu= \text{ 300 grams}

The alternative hypothesis can come in three forms, asserting a contradiction in the mean being less, more than the initial information, or simply stating that the initial value is likely incorrect. This is known as one-tailed or two-tailed hypotheses. The key difference between the one-tailed and two-tailed hypotheses emerges when calculating the p-value.

Sampling

Given it's a one-sample t-test, we'll require one random sample from the population. From this sample, we determine two crucial pieces of information: sample mean (xˉ\bar{x}) and sample standard deviation (ss). Random selection of the sample is essential to avoid any bias in the mean.

In our example, the inspector randomly picked a sample of 25 products (nn) and found its mean ((xˉ)(\bar{x})) to be 340, with a standard deviation ((s)(s)) of 50.

The p-value

The p-value helps decide if the null hypothesis is plausible. It indicates whether we should reject or fail to reject the null hypothesis. In essence, it shows the probability of obtaining the same or an even more extreme sample mean than the one we've recorded. Three simple steps follow to calculate the p-value:

  1. Calculate the t-critical value:

    t=xˉμ0s/nt={{\bar{x}-\mu_{0}}\over{s/\sqrt{n}}}

    This formula adopts the following variables:

    xˉ\bar{x}: sample mean
    μ0\mu_{0}: hypothesized population mean
    ss: sample standard deviation
    nn: sample size

    Applying this formula in our example yields,

    t=xˉμ0s/n=34030050/25=4t={{\bar{x}-\mu_{0}}\over{s/\sqrt{n}}}=\frac{340-300}{50/\sqrt{25}}=4
  2. Calculate the degrees of freedom:
    Using this formula: n1n-1
    Given that the inspector sampled 25 products, the degree of freedom equals: 251=2425-1=24.

  3. Find the corresponding p-value:
    Determining the p-value can be a bit complex and impractical. Hence, statisticians calculate p-values for a range of t-values and compile these results into a table known as a t-table.
    The t-table comprises columns of degrees of freedom and rows of t-critical values. At the top are the p-values for one-tailed and two-tailed hypotheses.

Significance level

The significance level, represented by alpha (α\alpha), serves as a threshold to help us to decide on our test results. Typically, we set it at 0.05 (5%). A significance level of 5% means that if we repeat the same experiment 100 times, each with a significance level of 5%, we'd expect on average, five of those experiments to yield statistically significant results purely due to chance.

In our test, we compare the p-value with the significance level to make our decision:

1. If the p-value <α<\alpha, we have strong evidence against the null hypothesis, implicating that the initial mean isn't true.

2. If the p-value >α>\alpha, it means that we don't have enough evidence against the null hypothesis. In other words, there isn't sufficient data to support the alternative hypothesis.

One-Sample T-Test Assumptions

Before applying a one-sample t-test, we need to confirm a few assumptions:

  • Random sampling: random selection ensures that there won't be any bias in the sample as each observation in the population has an equal chance of being chosen.

  • Normality: The population distribution should approximate a normal distribution, and this assumption becomes more critical as the sample size decreases.

  • Independence: This implies that no observation affects any other observation. For example, if we sample from a coffee machine dispenser, the weight of any cup won't affect any other cup. Hence, this sample is independent.

Conclusion

A one-sample t-test is a method used for hypothesis testing, aiming to check whether the population mean differs from a known or hypothesized value. Before running the test, you need to fulfill certain requirements. Firstly, the sample must be randomly selected. Secondly, your sampling data should follow a normal distribution. Thirdly, your observations must be independent, with no observation affecting the other.

The steps to perform this test are as follows:

  • Define your hypothesis, considering any contradiction in our initial understanding of the population mean.

  • Pull a random sample from the population and calculate its mean and standard deviation.

  • Calculate the critical t-value.

  • Use this t-value to find the p-value, either by referring to a t-table or using a suitable p-value calculator.

  • Compare your calculated p-value with the set significance level.

  • Finally, make your decision; you can either reject the null hypothesis or acknowledge that there isn't enough evidence to reject it.

2 learners liked this piece of theory. 0 didn't like it. What about you?
Report a typo