In the previous article, we introduced the basic operation of comparison between groups, and in the previous article, we introduced the implementation of t test in JMP in detail. The t test is a statistical method used to test the difference between two groups of means. This article will take you to understand in detail what is analysis of variance (ANOVA), what conditions must be considered before using analysis of variance, and how to use JMP for analysis of variance (ANOVA) ) Compare with pairwise.
In this article, we take the data in Figure 1 as an example to explain.

Figure 1 Sample data
What is analysis of variance (ANOVA)?
Variance analysis is to decompose the total variation of all observations into inter-group variation and error variation, and then compare the inter-group variation with random error to determine whether the difference between the overall means is statistically significant.
Three major conditions must be met to use variance analysis
The variance analysis is a more general extension of the t test, and the t test can be regarded as a special case of the variance analysis.
Therefore, the prerequisites for using variance analysis are the same as the t test:
① Each sample is independent of each other;
②The data of each group are all normally distributed;
③The number of variance between each group is equal.
This means that before performing the variance analysis, we need to perform the normality test and the homogeneity of variance test (Homogeneity of variance test). Because the variance analysis can only draw the conclusion of "whether there is a difference between groups", which specific group is There is a difference between the two, and further statistical analysis is needed. At this time, the pairwise comparison method is needed. The common pairwise comparison methods are Bonferroni, Tukey' HSD, and Dunnett.
Bonferroni method
The Bonferroni method adjusts the inspection level when making pairwise comparisons. Usually 0.05 is used as the test level for comparison between groups, but in pairwise comparisons, there is a 5% probability that a Type I error will occur in each comparison.
The idea of using the Bonferroni method is to reduce the test level by dividing 0.05 by the number of comparisons, thereby reducing false positive errors. If the 4 groups of pairwise comparisons need to be compared 6 times in total, the test level of the pairwise comparisons needs to be adjusted to 0.05/6=0.0083, that is, p<0.0083 is considered to be a statistical difference. However, this method is not suitable when the number of comparisons is large, because the inspection level after correction will be too small.
Tukey'HSD method
The Tukey method is a common pairwise comparison method. This method can only be used when the number of cases in each group is equal. Later, an improved Tukey method is proposed, which can be used in cases where the number of cases in each group is not equal. What JMP provides is the improved Tukey method, which can be used as the preferred method for pairwise comparison.
Dunnett method
Dunnett's t test is specifically used to compare the difference between a control group and multiple test groups. There is no comparison between test groups.
Use JMP for analysis of variance (ANOVA)
In the data (Figure 1), if there is a difference in the physical health scores of patients with different cardiac function classifications, the cardiac function classifications are divided into one to four levels. Therefore, this is a comparison between four groups and cannot be directly used for the t test. Instead, consider the method of comparing multiple groups. First, click the JMP menu "Analyze → Fit Y with X" (Figure 2) to enter the interface for comparison of differences between groups.

Figure 2 Variation analysis operation-menu selection
In this example, the physical health score is the result, and the cardiac function classification is grouped. Therefore, in the dialog box, put the physical health score into "Y, response" and the cardiac function classification into "X, factor" (Figure 3).

Figure 3 Variation analysis operation-variable selection
After entering the result screen, we need to Combining the results of the normal state test and the Homogeneity of Variance test (Homogeneity of Variance test), select the appropriate statistical method, the analysis results are as follows:
> The results of the normal verification show that the data of each group are of normal distribution.
> See the results of Homogeneity of Variance Test (Figure 4).
The Homogeneity of variance test for multiple sets of data mostly uses Bartlett test and Levene test. As for the use of the two tests are slightly different, the Bartlett test is mainly used Normal distribution Data, Levene test is mostly used for data Does not meet the normal distribution Situation.
Read the article< Perform normality test and homogeneity test of variance in JMP 〉Understand how to perform this inspection.
In this example, the data is normally distributed, so we use Bartlett's test, and the analysis result shows P=0.0224, which is an uneven variance.

Figure 4 Homogeneity of variance test results
When the data is normally distributed but does not satisfy the Homogeneity of Variance test (Homogeneity of variance test), Welch variance analysis is used. For method selection, please refer to the article< Realize the powerful function of comparison between all groups of data-fit X to Y 〉.
The results of Welch's variance analysis are shown in the last part of the results of Homogeneity of Variance Test (Figure 5). The results showed that the difference in physical health scores between the four groups was statistically significant (F=40.2951, P<0.0001).

Figure 5 Welch variance analysis output results
If the data satisfies the normal state and the variances are uniform, the variance analysis can be used directly. Although from the conditions, the data in this example should be tested by Welch, but as an example, we also introduce how the results of the variance analysis are output. Click the red triangle button next to the single factor analysis of "Heart Function Classification-Physical Health Score", and select "Mean/Variance Analysis" from the drop-down menu, as shown in Figure 6.

Figure 6 Variance analysis operation-method selection
The output results are shown in (Figure 7). The results of variance analysis show that the physical health scores of the four groups have statistically significant differences (F=16.0080, P<0.0001).

Figure 7 Output result of variance analysis
It can be seen from the above analysis results that the F value of the variance analysis is somewhat different from the Welch test result. Therefore, for the comparison of continuous variables between groups, the normality and the homogeneity of the variance must be considered comprehensively.
Pairwise comparison in JMP
If the result of the total variance analysis shows no statistical difference, indicating that there is no statistical difference between the groups, do not make a pairwise comparison; but if the total comparison result between the groups shows that the difference between the four groups is statistically significant, Then it is usually necessary to make a pairwise comparison between groups to clarify which two groups are different.
The pairwise comparison operation of normal data in JMP is completed in the "Compare Mean" option. Since we want to compare the differences between any two groups, we can choose the Tukey method. The operation is shown in Figure 8.

Figure 8 Pairwise comparison operation
Click the red triangle button next to "Heart Function Grading-Physical Health Score" single factor analysis, and select "Compare Means→All Pairs, Tukey HSD" from the drop-down menu.
The output results are shown in (Figure 9). The results show that there is no difference between the cardiac function grades 3 and 4, and there are statistical differences between the other groups. The analysis results of this case show that the differences in physical health scores of people with different cardiac function classes are statistically significant (F=16.0080, P<0.0001). Except for the difference between the heart function classes 3 and 4, there is no difference between the other heart function classes. There is statistical significance.

Figure 9 Pairwise comparison output result graph
The above is the practical sharing we brought to you in this issue, immediately Download JMP Try the above operation!
original: Dry Goods | The Idea and Realization of Analysis of Variance and Pairwise Comparison
Recommended reading:
There are 3 commonly used t-tests in one literature-independent-sample t-test, single-sample t-test and paired t-test