Comparison between groups is a basic content in statistical analysis. Simply put, it is to compare indicators between two or more groups. This indicator can be a continuous variable or a categorical variable. Any statistical analysis is almost inseparable from comparisons between groups. For example, in a randomized controlled trial, the main purpose is to compare whether there is any difference in efficacy between two groups; in a multivariate analysis, the comparison between groups is usually also used as the baseline result and needs to be shown to everyone.
Today we are going to introduce a magical function table in JMP that can achieve almost all comparisons between groups. This function table is - Fit Y with X.
what is based on x fitting y ?
To put it simply, consider the group factor as x and the variable to be analyzed as the dependent variable y. Based on the variable types of x and y, the JMP software will automatically determine the appropriate method.
Why is this function so amazing? This article explains each from several aspects:
- Selection of common comparison methods between groups;
- From a macro perspective, connect common comparison methods between groups;
- Through a case, we will introduce how to use one function table of JMP to realize all inter-group comparisons.
As for the specific comparison methods between groups, we will introduce them in a series of articles later.
How to choose a comparison method between groups?
There are many ways to compare between groups, depending on the number of groups, the type of analysis variables, etc.
Statistical methods for comparison between groups of continuous variables mainly include t test, analysis of variance, rank sum test, etc. You can refer to Figure 1 when choosing statistical methods for comparison between continuous variable groups. If you carefully refer to this picture when conducting data analysis, you will not use the t test to analyze non-normal data, or forget to do the homogeneity of variance test. mistake.

Figure 1 Ideas for selecting comparison methods between continuous variable groups
When choosing a statistical method, key factors to consider include:
- Study design (completely randomized or paired design)
- Number of groups (two or more groups)
- Normal distribution (normal or non-normal)
- Homogeneity of variances (equal or uneven variances)
The main statistical methods for comparison between groups of categorical variables are chi-square test and rank sum test. See Figure 2 for method selection.
When choosing statistical methods for comparison between groups of categorical variables, the main factors to consider include:
- Study design (completely randomized or paired design)
- Compare the number of groups (two or more groups)
- Category of outcome indicators (binary or multi-category; ordered or disordered)
The choice of method is mainly related to the nature of the outcome indicator (note not the grouping variable):
- If it is a dichotomous outcome, use the chi-square test;
- If it is a multi-category outcome, you need to consider whether the outcome indicator is ordered or disordered. If it is an unordered variable, use the chi-square test. If it is an ordered variable, use the rank sum test.

Figure 2 Ideas for selecting comparison methods between groups of categorical variables
JMP Group Comparison menu in
In JMP, most comparisons between groups can be implemented in the Fit Y by accomplish.

Figure 3 Fitting Y menu with X
The interface of fitting X to Y function table is shown in Figure 4. You can have an intuitive impression first.

Figure 4 Use X to fit 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).
You can notice that in the lower left corner of Figure 4, four types of methods are combined according to whether x is categorical or continuous and y is categorical or continuous:
① X is a categorical variable, Y is a continuous variable, and single factor analysis results can be output, including t test, analysis of variance and rank sum test, etc.;
② X is a categorical variable, Y is a categorical variable, and the contingency is output, which is the result of the chi-square test;
③ X is a continuous variable, Y is a continuous variable, and single-factor linear regression is output;
④ X is a continuous variable, Y is a categorical variable, and logistic regression is output.
Therefore, this is the feature of the JMP function table. It classifies statistical methods by purpose, because whether it is t test, chi-square test, variance analysis, etc., its structure is the same, which is a grouping variable and an analysis indicator. , which corresponds to the two situations ①② mentioned above. In other words, comparison between groups is included in the Fit Y with X menu, but the function of the Fit Y with
How to use "With X fitting Y "Complete comparison between groups
Next, let's take a look at how to use "Fit Y with X" to achieve inter-group comparison through a case.
Suppose we have the following data (Figure 5). Our purpose was to explore whether there were differences in physical health scores among people with different levels of dyspnea. In other words, the degree of dyspnea is the grouping variable X (also called the index, explanatory variable), and the physical health score is the analysis variable Y (also called the outcome variable, dependent variable).

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

Figure 6 Schematic diagram of comparison operation between groups
The results are shown in Figure 7. When you look at this result, you may be confused because there is only one picture shown in Figure 7.
This is also a major feature of JMP, that is, the results you need can be displayed according to your purpose in the results interface instead of selecting them in the menu. The advantage of selecting from the results is that you don't have to switch back and forth to the menu interface.

Figure 7 Output result diagram
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 comparisons between groups of continuous variables, 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 partial results.

Figure 8 Comparison results interface between continuous variable groups
For example, in this example, the grouping variable dyspnea is divided into two groups. We can refer back to the idea in Figure 1. For the comparison of continuous data between the two groups, the methods that can be considered include t test, corrected t test (t' test) and non- Parametric testing.
As for which method needs to be chosen in the end, this is not a problem of the statistical software, but the job of the analyst himself. You must first clarify whether the two sets of physical health scores satisfy the normal distribution and whether the variances are equal. If these two If the conditions are met, you can check the results of the t test, otherwise you may need to choose the non-parametric test method.
For example, if we want to know whether the two groups have equal variances, we can check "Unequal variances" in Figure 8. After checking, the results interface will show some results about the homogeneity of variance test (Figure 9). The results show that the P value is far less than 0.05, and the variances cannot be considered equal, that is, the t test cannot be used directly.
The results also provide the comparison results of the two groups under the condition of unequal variances, that is, the Welch test results in the last part of the figure. The results have clearly shown that this method can be used when the variances of the two groups are unequal. It can be seen from the results that there is a statistical difference in the physical health scores between the two groups.

Figure 9 Results of homogeneity of variance test
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 inter-group comparison operation. From it, we can discover the four major features of JMP statistical analysis:
1. Extremely simple to operate
The operation menu of JMP is very simple. You only need to select x and y. That is to say, 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
JMP's results interface gives analysts great initiative. You can check or check off 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 using the t test every time you have a continuous variable. You need to first figure out the normality and homogeneity of variances of continuous variables, and then check the results you want based on the results.
3. Interactive visualization everywhere
As a software characterized by interactive visualization, JMP analysis results will be displayed graphically for those parts that can be displayed graphically, which can facilitate analysts to more intuitively discover the size of differences between groups. It can be said that interactive visual analysis is everywhere in JMP.
4. Secondary exploration analysis in results
In addition to providing various methods, the JMP results interface also provides various modification options. You can modify graphics and results in the results at any time, and conduct exploratory analysis flexibly, which is very convenient.
Through a simple case, the powerful function of JMP inter-group comparison is introduced. In subsequent articles, we will lead you to explain in detail the specific inter-group comparison method and how to operate it in JMP. Download JMP. Start your data analysis journey.
original: A magical JMP menu to achieve all inter-group comparisons of data
[Recommended reading] #10 must-learn skills for data analysis: