Comparison between groups is the basic content of statistical analysis. Simply put, it is to compare the indicators between two or more groups. This indicator can be a continuous variable or a categorical variable. Any statistical analysis is almost inseparable from comparison between groups. For example, in a randomized controlled trial, the main purpose is to compare the efficacy of the two groups. In a multivariate analysis, the comparison between groups is usually used as a baseline result and needs to be shown to everyone.
Today I will introduce that JMP has a magical function table, which can realize almost all group comparisons. This function table is-fit X to Y.
What is x Fit y ?
To put it simply, the group factor is regarded as x, and the variable to be analyzed is regarded as the dependent variable y. According to the variable types of x and y, JMP software will automatically determine the appropriate method.
Why is this function so magical? This article will explain from several aspects:
- Selection of common comparison methods between groups;
- Link up common comparison methods between groups from a macro perspective;
- Through a case, how to use a function table of JMP to realize all the comparisons between groups.
As for the specific methods of comparison between groups, we will introduce them one after another in a series of articles.
How to choose the comparison method between groups?
There are many ways to compare between groups, depending on the number of groups, the types of analysis variables, and so on.
The statistical methods for comparison between continuous variable groups mainly include t test, analysis of variance, rank sum test and so on. You can refer to Figure 1 when choosing a statistical method for comparison between continuous variable groups. If you carefully refer to this figure during data analysis, you will not use t-test to analyze non-normal data, or forget to do the homogeneity test of variance. mistake.

Figure 1 Ideas for the selection of comparison methods between continuous variable groups
When choosing a statistical method, the main considerations include:
- Research design (completely random or paired design)
- Number of groups (two groups or multiple groups)
- Normal distribution (normal or non-normal)
- Homogeneity of variance (even or uneven variance)
The main statistical methods for comparison between categorical variables are chi-square test and rank sum test. The method selection is shown in Figure 2.
When choosing a statistical method for comparing categorical variables, the main factors to consider include:
- Research design (completely random or paired design)
- Compare the number of groups (two groups or multiple groups)
- Types of outcome indicators (two categories or multiple categories; ordered or disordered)
The choice of method is mainly related to the nature of the outcome index (note that it is not a grouping variable):
- If it is a binary outcome, the chi-square test is used;
- If it is a multi-category outcome, it is necessary to consider whether the outcome indicator is ordered or disordered, if it is a disordered variable, use the chi-square test, if it is an ordinal variable, use the rank sum test.

Figure 2 Ideas for the selection of comparison methods between categorical variable groups
JMP Comparison between groups in the table
In JMP, most of the comparisons between groups can be achieved in the X fit Y function table (Figure 3), which means that no matter it is t test, rank sum test, analysis of variance or chi-square test, all of them pass this module accomplish.

Figure 3 Fit Y with X menu
The interface of fitting the Y function table with X is shown in Figure 4, and you can first have an intuitive impression.

Figure 4 Use X to fit the Y menu interface
This menu may be a bit confusing for people who are used to a specific method (such as t-test, analysis of variance).
As you can notice, in the lower left of Figure 4, according to whether x is classified or continuous, and y is classified or continuous, four methods are combined:
① X is a categorical variable and Y is a continuous variable, which can output single factor analysis results, including t test, analysis of variance and rank sum test, etc.;
② X is a categorical variable, Y is a categorical variable, output the contingency, that is, the result of the chi-square test;
③ X is a continuous variable, Y is a continuous variable, output a single factor linear regression;
④ X is a continuous variable, Y is a categorical variable, and logistic regression is output.
Therefore, this is the characteristic of the JMP function table, which categorizes statistical methods from the purpose, because whether it is t test, chi-square test, analysis of variance, etc., the structure is the same, it is a grouping variable, an analysis indicator , Which corresponds to the two situations mentioned above. In other words, the comparison between groups is included in the function table of Fit Y with X, but the function of the function table of Fit Y with X is not limited to the comparison between groups. We will continue to introduce it in the following article.
How to use X Fit Y 」Complete the comparison between groups
Next, let's take a case to see how to use "fit Y with X" to achieve comparison between groups.
Suppose we have the following information (Figure 5). Our purpose is to explore whether there are differences in the physical health scores of people with different dyspnea levels. In other words, the degree of dyspnea is the grouping variable X (also called argument, explanatory variable), and the physical health score is the analytical variable Y (also called outcome variable, dependent variable).

Figure 5 Data used in this article
Click "Analyze" → "Fit Y with X" to enter the operation interface, as shown in Figure 6. Difficulty breathing is a grouping variable, so put it in "X, factor", physical health score as the outcome indicator, put it in "Y, response", click OK to enter the result interface.

Figure 6 Schematic diagram of comparison operation between groups
The result is shown in Figure 7. When you look at this result, you may be puzzled, because there is only one picture shown in Figure 7 in the result.
This is also a major feature of JMP, that is: in the results interface you can display the desired results according to your purpose, instead of selecting in the menu. There is an advantage to selecting in the results, you are not used to switch back to the menu operation interface.

Figure 7 Output result graph
If you click on the small red triangle menu in the upper left corner of Figure 7, you can see that the available results are so rich (Figure 8), which includes various methods that may be used in the comparison between continuous variable groups, such as t-test, Analysis of variance, various non-parametric tests, equivalence tests, homogeneity of variance tests, etc. You can check according to the actual situation to display the corresponding part of the result.

Figure 8 Comparison result interface between continuous variable groups
For example, in this example, the group variable dyspnea is divided into two groups. We can look back and compare the ideas in Figure 1. For the continuous data comparison between the two groups, the methods that can be considered include t-test, adjusted t-test (t'-test) and non- Parameter verification.
As for which method you need to choose in the end, this is not a question of statistical software, but the analyst’s own work. You must first determine whether the two sets of physical health scores meet the normal distribution and whether the variances are uniform. If these two If the conditions are met, you can check the result of the t test, otherwise you may need to choose a non-parametric test method.
For example, if we want to know whether the two groups have the same variance, we can check "Unequal Variance" in Figure 8. After checking, the result interface will have more results about the homogeneity of variance test (Figure 9). The results show that the P value is far less than 0.05, and the variance cannot be considered uniform, that is, the t test cannot be directly used.
The result also gives the comparison results of the two groups under the condition of uneven variance, that is, the Welch test result in the last part of the figure. The results have clearly stated that this method can be used for the situation where the variances of the two groups are not equal. From the results, it can be seen that the physical health scores of the two groups are statistically different.

Figure 9 Test results of homogeneity of variance
JMP Comparison function table between groups 4 Big feature
Through the above preliminary introduction, I believe that everyone has a certain understanding of JMP's implementation of comparison operations between groups, from which you can discover the four major characteristics of JMP statistical analysis:
1. Operation is extremely simple
The operation menu of JMP is very simple, you only need to select x and y, that is, as long as you can clearly distinguish which is the grouping variable and which is the ending variable. This is not a problem for researchers.
2. Exploratory Autonomous Analysis
The results interface of JMP gives analysts great initiative. You can check or check certain results according to your needs.
This is actually a good thing, because it requires you to first clarify what method you want to use, instead of every continuous variable, you must use the t test. You need to figure out the normality and homogeneity of variance of continuous variables, and then check the results you want based on the results.
3. Interactive visualization everywhere
As a software featuring interactive visualization, the part of JMP analysis results that can be displayed graphically will display the results graphically, which can facilitate the analyst to more intuitively find the difference between groups. It can be said that interactive visual analysis is ubiquitous in JMP.
4. Second exploration and analysis in the results
In the JMP results interface, in addition to providing various methods, it also provides various options for modification. You can modify the graphics and results in the results at any time, and it is very convenient to carry out exploratory analysis flexibly.
Through a simple case, the powerful function of JMP group comparison is introduced. In the follow-up article, we will lead you to a detailed description of the specific group comparison method and how to operate it in JMP, download JMP, and open Your data analysis journey.
original: A magical JMP menu to realize the comparison of all data groups
[Recommended reading] #10 must-learn skills for data analysis: