In the past few articles, we have introduced the basic operations of comparison between groups, the normal test and the homogeneity test of variance. Today’s article will introduce the most commonly used t-tests: independent-sample t-tests, single-sample t-tests, and paired-sample tests, and give examples of how to use JMP to complete the analysis.
Three common t Verification
The t test is mainly used to test whether a sample statistic is equal to the overall parameter. In practical applications, there are three most common scenarios: independent sample t test, paired sample t test and single sample t test.
- Independent sample t test: used to test whether there is a statistical difference between the averages of two independent samples
- Single sample t test: used to compare whether there is a statistical difference between sample data and a specific value
- Paired t test: used to test whether the average of paired samples is statistically different.
This article mainly uses two data, one is the physical health score data (Figure 1), and the other is the skin moisture content data (Figure 2).

Figure 1 Physical health score data

Figure 2 Skin moisture content data
1. Independent sample t Verification
The so-called independent sample means that the population from which the sample originated is independent of each other. For example, comparing the physical health scores of the two groups, Zhang San’s score has nothing to do with Li Si’s score, and they are independent of each other.
Example 1: In the physical health score data, we want to compare whether there is a difference in physical health scores between smokers and non-smokers.
First, click the JMP menu "Analyze" → "Fit Y with X" to call up the interface for comparing differences between groups (Figure 3).

Figure 3 Independent sample t verification operation-function table selection
In this example, the physical health score is the result, and smoking is the grouping, so put the physical health score in the dialog box into "Y, response" and smoking into the "X, factor" (Figure 4).

Figure 4 Independent sample t test operation-variable selection
The result is shown in Figure 5.
If you have read the article in the previous issue, you should know that although Figure 5 does not have any statistical results, we can click the red triangle button on the upper left to display the statistical analysis results we need. The selection of these results needs to be combined The normality of the data and the homogeneity of the variance are judged.
The test results show that the data has a normal distribution and the variance is homogeneous, so independent sample t test can be considered.

Figure 5 Output result graph
Click the red triangle button next to the single factor analysis of "Smoking-Physical Health Score", and select "Average/Variance Analysis/Combined t (Figure 6)" in the drop-down menu.

Figure 6 Independent sample t verification operation-method selection
The result is shown in Figure 7. The t value (that is, the ratio of t in the result) is 0.696, and the result gives 3 P values, namely: probability>|t|, probability>t and probability|t| represents the two-sided P value, which is also the most frequently reported. Probability>t and probability
The results suggest that there is no statistically significant difference in physical health scores between smokers and non-smokers.

Figure 7 Independent sample t test results
If the data in this case meets the normality but the variance of the two groups is not homogeneous, the adjusted t test (Satterthwaite t test) can be used. Click the red triangle button on the left side of "Smoking-Physical Health Score" single factor analysis (Figure 8), and select "t-test" from the drop-down menu to obtain the result of the adjusted t-test.
The display format and interpretation of the results are the same as the t test shown in Figure 7.

Figure 8 Selection of calibration t test
**Note here:
In the options of JMP, "t test" outputs the result of calibrated t test, while "average/variance analysis/combined t" selects to output the result of t test. Everyone should avoid checking mistakes when doing analysis.
2. Single sample t Verification
The single-sample t test is usually used to test whether there is a statistical difference between the mean value of a set of data and the specified target value. If you want to know whether the average red blood cell value of a particular professional athlete is statistically different from the standard red blood cell value.
Example 2: In the physical health score data, assuming that the normal value of the physical health score is 60, it is planned to know whether there is a difference between the patient's physical health score and the normal value of healthy people.
The data in this study are normally distributed, and one-sample t test can be considered.
Since the single-sample t test does not have a grouping factor, it is not completed in the "fit Y with X" function table, but is implemented in the "distribution" function table.

Figure 9 Single-sample t verification-function table selection
Select "Analysis → Distribution" (Figure 9). In the interface of Figure 10, put the physical health score into "Y, row". Click OK to enter the result interface (Figure 11).

Figure 10 Single-sample t test-variable selection
Click the red triangle button on the left side of the physical fitness score, and select the "verified mean" in the drop-down menu (Figure 11), where the "mean" is the target value we need to specify.

Figure 11 Single-sample t test-method selection
In the pop-up dialog box, fill in 60 in the specified hypothetical mean (Figure 12), that is, whether the mean value of the physical health score of the test sample population is statistically different from the target value of 60. If the standard deviation is known, you can also enter the standard deviation in Figure 12. If it is unknown, estimate it based on the sample data.

Figure 12 Single-sample t test-specify target value
The results are shown in Figure 13 below, suggesting that the difference is statistically significant (t=-5.7130, p<0.0001).

Figure 13 Single-sample t test results
3. Paired t test : Comparison of two sets of paired data
The opposite of the concept of independent samples is paired samples, that is, the samples are not independent. For example, the blood pressure values of a person with hypertension before and after treatment. For Zhang San, the blood pressure values before and after treatment will have a certain relationship. If it is 180 before treatment, it is usually unlikely to drop to 120 suddenly after treatment, and it is likely to be slightly lower than 180.
Example 3: In the water content data, it is planned to explore whether there is a difference in skin water content between patients before and after intervention. Since this study explores whether there are differences in the examination results of the same batch of patients at different time points, it belongs to paired data. If the data obey the normal distribution, the paired t test is used. If the normal distribution is not satisfied, then a non-parametric pairing test is used. The non-parametric test will be introduced in detail in the following chapters.
The statistical analysis idea of the paired t test is to calculate the difference before and after the intervention, and compare the mean of the difference with 0, so as to obtain whether the difference before and after the intervention is statistically significant. Therefore, when importing paired data in JMP, you should pay attention to the import format as shown in Figure 2. The two measured values of each patient are on two columns in the same row, so that the difference between the measured values of each patient can be obtained. value.
The realization of the paired t test is not in the "Fit Y with X" menu, but under the "Professional Modeling" menu. Select "Analysis→Professional Modeling→Matching" (Figure 14).

Figure 14 Pairing t verification-function table selection
Here is a reminder: This article uses JMP 15 as an example. In different JMP versions, the location of the pairing menu may be different. In the early JMP software, you can directly find the "pairing" module under the "analysis" option. .
In the paired t-test, at least two outcome variables are required. In this case, skin moisture content (before intervention) and skin moisture content (after intervention). Put these two variables into "Y, matched response" (Figure 15) . When JMP performs the calculation of the paired t test, the variable in the second row is subtracted from the variable in the first row by default. Pay attention to the order of the variables in the operation.
As shown in Figure 15, the first row before the intervention and the second row after the intervention, so the result is based on the post-intervention-pre-intervention. In this case, we want to know whether the skin moisture content has increased after the intervention, so we put the skin moisture content first (before the intervention), and then put the skin moisture content (after the intervention).

Figure 15 Paired t test-variable selection
The result of paired t test is shown in Figure 16. In the results, the calculation method of the difference is firstly given as skin moisture content (after intervention)-skin moisture content (before intervention). In the results section, the mean values before and after intervention are given, and the mean difference is 6.32, indicating the difference after intervention The skin moisture content was higher than before the intervention, and the skin moisture content increased by 6.32 on average. The difference in skin water content before and after intervention was statistically significant (t=12.595, p<0.0001).

Figure 16 Paired t test results
The above is the three common t-test application scenarios, application ideas and analysis precautions based on JMP brought to you in this issue. In subsequent articles, we will continue to bring you variance analysis and pairwise comparison, rank sum test and pairwise comparison, chi-square test and trend test. Stay tuned!
original: Three common methods of t-test in a literary society