JMP | Statistical Discovery.™ From SAS.

Statistics Knowledge Portal

A free online introduction to statistics

What is a t- test?

A t -test (also known as Student's t -test) is a tool for evaluating the means of one or two populations using hypothesis testing. A t-test may be used to evaluate whether a single group differs from a known value (a one-sample t-test), whether two groups differ from each other (an independent two-sample t-test), or whether there is a significant difference in paired measurements (a paired, or dependent samples t-test).

How are t -tests used?

First, you define the hypothesis you are going to test and specify an acceptable risk of drawing a faulty conclusion. For example, when comparing two populations, you might hypothesize that their means are the same, and you decide on an acceptable probability of concluding that a difference exists when that is not true. Next, you calculate a test statistic from your data and compare it to a theoretical value from a  t- distribution. Depending on the outcome, you either reject or fail to reject your null hypothesis. 

What if I have more than two groups?

You cannot use a t -test. Use a multiple comparison method. Examples are analysis of variance ( ANOVA ) , Tukey-Kramer pairwise comparison, Dunnett's comparison to a control, and analysis of means (ANOM).  

t -Test assumptions

While t -tests are relatively robust to deviations from assumptions, t -tests do assume that:

  • The data are continuous.
  • The sample data have been randomly sampled from a population.
  • There is homogeneity of variance (i.e., the variability of the data in each group is similar).
  • The distribution is approximately normal.

For two-sample t -tests, we must have independent samples. If the samples are not independent, then a paired t -test may be appropriate.

Types of t -tests

There are three t -tests to compare means: a one-sample t -test, a two-sample t -test and a paired t -test. The table below summarizes the characteristics of each and provides guidance on how to choose the correct test. Visit the individual pages for each type of t -test for examples along with details on assumptions and calculations.

  test test test
SynonymsStudent’s -test -test test -test -test -test test -test
Number of variablesOneTwoTwo
Type of variable
Purpose of testDecide if the population mean is equal to a specific value or notDecide if the population means for two different groups are equal or notDecide if the difference between paired measurements for a population is zero or not
Example: test if...Mean heart rate of a group of people is equal to 65 or notMean heart rates for two groups of people are the same or notMean difference in heart rate for a group of people before and after exercise is zero or not
Estimate of population meanSample averageSample average for each groupSample average of the differences in paired measurements
Population standard deviationUnknown, use sample standard deviationUnknown, use sample standard deviations for each groupUnknown, use sample standard deviation of differences in paired measurements
Degrees of freedomNumber of observations in sample minus 1, or:
n–1
Sum of observations in each sample minus 2, or:
n + n – 2
Number of paired observations in sample minus 1, or:
n–1

The table above shows only the t -tests for population means. Another common t -test is for correlation coefficients .  You use this t -test to decide if the correlation coefficient is significantly different from zero. 

One-tailed vs. two-tailed tests

When you define the hypothesis, you also define whether you have a one-tailed or a two-tailed test. You should make this decision before collecting your data or doing any calculations. You make this decision for all three of the t -tests for means.

To explain, let’s use the one-sample t -test. Suppose we have a random sample of protein bars, and the label for the bars advertises 20 grams of protein per bar. The null hypothesis is that the unknown population mean is 20. Suppose we simply want to know if the data shows we have a different population mean. In this situation, our hypotheses are:

$ \mathrm H_o: \mu = 20 $

$ \mathrm H_a: \mu \neq 20 $

Here, we have a two-tailed test. We will use the data to see if the sample average differs sufficiently from 20 – either higher or lower – to conclude that the unknown population mean is different from 20.

Suppose instead that we want to know whether the advertising on the label is correct. Does the data support the idea that the unknown population mean is at least 20? Or not? In this situation, our hypotheses are:

$ \mathrm H_o: \mu >= 20 $

$ \mathrm H_a: \mu < 20 $

Here, we have a one-tailed test. We will use the data to see if the sample average is sufficiently less than 20 to reject the hypothesis that the unknown population mean is 20 or higher.

See the "tails for hypotheses tests" section on the t -distribution page for images that illustrate the concepts for one-tailed and two-tailed tests.

How to perform a t -test

For all of the t -tests involving means, you perform the same steps in analysis:

  • Define your null ($ \mathrm H_o $) and alternative ($ \mathrm H_a $) hypotheses before collecting your data.
  • Decide on the alpha value (or α value). This involves determining the risk you are willing to take of drawing the wrong conclusion. For example, suppose you set α=0.05 when comparing two independent groups. Here, you have decided on a 5% risk of concluding the unknown population means are different when they are not.
  • Check the data for errors.
  • Check the assumptions for the test.
  • Perform the test and draw your conclusion. All t -tests for means involve calculating a test statistic. You compare the test statistic to a theoretical value from the t- distribution . The theoretical value involves both the α value and the degrees of freedom for your data. For more detail, visit the pages for one-sample t -test , two-sample t -test and paired t -test .

COMMENTS

  1. Using Hypothesis Testing to Make Informed Decisions

    Confidence Level needed can depend. Often, acceptable Confidence Level for making decisions is 95%. Perhaps if you are looking at life-or-death decisions, you need to be 99.9% confident in the results. 95% confidence means if you run statistical test 100 times, your should be right about 95 times. Alpha value is 1 - Confidence/100.

  2. How to perform Hypotheses Testing in JMP

    This video shows how to perform different hypothesis testing in JMP platforms.If you use any of the words described below in your job and projects, this vide...

  3. Hypothesis Testing for Means

    Learn how to use JMP to perform hypothesis tests for means using z-test, t-test, paired t-test and two-sample t-test. Download PDF activities and view examples of data analysis and interpretation.

  4. The Logic of Hypothesis Testing

    To view a playlist and download materials shown in this eCourse, visit the course page at: http://www.jmp.com/en_us/academic/ssms.html

  5. Confidence Intervals and Hypothesis Testing Tutorial

    In this module, you will learn about using interval estimates to estimate population parameters, explore key concepts in statistical testing and statistical decision making, and discover the role that sample size plays in the precision of your interval estimates and the power of your statistical tests. Estimated time to complete this module: 4 ...

  6. Hypothesis Test and Confidence Interval for Proportions

    Buy JMP. Try JMP. Download All Guides. Hypothesis Test and Confidence Interval for Proportions. Estimate and perform a hypothesis test for a population proportion. Step-by-step guide. View Guide.

  7. Hypothesis testing

    This video shows how to conduct a t test for paired observations using JMP.

  8. Hypothesis Test for Population Proportion

    Aug 2015: Corrected labeling issues in Hypothesis Test for Proportion, and changed the default for the continuity correction to "off". Also, when the "Create Data Table" option is used the script now writes out both the test statistics and the p-values to the data table. Sep 2016: Fixed an issue with the test statistic.

  9. PDF Comparisons involving two sample means (JMP)

    § Test H o: using an F-test where:2 § 2If there are large differences between , F will become large and result in the rejection of H o: . § We will be testing the hypothesis H o: at the 95% level of confidence. § This F-test is a two-tail test because we are not specifying which variance is expected to be larger.

  10. Using Hypothesis Testing to Make Informed Decisions

    Learn how to use JMP to make conclusions related to a situation or problem on the basis of data obtained from a sample of data, so you can use the results to improve quality and provide guidance on production control and improvements. See examples that demonstrate the basic principles that you can easily apply to your work. This webinar covers ...

  11. Hypothesis testing

    This video shows how to conduct a one sample t test using the distribution platform in JMP.

  12. What is a p-value in statistics?

    So we calculate a test statistic — say a t-value — based on our data and then mentally draw a line at that value. Our p-value is the proportion of the distribution that is more extreme than that line. It's like a pie chart — or better yet a pie. Your p-value is the proportion of the null hypothesis pie you get in your slice.

  13. PDF Statistics With Jmp: Hypothesis Tests, Anova and Regression

    ve reader will notice immediately that the second histogram2 Outputs as in Figures 1.1 and 1.2 can be created in JMP w. th the "Distribution" option in the "Analyze" menu.Figure 1.1 Histograms and descriptive statistics for 1000 sample means and medians calculated on samples of five observations from a normally distr.

  14. One Sample t Test in JMP

    JMP Tutorial:One Sample t Test. Click the link below and save the following JMP file to your Desktop: Now go to your Desktop and double click on the JMP file you just downloaded. This action will start JMP and display the content of this file: Click the Analyze menu, then select Distribution. Click the Pretest column, then click Y, columns.

  15. Two Sample t-Test and Confidence Interval

    Try JMP. Download All Guides. Two Sample t-Test and Confidence Interval. Test a hypothesis and generate a confidence interval comparing two population means. Step-by-step guide. View Guide. Analyze > Fit Y by X. Statistics Knowledge Portal: Two-Sample t-Test.

  16. Confidence Intervals and Hypothesis Testing in JMP

    Confidence Intervals and Hypothesis Testing in JMP for both proportions and means.

  17. Hypothesis Test Contradictory Results Interpretation

    Dear JMP Community, I am trying to figure out the contradiction between 2 hypothesis system per below done at significance level of 0.05. Looking at the first hypothesis system. 2 sided Test. Ho: Mu=0 , H1: Mu not equal 0, P (value) = 0.0705. Statistical Conclusion : Failed to Reject Ho hence Mu=0. However, if we look at the third system.

  18. Confidence Interval and Hypothesis Test for a Proportion in JMP

    JMP Tutorial:Confidence Interval and Hypothesis Test for a Proportion. A random sample of n=150 Stat 201 students in Spring 09 revealed that 91 of them were born in Tennessee. Create a JMP data table as follows. Notice that 91 + 59 = 150 = sample size. Go to the Analyze menu and select Distribution:

  19. Hypothesis testing

    This video shows how to conduct equivalence testing using the distribution platform in JMP.

  20. The t-Test

    Learn about the different types of t-tests for comparing means, their assumptions and how to perform them. Find out how to choose the correct t-test based on the number of variables, the purpose of the test and the type of variable.

  21. Hypothesis Test on the Mean (Unknown Variance) Using JMP

    About Press Copyright Contact us Creators Advertise Developers Terms Privacy Policy & Safety How YouTube works Test new features NFL Sunday Ticket Press Copyright ...

  22. How do I do a two sample proportion hypothesis test?

    Solution. Nov 21, 2020 10:37 PM | Posted in reply to message from christiant 11-21-2020. The Two Sample Proportion is available in the Statistics Index under the Help Pull Down Menu. In the example shown, the data table is in the raw form, having all of the individual measurements, rather than the counts being summarized as in your data.